Changeset 120475 in webkit
- Timestamp:
- Jun 15, 2012, 10:16:30 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/inspector/filesystem/read-directory.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/Inspector.json (modified) (1 diff)
-
Source/WebCore/inspector/InspectorFileSystemAgent.cpp (modified) (4 diffs)
-
Source/WebCore/inspector/InspectorFileSystemAgent.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120471 r120475 1 2012-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 1 10 2012-06-15 Pavel Feldman <pfeldman@chromium.org> 2 11 -
trunk/LayoutTests/http/tests/inspector/filesystem/read-directory.html
r120430 r120475 38 38 InspectorTest.addSniffer(FileSystemDispatcher.prototype, "didReadDirectory", step5, false); 39 39 // 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"); 41 41 } 42 42 … … 47 47 InspectorTest.addSniffer(FileSystemDispatcher.prototype, "didReadDirectory", step6, false); 48 48 // 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"); 50 50 } 51 51 -
trunk/Source/WebCore/ChangeLog
r120474 r120475 1 2012-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 1 20 2012-06-15 Alexander Pavlov <apavlov@chromium.org> 2 21 -
trunk/Source/WebCore/inspector/Inspector.json
r120177 r120475 1431 1431 "parameters": [ 1432 1432 { "name": "requestId", "type": "integer" }, 1433 { "name": "frameId", "type": "string" },1434 1433 { "name": "url", "type": "string" } 1435 1434 ] -
trunk/Source/WebCore/inspector/InspectorFileSystemAgent.cpp
r120177 r120475 53 53 #include "LocalFileSystem.h" 54 54 #include "MIMETypeRegistry.h" 55 #include "SecurityOrigin.h" 55 56 56 57 using WebCore::TypeBuilder::Array; … … 309 310 } 310 311 311 void InspectorFileSystemAgent::readDirectory(ErrorString*, int requestId, const String& frameId, const String&url)312 void InspectorFileSystemAgent::readDirectory(ErrorString*, int requestId, const String& url) 312 313 { 313 314 if (!m_enabled || !m_frontendProvider) … … 315 316 ASSERT(m_frontendProvider->frontend()); 316 317 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 319 321 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());324 322 } 325 323 … … 352 350 ASSERT(instrumentingAgents); 353 351 ASSERT(state); 352 ASSERT(m_pageAgent); 354 353 m_instrumentingAgents->setInspectorFileSystemAgent(this); 355 354 } 356 355 356 ScriptExecutionContext* 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 357 365 } // namespace WebCore 358 366 -
trunk/Source/WebCore/inspector/InspectorFileSystemAgent.h
r120177 r120475 47 47 class InspectorState; 48 48 class InstrumentingAgents; 49 class ScriptExecutionContext; 50 class SecurityOrigin; 49 51 50 52 class InspectorFileSystemAgent : public InspectorBaseAgent<InspectorFileSystemAgent>, public InspectorBackendDispatcher::FileSystemCommandHandler { … … 58 60 virtual void disable(ErrorString*) OVERRIDE; 59 61 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; 61 63 62 64 virtual void setFrontend(InspectorFrontend*) OVERRIDE; 63 65 virtual void clearFrontend() OVERRIDE; 64 66 virtual void restore() OVERRIDE; 67 65 68 private: 66 69 InspectorFileSystemAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorState*); 70 ScriptExecutionContext* scriptExecutionContextForOrigin(SecurityOrigin*); 67 71 68 72 InspectorPageAgent* m_pageAgent;
Note:
See TracChangeset
for help on using the changeset viewer.