⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 120475 in webkit


Ignore:
Timestamp:
Jun 15, 2012, 10:16:30 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Move FileSystem frame management from frontend to backend
https://bugs.webkit.org/show_bug.cgi?id=89190

Patch by Taiju Tsuiki <tzik@chromium.org> on 2012-06-15
Reviewed by Vsevolod Vlasov.

Source/WebCore:

Test: http/tests/inspector/filesystem/read-directory.html

  • inspector/Inspector.json:
  • inspector/InspectorFileSystemAgent.cpp:

(WebCore::InspectorFileSystemAgent::readDirectory):
(WebCore::InspectorFileSystemAgent::InspectorFileSystemAgent):
(WebCore::InspectorFileSystemAgent::scriptExecutionContextForOrigin):
(WebCore):

  • inspector/InspectorFileSystemAgent.h:

(WebCore):
(InspectorFileSystemAgent):

LayoutTests:

  • http/tests/inspector/filesystem/read-directory.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120471 r120475  
     12012-06-15  Taiju Tsuiki  <tzik@chromium.org>
     2
     3        Web Inspector: Move FileSystem frame management from frontend to backend
     4        https://bugs.webkit.org/show_bug.cgi?id=89190
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * http/tests/inspector/filesystem/read-directory.html:
     9
    1102012-06-15  Pavel Feldman  <pfeldman@chromium.org>
    211
  • trunk/LayoutTests/http/tests/inspector/filesystem/read-directory.html

    r120430 r120475  
    3838        InspectorTest.addSniffer(FileSystemDispatcher.prototype, "didReadDirectory", step5, false);
    3939        // FIXME: Call FileSystemDispatcher through FileSystemDispatcher implementation after it landed.
    40         FileSystemAgent.readDirectory(1, WebInspector.resourceTreeModel.mainFrame.id, "filesystem:http://127.0.0.1/temporary/hoge");
     40        FileSystemAgent.readDirectory(1, "filesystem:http://127.0.0.1:8000/temporary/hoge");
    4141    }
    4242
     
    4747        InspectorTest.addSniffer(FileSystemDispatcher.prototype, "didReadDirectory", step6, false);
    4848        // FIXME: Call FileSystemDispatcher through FileSystemDispatcher implementation after it landed.
    49         FileSystemAgent.readDirectory(1, WebInspector.resourceTreeModel.mainFrame.id, "filesystem:http://127.0.0.1/temporary/foo");
     49        FileSystemAgent.readDirectory(1, "filesystem:http://127.0.0.1:8000/temporary/foo");
    5050    }
    5151
  • trunk/Source/WebCore/ChangeLog

    r120474 r120475  
     12012-06-15  Taiju Tsuiki  <tzik@chromium.org>
     2
     3        Web Inspector: Move FileSystem frame management from frontend to backend
     4        https://bugs.webkit.org/show_bug.cgi?id=89190
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Test: http/tests/inspector/filesystem/read-directory.html
     9
     10        * inspector/Inspector.json:
     11        * inspector/InspectorFileSystemAgent.cpp:
     12        (WebCore::InspectorFileSystemAgent::readDirectory):
     13        (WebCore::InspectorFileSystemAgent::InspectorFileSystemAgent):
     14        (WebCore::InspectorFileSystemAgent::scriptExecutionContextForOrigin):
     15        (WebCore):
     16        * inspector/InspectorFileSystemAgent.h:
     17        (WebCore):
     18        (InspectorFileSystemAgent):
     19
    1202012-06-15  Alexander Pavlov  <apavlov@chromium.org>
    221
  • trunk/Source/WebCore/inspector/Inspector.json

    r120177 r120475  
    14311431                "parameters": [
    14321432                    { "name": "requestId", "type": "integer" },
    1433                     { "name": "frameId", "type": "string" },
    14341433                    { "name": "url", "type": "string" }
    14351434                ]
  • trunk/Source/WebCore/inspector/InspectorFileSystemAgent.cpp

    r120177 r120475  
    5353#include "LocalFileSystem.h"
    5454#include "MIMETypeRegistry.h"
     55#include "SecurityOrigin.h"
    5556
    5657using WebCore::TypeBuilder::Array;
     
    309310}
    310311
    311 void InspectorFileSystemAgent::readDirectory(ErrorString*, int requestId, const String& frameId, const String& url)
     312void InspectorFileSystemAgent::readDirectory(ErrorString*, int requestId, const String& url)
    312313{
    313314    if (!m_enabled || !m_frontendProvider)
     
    315316    ASSERT(m_frontendProvider->frontend());
    316317
    317     Frame* frame = m_pageAgent->frameForId(frameId);
    318     if (!frame) {
     318    if (ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextForOrigin(SecurityOrigin::createFromString(url).get()))
     319        ReadDirectoryTask::create(m_frontendProvider, requestId, url)->start(scriptExecutionContext);
     320    else
    319321        m_frontendProvider->frontend()->didReadDirectory(requestId, static_cast<int>(FileError::ABORT_ERR), 0);
    320         return;
    321     }
    322 
    323     ReadDirectoryTask::create(m_frontendProvider, requestId, url)->start(frame->document());
    324322}
    325323
     
    352350    ASSERT(instrumentingAgents);
    353351    ASSERT(state);
     352    ASSERT(m_pageAgent);
    354353    m_instrumentingAgents->setInspectorFileSystemAgent(this);
    355354}
    356355
     356ScriptExecutionContext* InspectorFileSystemAgent::scriptExecutionContextForOrigin(SecurityOrigin* origin)
     357{
     358    for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
     359        if (frame->document() && frame->document()->securityOrigin()->isSameSchemeHostPort(origin))
     360            return frame->document();
     361    }
     362    return 0;
     363}
     364
    357365} // namespace WebCore
    358366
  • trunk/Source/WebCore/inspector/InspectorFileSystemAgent.h

    r120177 r120475  
    4747class InspectorState;
    4848class InstrumentingAgents;
     49class ScriptExecutionContext;
     50class SecurityOrigin;
    4951
    5052class InspectorFileSystemAgent : public InspectorBaseAgent<InspectorFileSystemAgent>, public InspectorBackendDispatcher::FileSystemCommandHandler {
     
    5860    virtual void disable(ErrorString*) OVERRIDE;
    5961
    60     virtual void readDirectory(ErrorString*, int requestId, const String& frameId, const String& url) OVERRIDE;
     62    virtual void readDirectory(ErrorString*, int requestId, const String& url) OVERRIDE;
    6163
    6264    virtual void setFrontend(InspectorFrontend*) OVERRIDE;
    6365    virtual void clearFrontend() OVERRIDE;
    6466    virtual void restore() OVERRIDE;
     67
    6568private:
    6669    InspectorFileSystemAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorState*);
     70    ScriptExecutionContext* scriptExecutionContextForOrigin(SecurityOrigin*);
    6771
    6872    InspectorPageAgent* m_pageAgent;
Note: See TracChangeset for help on using the changeset viewer.