Title: [101236] trunk/Source/WebCore
Revision
101236
Author
[email protected]
Date
2011-11-28 02:00:41 -0800 (Mon, 28 Nov 2011)

Log Message

[Inspector][FileSystem]: Capture DOMFileSystem object.
Adding files for FileSystem support to Inspector.
Adding hooks into DOMFileSystem creation and destruction.
https://bugs.webkit.org/show_bug.cgi?id=72456

Patch by Taiju TSUIKI <[email protected]> on 2011-11-28
Reviewed by Pavel Feldman.

Tests should be added in later CL.

* CMakeLists.txt:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::create):
* fileapi/DOMFileSystem.h:
* inspector/CodeGeneratorInspector.py:
* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::restoreInspectorStateFromCookie):
* inspector/InspectorController.h:
* inspector/InspectorFileSystemAgent.cpp: Added.
* inspector/InspectorFileSystemAgent.h: Added.
* inspector/InspectorFileSystemInstrumentation.h: Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didOpenFileSystemImpl):
* inspector/InspectorInstrumentation.h:
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::inspectorFileSystemAgent):
(WebCore::InstrumentingAgents::setInspectorFileSystemAgent):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::connectFrontend):
* inspector/front-end/inspector.js:

Modified Paths

Added Paths

Property Changed

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (101235 => 101236)


--- trunk/Source/WebCore/CMakeLists.txt	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/CMakeLists.txt	2011-11-28 10:00:41 UTC (rev 101236)
@@ -891,6 +891,7 @@
     inspector/InspectorDatabaseAgent.cpp
     inspector/InspectorDatabaseResource.cpp
     inspector/InspectorDebuggerAgent.cpp
+    inspector/InspectorFileSystemAgent.cpp
     inspector/InspectorFrontendClientLocal.cpp
     inspector/InspectorFrontendHost.cpp
     inspector/InspectorInstrumentation.cpp

Modified: trunk/Source/WebCore/ChangeLog (101235 => 101236)


--- trunk/Source/WebCore/ChangeLog	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/ChangeLog	2011-11-28 10:00:41 UTC (rev 101236)
@@ -1,3 +1,43 @@
+2011-11-28  Taiju TSUIKI  <[email protected]>
+
+        [Inspector][FileSystem]: Capture DOMFileSystem object.
+        Adding files for FileSystem support to Inspector.
+        Adding hooks into DOMFileSystem creation and destruction.
+        https://bugs.webkit.org/show_bug.cgi?id=72456
+
+        Reviewed by Pavel Feldman.
+
+        Tests should be added in later CL.
+
+        * CMakeLists.txt:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * fileapi/DOMFileSystem.cpp:
+        (WebCore::DOMFileSystem::create):
+        * fileapi/DOMFileSystem.h:
+        * inspector/CodeGeneratorInspector.py:
+        * inspector/Inspector.json:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::restoreInspectorStateFromCookie):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFileSystemAgent.cpp: Added.
+        * inspector/InspectorFileSystemAgent.h: Added.
+        * inspector/InspectorFileSystemInstrumentation.h: Added.
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didOpenFileSystemImpl):
+        * inspector/InspectorInstrumentation.h:
+        * inspector/InstrumentingAgents.h:
+        (WebCore::InstrumentingAgents::InstrumentingAgents):
+        (WebCore::InstrumentingAgents::inspectorFileSystemAgent):
+        (WebCore::InstrumentingAgents::setInspectorFileSystemAgent):
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::connectFrontend):
+        * inspector/front-end/inspector.js:
+
 2011-11-28  Luke Macpherson   <[email protected]>
 
         Implement CSSPropertyWebkitFlowInto and CSSPropertyWebkitFlowFrom in CSSStyleApplyProperty.

Modified: trunk/Source/WebCore/WebCore.gypi (101235 => 101236)


--- trunk/Source/WebCore/WebCore.gypi	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/WebCore.gypi	2011-11-28 10:00:41 UTC (rev 101236)
@@ -2742,6 +2742,9 @@
             'inspector/InspectorDatabaseResource.h',
             'inspector/InspectorDebuggerAgent.cpp',
             'inspector/InspectorDebuggerAgent.h',
+            'inspector/InspectorFileSystemAgent.cpp',
+            'inspector/InspectorFileSystemAgent.h',
+            'inspector/InspectorFileSystemInstrumentation.h',
             'inspector/InspectorFrontendChannel.h',
             'inspector/InspectorFrontendClientLocal.cpp',
             'inspector/InspectorFrontendHost.cpp',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (101235 => 101236)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-11-28 10:00:41 UTC (rev 101236)
@@ -68506,6 +68506,18 @@
 				>
 			</File>
 			<File
+				RelativePath="..\inspector\InspectorFileSystemAgent.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\inspector\InspectorFileSystemAgent.h"
+				>
+			</File>
+			<File
+				RelativePath="..\inspector\InspectorFileSystemInstrumentation.h"
+				>
+			</File>
+			<File
 				RelativePath="..\inspector\InspectorFrontendChannel.h"
 				>
 			</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (101235 => 101236)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-11-28 10:00:41 UTC (rev 101236)
@@ -321,6 +321,9 @@
 		15C77094100D3CA8005BA267 /* JSValidityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15C77092100D3CA8005BA267 /* JSValidityState.cpp */; };
 		15C770A5100D41CD005BA267 /* DOMValidityState.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15C770A3100D41CD005BA267 /* DOMValidityState.mm */; };
 		15C770A6100D41CD005BA267 /* DOMValidityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 15C770A4100D41CD005BA267 /* DOMValidityState.h */; };
+		15D17D21147231EB005EBCA6 /* InspectorFileSystemAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15D17D1E147231EB005EBCA6 /* InspectorFileSystemAgent.cpp */; };
+		15D17D22147231EB005EBCA6 /* InspectorFileSystemAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D17D1F147231EB005EBCA6 /* InspectorFileSystemAgent.h */; };
+		15D17D23147231EB005EBCA6 /* InspectorFileSystemInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D17D20147231EB005EBCA6 /* InspectorFileSystemInstrumentation.h */; };
 		163E88F7118A39D200ED9231 /* SimpleFontDataCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */; };
 		163E8B13118B3ADD00ED9231 /* SimpleFontDataATSUI.mm in Sources */ = {isa = PBXBuildFile; fileRef = 163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */; };
 		185BCF280F3279CE000EA262 /* ThreadTimers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 185BCF260F3279CE000EA262 /* ThreadTimers.cpp */; };
@@ -1383,6 +1386,7 @@
 		5038BE411472AD980095E0D1 /* CachedShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 5038BE3F1472AD980095E0D1 /* CachedShader.h */; };
 		508CCA4F13CF106B003151F3 /* RenderFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 508CCA4D13CF106B003151F3 /* RenderFlowThread.h */; };
 		508CCA5013CF106B003151F3 /* RenderFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 508CCA4E13CF106B003151F3 /* RenderFlowThread.cpp */; };
+		50B42158146976960087E604 /* WebKitCSSShaderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 50B42157146976960087E604 /* WebKitCSSShaderValue.h */; };
 		50E566D6139E38C500214433 /* CSSWrapShapes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 501BAAB11395114B00F7ACEB /* CSSWrapShapes.cpp */; };
 		510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5101846A0B08602A004A825F /* CachedPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* CachedPage.cpp */; };
@@ -7410,6 +7414,9 @@
 		15C77092100D3CA8005BA267 /* JSValidityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSValidityState.cpp; sourceTree = "<group>"; };
 		15C770A3100D41CD005BA267 /* DOMValidityState.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMValidityState.mm; sourceTree = "<group>"; };
 		15C770A4100D41CD005BA267 /* DOMValidityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMValidityState.h; sourceTree = "<group>"; };
+		15D17D1E147231EB005EBCA6 /* InspectorFileSystemAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFileSystemAgent.cpp; sourceTree = "<group>"; };
+		15D17D1F147231EB005EBCA6 /* InspectorFileSystemAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFileSystemAgent.h; sourceTree = "<group>"; };
+		15D17D20147231EB005EBCA6 /* InspectorFileSystemInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFileSystemInstrumentation.h; sourceTree = "<group>"; };
 		163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleFontDataCoreText.cpp; sourceTree = "<group>"; };
 		163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleFontDataATSUI.mm; sourceTree = "<group>"; };
 		185BCF260F3279CE000EA262 /* ThreadTimers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadTimers.cpp; sourceTree = "<group>"; };
@@ -14546,6 +14553,9 @@
 				7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */,
 				41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */,
 				41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */,
+				15D17D1E147231EB005EBCA6 /* InspectorFileSystemAgent.cpp */,
+				15D17D1F147231EB005EBCA6 /* InspectorFileSystemAgent.h */,
+				15D17D20147231EB005EBCA6 /* InspectorFileSystemInstrumentation.h */,
 				2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */,
 				F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */,
 				F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */,
@@ -23092,6 +23102,8 @@
 				F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */,
 				7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */,
 				41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */,
+				15D17D22147231EB005EBCA6 /* InspectorFileSystemAgent.h in Headers */,
+				15D17D23147231EB005EBCA6 /* InspectorFileSystemInstrumentation.h in Headers */,
 				227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */,
 				F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
 				F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
@@ -26073,6 +26085,7 @@
 				F3D4C47812E07663003DA150 /* InspectorDOMDebuggerAgent.cpp in Sources */,
 				7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */,
 				41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */,
+				15D17D21147231EB005EBCA6 /* InspectorFileSystemAgent.cpp in Sources */,
 				4F4F5FFB11CBD2E100A186BF /* InspectorFrontend.cpp in Sources */,
 				F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
 				7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,

Modified: trunk/Source/WebCore/fileapi/DOMFileSystem.cpp (101235 => 101236)


--- trunk/Source/WebCore/fileapi/DOMFileSystem.cpp	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/fileapi/DOMFileSystem.cpp	2011-11-28 10:00:41 UTC (rev 101236)
@@ -45,12 +45,21 @@
 #include "FileWriter.h"
 #include "FileWriterBaseCallback.h"
 #include "FileWriterCallback.h"
+#include "InspectorFileSystemInstrumentation.h"
 #include "MetadataCallback.h"
 #include "ScriptExecutionContext.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
+// static
+PassRefPtr<DOMFileSystem> DOMFileSystem::create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
+{
+    RefPtr<DOMFileSystem> fileSystem(adoptRef(new DOMFileSystem(context, name, asyncFileSystem)));
+    InspectorInstrumentation::didOpenFileSystem(fileSystem.get());
+    return fileSystem;
+}
+
 DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
     : DOMFileSystemBase(context, name, asyncFileSystem)
     , ActiveDOMObject(context, this)

Modified: trunk/Source/WebCore/fileapi/DOMFileSystem.h (101235 => 101236)


--- trunk/Source/WebCore/fileapi/DOMFileSystem.h	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/fileapi/DOMFileSystem.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -47,10 +47,7 @@
 
 class DOMFileSystem : public DOMFileSystemBase, public ActiveDOMObject {
 public:
-    static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
-    {
-        return adoptRef(new DOMFileSystem(context, name, asyncFileSystem));
-    }
+    static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
 
     PassRefPtr<DirectoryEntry> root();
 

Modified: trunk/Source/WebCore/inspector/CodeGeneratorInspector.py (101235 => 101236)


--- trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2011-11-28 10:00:41 UTC (rev 101236)
@@ -42,6 +42,7 @@
     "Database": "ENABLE_SQL_DATABASE",
     "Debugger": "ENABLE_JAVASCRIPT_DEBUGGER",
     "DOMDebugger": "ENABLE_JAVASCRIPT_DEBUGGER",
+    "FileSystem": "ENABLE_FILE_SYSTEM",
     "Profiler": "ENABLE_JAVASCRIPT_DEBUGGER",
     "Worker": "ENABLE_WORKERS",
 }
Property changes on: trunk/Source/WebCore/inspector/CodeGeneratorInspector.py
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/inspector/Inspector.json (101235 => 101236)


--- trunk/Source/WebCore/inspector/Inspector.json	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/Inspector.json	2011-11-28 10:00:41 UTC (rev 101236)
@@ -999,6 +999,22 @@
         ]
     },
     {
+        "domain": "FileSystem",
+        "hidden": true,
+        "commands": [
+            {
+                "name": "enable",
+                "description": "Enables events from backend."
+            },
+            {
+                "name": "disable",
+                "description": "Disables events from backend.."
+            }
+        ],
+        "events": [
+        ]
+    },
+    {
         "domain": "DOM",
         "description": "This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an <code>id</code>. This <code>id</code> can be used to get additional information on the Node, resolve it into the _javascript_ object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.<p>Note that <code>iframe</code> owner elements will return corresponding document elements as their child nodes.</p>",
         "types": [

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (101235 => 101236)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2011-11-28 10:00:41 UTC (rev 101236)
@@ -48,6 +48,7 @@
 #include "InspectorDOMStorageAgent.h"
 #include "InspectorDatabaseAgent.h"
 #include "InspectorDebuggerAgent.h"
+#include "InspectorFileSystemAgent.h"
 #include "InspectorFrontend.h"
 #include "InspectorFrontendClient.h"
 #include "InspectorInstrumentation.h"
@@ -79,6 +80,9 @@
 #if ENABLE(SQL_DATABASE)
     , m_databaseAgent(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get()))
 #endif
+#if ENABLE(FILE_SYSTEM)
+    , m_fileSystemAgent(InspectorFileSystemAgent::create(m_instrumentingAgents.get(), m_state.get()))
+#endif
     , m_domStorageAgent(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_state.get()))
     , m_timelineAgent(InspectorTimelineAgent::create(m_instrumentingAgents.get(), m_state.get()))
     , m_applicationCacheAgent(adoptPtr(new InspectorApplicationCacheAgent(m_instrumentingAgents.get(), m_pageAgent.get(), m_state.get())))
@@ -171,6 +175,9 @@
 #if ENABLE(SQL_DATABASE)
     m_databaseAgent->setFrontend(m_inspectorFrontend.get());
 #endif
+#if ENABLE(FILE_SYSTEM)
+    m_fileSystemAgent->setFrontend(m_inspectorFrontend.get());
+#endif
     m_domStorageAgent->setFrontend(m_inspectorFrontend.get());
 #if ENABLE(WORKERS)
     m_workerAgent->setFrontend(m_inspectorFrontend.get());
@@ -198,6 +205,9 @@
 #if ENABLE(_javascript__DEBUGGER)
         m_debuggerAgent.get(),
 #endif
+#if ENABLE(FILE_SYSTEM)
+        m_fileSystemAgent.get(),
+#endif
         m_resourceAgent.get(),
         m_pageAgent.get(),
 #if ENABLE(_javascript__DEBUGGER)
@@ -237,6 +247,9 @@
 #if ENABLE(SQL_DATABASE)
     m_databaseAgent->clearFrontend();
 #endif
+#if ENABLE(FILE_SYSTEM)
+    m_fileSystemAgent->clearFrontend();
+#endif
     m_domStorageAgent->clearFrontend();
     m_pageAgent->clearFrontend();
 #if ENABLE(WORKERS)
@@ -290,6 +303,9 @@
 #if ENABLE(SQL_DATABASE)
     m_databaseAgent->restore();
 #endif
+#if ENABLE(FILE_SYSTEM)
+    m_fileSystemAgent->restore();
+#endif
     m_domStorageAgent->restore();
 #if ENABLE(WORKERS)
     m_workerAgent->restore();

Modified: trunk/Source/WebCore/inspector/InspectorController.h (101235 => 101236)


--- trunk/Source/WebCore/inspector/InspectorController.h	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/InspectorController.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -53,6 +53,7 @@
 class InspectorDOMStorageAgent;
 class InspectorDatabaseAgent;
 class InspectorDebuggerAgent;
+class InspectorFileSystemAgent;
 class InspectorFrontend;
 class InspectorFrontendClient;
 class InspectorPageAgent;
@@ -127,6 +128,9 @@
 #if ENABLE(SQL_DATABASE)
     OwnPtr<InspectorDatabaseAgent> m_databaseAgent;
 #endif
+#if ENABLE(FILE_SYSTEM)
+    OwnPtr<InspectorFileSystemAgent> m_fileSystemAgent;
+#endif
     OwnPtr<InspectorDOMStorageAgent> m_domStorageAgent;
     OwnPtr<InspectorTimelineAgent> m_timelineAgent;
     OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent;

Added: trunk/Source/WebCore/inspector/InspectorFileSystemAgent.cpp (0 => 101236)


--- trunk/Source/WebCore/inspector/InspectorFileSystemAgent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/inspector/InspectorFileSystemAgent.cpp	2011-11-28 10:00:41 UTC (rev 101236)
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorFileSystemAgent.h"
+
+#if ENABLE(INSPECTOR) && ENABLE(FILE_SYSTEM)
+
+#include "InspectorState.h"
+#include "InstrumentingAgents.h"
+
+namespace WebCore {
+
+namespace FileSystemAgentState {
+static const char fileSystemAgentEnabled[] = "fileSystemAgentEnabled";
+}
+
+// static
+PassOwnPtr<InspectorFileSystemAgent> InspectorFileSystemAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* state)
+{
+    return adoptPtr(new InspectorFileSystemAgent(instrumentingAgents, state));
+}
+
+InspectorFileSystemAgent::~InspectorFileSystemAgent()
+{
+    m_instrumentingAgents->setInspectorFileSystemAgent(0);
+}
+
+void InspectorFileSystemAgent::didOpenFileSystem(PassRefPtr<DOMFileSystem> fileSystem)
+{
+    // TODO(tzik):
+    // Store fileSystem and notify the frontend using fileSystemAdded event.
+    // fileSystem should be associated with its name.
+}
+
+void InspectorFileSystemAgent::fileSystemInvalidated(PassRefPtr<DOMFileSystem> fileSystem)
+{
+    // TODO(tzik):
+    // Discard fileSystem if we have.
+    // If there is no other fileSystem who has same name with fileSystem,
+    // notify the frontend using fileSystemInvalidated event.
+}
+
+void InspectorFileSystemAgent::enable(ErrorString*)
+{
+    if (m_enabled)
+        return;
+    m_enabled = true;
+    m_state->setBoolean(FileSystemAgentState::fileSystemAgentEnabled, m_enabled);
+
+    // TODO(tzik):
+    // Pass all available FileSystem to the frontend, using fileSystemAdded event.
+}
+
+void InspectorFileSystemAgent::disable(ErrorString*)
+{
+    if (!m_enabled)
+        return;
+    m_enabled = false;
+    m_state->setBoolean(FileSystemAgentState::fileSystemAgentEnabled, m_enabled);
+}
+
+void InspectorFileSystemAgent::setFrontend(InspectorFrontend* frontend)
+{
+    ASSERT(frontend);
+    m_frontend = frontend->filesystem();
+}
+
+void InspectorFileSystemAgent::clearFrontend()
+{
+    m_frontend = 0;
+    m_enabled = false;
+    m_state->setBoolean(FileSystemAgentState::fileSystemAgentEnabled, m_enabled);
+}
+
+void InspectorFileSystemAgent::restore()
+{
+    m_enabled = m_state->getBoolean(FileSystemAgentState::fileSystemAgentEnabled);
+}
+
+InspectorFileSystemAgent::InspectorFileSystemAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state)
+    : m_instrumentingAgents(instrumentingAgents),
+      m_state(state),
+      m_frontend(0),
+      m_enabled(false)
+{
+    ASSERT(instrumentingAgents);
+    ASSERT(state);
+    m_instrumentingAgents->setInspectorFileSystemAgent(this);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR) && ENABLE(FILE_SYSTEM)

Added: trunk/Source/WebCore/inspector/InspectorFileSystemAgent.h (0 => 101236)


--- trunk/Source/WebCore/inspector/InspectorFileSystemAgent.h	                        (rev 0)
+++ trunk/Source/WebCore/inspector/InspectorFileSystemAgent.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorFileSystemAgent_h
+#define InspectorFileSystemAgent_h
+
+#if ENABLE(INSPECTOR) && ENABLE(FILE_SYSTEM)
+
+#include "InspectorFrontend.h"
+
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+class DOMFileSystem;
+class InspectorFrontend;
+class InspectorState;
+class InstrumentingAgents;
+
+class InspectorFileSystemAgent {
+public:
+    static PassOwnPtr<InspectorFileSystemAgent> create(InstrumentingAgents*, InspectorState*);
+    virtual ~InspectorFileSystemAgent();
+
+    void didOpenFileSystem(PassRefPtr<DOMFileSystem>);
+    void fileSystemInvalidated(PassRefPtr<DOMFileSystem>);
+
+    void enable(ErrorString*);
+    void disable(ErrorString*);
+
+    void setFrontend(InspectorFrontend*);
+    void clearFrontend();
+    void restore();
+private:
+    InspectorFileSystemAgent(InstrumentingAgents*, InspectorState*);
+
+    InstrumentingAgents* m_instrumentingAgents;
+    InspectorState* m_state;
+    InspectorFrontend::FileSystem* m_frontend;
+    bool m_enabled;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR) && ENABLE(FILE_SYSTEM)
+#endif // InspectorFileSystemAgent_h

Added: trunk/Source/WebCore/inspector/InspectorFileSystemInstrumentation.h (0 => 101236)


--- trunk/Source/WebCore/inspector/InspectorFileSystemInstrumentation.h	                        (rev 0)
+++ trunk/Source/WebCore/inspector/InspectorFileSystemInstrumentation.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorFileSystemInstrumentation_h
+#define InspectorFileSystemInstrumentation_h
+
+#include "DOMFileSystem.h"
+#include "InspectorInstrumentation.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+#if ENABLE(FILE_SYSTEM)
+inline void InspectorInstrumentation::didOpenFileSystem(PassRefPtr<DOMFileSystem> fileSystem)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(fileSystem->scriptExecutionContext()))
+        didOpenFileSystemImpl(instrumentingAgents, fileSystem);
+#endif // ENABLE(INSPECTOR)
+}
+#endif // ENABLE(FILE_SYSTEM)
+
+} // namespace WebCore
+
+#endif // InspectorFileSystemInstrumentation_h

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (101235 => 101236)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2011-11-28 10:00:41 UTC (rev 101236)
@@ -33,6 +33,7 @@
 
 #if ENABLE(INSPECTOR)
 
+#include "DOMFileSystem.h"
 #include "DOMWindow.h"
 #include "Database.h"
 #include "DocumentLoader.h"
@@ -47,6 +48,7 @@
 #include "InspectorDOMAgent.h"
 #include "InspectorDOMStorageAgent.h"
 #include "InspectorDebuggerAgent.h"
+#include "InspectorFileSystemAgent.h"
 #include "InspectorPageAgent.h"
 #include "InspectorProfilerAgent.h"
 #include "InspectorResourceAgent.h"
@@ -768,6 +770,14 @@
 }
 #endif
 
+#if ENABLE(FILE_SYSTEM)
+void InspectorInstrumentation::didOpenFileSystemImpl(InstrumentingAgents* instrumentingAgents, PassRefPtr<DOMFileSystem> fileSystem)
+{
+    if (InspectorFileSystemAgent* fileSystemAgent = instrumentingAgents->inspectorFileSystemAgent())
+        fileSystemAgent->didOpenFileSystem(fileSystem);
+}
+#endif // ENABLE(FILE_SYSTEM)
+
 void InspectorInstrumentation::didUseDOMStorageImpl(InstrumentingAgents* instrumentingAgents, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
 {
     InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent();

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (101235 => 101236)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -42,6 +42,7 @@
 namespace WebCore {
 
 class CharacterData;
+class DOMFileSystem;
 class DOMWindow;
 class DOMWrapperWorld;
 class Database;
@@ -176,6 +177,10 @@
     static void didOpenDatabase(ScriptExecutionContext*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
 #endif
 
+#if ENABLE(FILE_SYSTEM)
+    static void didOpenFileSystem(PassRefPtr<DOMFileSystem>);
+#endif
+
     static void didUseDOMStorage(Page*, StorageArea*, bool isLocalStorage, Frame*);
 
 #if ENABLE(WORKERS)
@@ -308,6 +313,10 @@
     static void didOpenDatabaseImpl(InstrumentingAgents*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
 #endif
 
+#if ENABLE(FILE_SYSTEM)
+    static void didOpenFileSystemImpl(InstrumentingAgents*, PassRefPtr<DOMFileSystem>);
+#endif
+
     static void didUseDOMStorageImpl(InstrumentingAgents*, StorageArea*, bool isLocalStorage, Frame*);
 
 #if ENABLE(WORKERS)

Modified: trunk/Source/WebCore/inspector/InstrumentingAgents.h (101235 => 101236)


--- trunk/Source/WebCore/inspector/InstrumentingAgents.h	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/InstrumentingAgents.h	2011-11-28 10:00:41 UTC (rev 101236)
@@ -46,6 +46,7 @@
 class InspectorDOMStorageAgent;
 class InspectorDatabaseAgent;
 class InspectorDebuggerAgent;
+class InspectorFileSystemAgent;
 class InspectorProfilerAgent;
 class InspectorResourceAgent;
 class InspectorRuntimeAgent;
@@ -71,6 +72,9 @@
 #if ENABLE(SQL_DATABASE)
         , m_inspectorDatabaseAgent(0)
 #endif
+#if ENABLE(FILE_SYSTEM)
+        , m_inspectorFileSystemAgent(0)
+#endif
         , m_inspectorApplicationCacheAgent(0)
 #if ENABLE(_javascript__DEBUGGER)
         , m_inspectorDebuggerAgent(0)
@@ -115,6 +119,11 @@
     void setInspectorDatabaseAgent(InspectorDatabaseAgent* agent) { m_inspectorDatabaseAgent = agent; }
 #endif
 
+#if ENABLE(FILE_SYSTEM)
+    InspectorFileSystemAgent* inspectorFileSystemAgent() const { return m_inspectorFileSystemAgent; }
+    void setInspectorFileSystemAgent(InspectorFileSystemAgent* agent) { m_inspectorFileSystemAgent = agent; }
+#endif
+
     InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; }
     void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; }
 
@@ -146,6 +155,9 @@
 #if ENABLE(SQL_DATABASE)
     InspectorDatabaseAgent* m_inspectorDatabaseAgent;
 #endif
+#if ENABLE(FILE_SYSTEM)
+    InspectorFileSystemAgent* m_inspectorFileSystemAgent;
+#endif
     InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent;
 #if ENABLE(_javascript__DEBUGGER)
     InspectorDebuggerAgent* m_inspectorDebuggerAgent;

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (101235 => 101236)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2011-11-28 10:00:41 UTC (rev 101236)
@@ -137,6 +137,9 @@
 #if ENABLE(_javascript__DEBUGGER)
         m_debuggerAgent.get(),
 #endif
+#if ENABLE(FILE_SYSTEM)
+        0, // InspectorFileSystemAgent
+#endif
         0, // InspectorResourceAgent
         0, // InspectorPageAgent
 #if ENABLE(_javascript__DEBUGGER)

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (101235 => 101236)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2011-11-28 09:51:04 UTC (rev 101235)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2011-11-28 10:00:41 UTC (rev 101236)
@@ -388,6 +388,7 @@
     this.console.enableAgent();
     DatabaseAgent.enable();
     DOMStorageAgent.enable();
+    FileSystemAgent.enable();
 
     WebInspector.showPanel(WebInspector.settings.lastActivePanel.get());
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to