Title: [159162] trunk/Source/WebCore
Revision
159162
Author
[email protected]
Date
2013-11-12 16:53:59 -0800 (Tue, 12 Nov 2013)

Log Message

Web Inspector: Extract InspectorAgentRegistry from InspectorBaseAgent
https://bugs.webkit.org/show_bug.cgi?id=124190

Patch by Joseph Pecoraro <[email protected]> on 2013-11-12
Reviewed by Timothy Hatcher.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAgentRegistry.cpp: Added.
(WebCore::InspectorAgentRegistry::append):
(WebCore::InspectorAgentRegistry::setFrontend):
(WebCore::InspectorAgentRegistry::clearFrontend):
(WebCore::InspectorAgentRegistry::registerInDispatcher):
(WebCore::InspectorAgentRegistry::discardAgents):
* inspector/InspectorAgentRegistry.h: Added.
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorBaseAgent.cpp: Removed.
* inspector/InspectorBaseAgent.h:
(WebCore::InspectorBaseAgentInterface::InspectorBaseAgentInterface):
(WebCore::InspectorBaseAgentInterface::~InspectorBaseAgentInterface):
* inspector/InspectorController.h:
* inspector/InspectorMemoryAgent.h:
* inspector/WorkerInspectorController.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (159161 => 159162)


--- trunk/Source/WebCore/CMakeLists.txt	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/CMakeLists.txt	2013-11-13 00:53:59 UTC (rev 159162)
@@ -1544,8 +1544,8 @@
     inspector/InjectedScriptManager.cpp
     inspector/InjectedScriptModule.cpp
     inspector/InspectorAgent.cpp
+    inspector/InspectorAgentRegistry.cpp
     inspector/InspectorApplicationCacheAgent.cpp
-    inspector/InspectorBaseAgent.cpp
     inspector/InspectorCSSAgent.cpp
     inspector/InspectorCanvasAgent.cpp
     inspector/InspectorClient.cpp

Modified: trunk/Source/WebCore/ChangeLog (159161 => 159162)


--- trunk/Source/WebCore/ChangeLog	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/ChangeLog	2013-11-13 00:53:59 UTC (rev 159162)
@@ -1,3 +1,31 @@
+2013-11-12  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Extract InspectorAgentRegistry from InspectorBaseAgent
+        https://bugs.webkit.org/show_bug.cgi?id=124190
+
+        Reviewed by Timothy Hatcher.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/InspectorAgentRegistry.cpp: Added.
+        (WebCore::InspectorAgentRegistry::append):
+        (WebCore::InspectorAgentRegistry::setFrontend):
+        (WebCore::InspectorAgentRegistry::clearFrontend):
+        (WebCore::InspectorAgentRegistry::registerInDispatcher):
+        (WebCore::InspectorAgentRegistry::discardAgents):
+        * inspector/InspectorAgentRegistry.h: Added.
+        * inspector/InspectorAllInOne.cpp:
+        * inspector/InspectorBaseAgent.cpp: Removed.
+        * inspector/InspectorBaseAgent.h:
+        (WebCore::InspectorBaseAgentInterface::InspectorBaseAgentInterface):
+        (WebCore::InspectorBaseAgentInterface::~InspectorBaseAgentInterface):
+        * inspector/InspectorController.h:
+        * inspector/InspectorMemoryAgent.h:
+        * inspector/WorkerInspectorController.h:
+
 2013-11-12  Alexey Proskuryakov  <[email protected]>
 
         Implement key generation and JWK import for RSASSA-PKCS1-v1_5

Modified: trunk/Source/WebCore/GNUmakefile.list.am (159161 => 159162)


--- trunk/Source/WebCore/GNUmakefile.list.am	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2013-11-13 00:53:59 UTC (rev 159162)
@@ -3764,9 +3764,10 @@
 	Source/WebCore/inspector/InjectedScriptModule.h \
 	Source/WebCore/inspector/InspectorAgent.cpp \
 	Source/WebCore/inspector/InspectorAgent.h \
+	Source/WebCore/inspector/InspectorAgentRegistry.cpp \
+	Source/WebCore/inspector/InspectorAgentRegistry.h \
 	Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp \
 	Source/WebCore/inspector/InspectorApplicationCacheAgent.h \
-	Source/WebCore/inspector/InspectorBaseAgent.cpp \
 	Source/WebCore/inspector/InspectorBaseAgent.h \
 	Source/WebCore/inspector/InspectorCanvasAgent.cpp \
 	Source/WebCore/inspector/InspectorCanvasAgent.h \

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (159161 => 159162)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2013-11-13 00:53:59 UTC (rev 159162)
@@ -17572,6 +17572,14 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\inspector\InspectorAgentRegistry.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\inspector\InspectorAllInOne.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -17588,14 +17596,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\inspector\InspectorBaseAgent.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\inspector\InspectorCanvasAgent.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (159161 => 159162)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2013-11-13 00:53:59 UTC (rev 159162)
@@ -4803,15 +4803,15 @@
     <ClCompile Include="..\inspector\InspectorAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
+    <ClCompile Include="..\inspector\InspectorAgentRegistry.cpp">
+      <Filter>inspector</Filter>
+    </ClCompile>
     <ClCompile Include="..\inspector\InspectorAllInOne.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
     <ClCompile Include="..\inspector\InspectorApplicationCacheAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
-    <ClCompile Include="..\inspector\InspectorBaseAgent.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
     <ClCompile Include="..\inspector\InspectorCanvasAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159161 => 159162)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-11-13 00:53:59 UTC (rev 159162)
@@ -2181,7 +2181,6 @@
 		7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; };
 		7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */; };
 		7AA51B6E1483B61600AD2752 /* InspectorBaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51B6C1483B61600AD2752 /* InspectorBaseAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */; };
 		7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */; };
 		7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */; };
 		7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */; };
@@ -3509,6 +3508,8 @@
 		A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */; };
 		A54A82EC15228D2F00C72BA6 /* DOMNodePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
 		A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
+		A556C288183206A8008CB720 /* InspectorAgentRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A556C286183206A8008CB720 /* InspectorAgentRegistry.cpp */; };
+		A556C289183206A8008CB720 /* InspectorAgentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A556C287183206A8008CB720 /* InspectorAgentRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
 		A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; };
 		A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
@@ -8932,7 +8933,6 @@
 		7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
 		7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorRuntimeAgent.cpp; sourceTree = "<group>"; };
 		7AA51B6C1483B61600AD2752 /* InspectorBaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBaseAgent.h; sourceTree = "<group>"; };
-		7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBaseAgent.cpp; sourceTree = "<group>"; };
 		7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorMemoryAgent.cpp; sourceTree = "<group>"; };
 		7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorMemoryAgent.h; sourceTree = "<group>"; };
 		7AABA25714BC613300AA9A11 /* DOMEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMEditor.cpp; sourceTree = "<group>"; };
@@ -10286,6 +10286,8 @@
 		A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = InspectorOverlayPage.css; sourceTree = "<group>"; };
 		A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode._javascript_; path = InspectorOverlayPage.js; sourceTree = "<group>"; };
 		A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNodePrivate.h; sourceTree = "<group>"; };
+		A556C286183206A8008CB720 /* InspectorAgentRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgentRegistry.cpp; sourceTree = "<group>"; };
+		A556C287183206A8008CB720 /* InspectorAgentRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentRegistry.h; sourceTree = "<group>"; };
 		A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
 		A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
 		A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
@@ -14381,9 +14383,10 @@
 				1C435CD314E8544F004E10EA /* Inspector.json */,
 				4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */,
 				4F2D205212EAE7B3005C2874 /* InspectorAgent.h */,
+				A556C286183206A8008CB720 /* InspectorAgentRegistry.cpp */,
+				A556C287183206A8008CB720 /* InspectorAgentRegistry.h */,
 				B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */,
 				B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
-				7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */,
 				7AA51B6C1483B61600AD2752 /* InspectorBaseAgent.h */,
 				AAD766E8157E502F00E85423 /* InspectorCanvasAgent.cpp */,
 				AAD766E9157E502F00E85423 /* InspectorCanvasAgent.h */,
@@ -21949,6 +21952,7 @@
 				29A8123F0FBB9C1D00510293 /* AccessibilityTableHeaderContainer.h in Headers */,
 				29A812310FBB9C1D00510293 /* AccessibilityTableRow.h in Headers */,
 				B5D31DFB11CF610B009F22B4 /* ActiveDOMCallback.h in Headers */,
+				A556C289183206A8008CB720 /* InspectorAgentRegistry.h in Headers */,
 				E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */,
 				BCF7E491137CD7C7001DDAE7 /* AdjustViewSizeOrNot.h in Headers */,
 				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
@@ -26449,7 +26453,6 @@
 				4F2D205512EAE7B3005C2874 /* InspectorAgent.cpp in Sources */,
 				B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
 				4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */,
-				7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */,
 				E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */,
 				AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */,
 				7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
@@ -27683,6 +27686,7 @@
 				AA2A5AD516A4861400975A25 /* SpeechSynthesis.cpp in Sources */,
 				AA2A5AD316A4860D00975A25 /* SpeechSynthesisEvent.cpp in Sources */,
 				AA2A5AD116A4860700975A25 /* SpeechSynthesisUtterance.cpp in Sources */,
+				A556C288183206A8008CB720 /* InspectorAgentRegistry.cpp in Sources */,
 				AA2A5ACD16A485FA00975A25 /* SpeechSynthesisVoice.cpp in Sources */,
 				A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */,
 				B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */,

Added: trunk/Source/WebCore/inspector/InspectorAgentRegistry.cpp (0 => 159162)


--- trunk/Source/WebCore/inspector/InspectorAgentRegistry.cpp	                        (rev 0)
+++ trunk/Source/WebCore/inspector/InspectorAgentRegistry.cpp	2013-11-13 00:53:59 UTC (rev 159162)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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"
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorAgentRegistry.h"
+
+namespace WebCore {
+
+void InspectorAgentRegistry::append(PassOwnPtr<InspectorBaseAgentInterface> agent)
+{
+    m_agents.append(agent);
+}
+
+void InspectorAgentRegistry::setFrontend(InspectorFrontend* frontend)
+{
+    for (size_t i = 0; i < m_agents.size(); i++)
+        m_agents[i]->setFrontend(frontend);
+}
+
+void InspectorAgentRegistry::clearFrontend()
+{
+    for (size_t i = 0; i < m_agents.size(); i++)
+        m_agents[i]->clearFrontend();
+}
+
+void InspectorAgentRegistry::registerInDispatcher(InspectorBackendDispatcher* dispatcher)
+{
+    for (size_t i = 0; i < m_agents.size(); i++)
+        m_agents[i]->registerInDispatcher(dispatcher);
+}
+
+void InspectorAgentRegistry::discardAgents()
+{
+    for (size_t i = 0; i < m_agents.size(); i++)
+        m_agents[i]->discardAgent();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)

Added: trunk/Source/WebCore/inspector/InspectorAgentRegistry.h (0 => 159162)


--- trunk/Source/WebCore/inspector/InspectorAgentRegistry.h	                        (rev 0)
+++ trunk/Source/WebCore/inspector/InspectorAgentRegistry.h	2013-11-13 00:53:59 UTC (rev 159162)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 InspectorAgentRegistry_h
+#define InspectorAgentRegistry_h
+
+#include "InspectorBaseAgent.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class InspectorBackendDispatcher;
+class InspectorFrontend;
+
+class InspectorAgentRegistry {
+public:
+    void append(PassOwnPtr<InspectorBaseAgentInterface>);
+
+    void setFrontend(InspectorFrontend*);
+    void clearFrontend();
+    void registerInDispatcher(InspectorBackendDispatcher*);
+    void discardAgents();
+
+private:
+    Vector<OwnPtr<InspectorBaseAgentInterface>> m_agents;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorAgentRegistry_h)

Modified: trunk/Source/WebCore/inspector/InspectorAllInOne.cpp (159161 => 159162)


--- trunk/Source/WebCore/inspector/InspectorAllInOne.cpp	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/InspectorAllInOne.cpp	2013-11-13 00:53:59 UTC (rev 159162)
@@ -37,8 +37,8 @@
 #include "InjectedScriptManager.cpp"
 #include "InjectedScriptModule.cpp"
 #include "InspectorAgent.cpp"
+#include "InspectorAgentRegistry.cpp"
 #include "InspectorApplicationCacheAgent.cpp"
-#include "InspectorBaseAgent.cpp"
 #include "InspectorCSSAgent.cpp"
 #include "InspectorCanvasAgent.cpp"
 #include "InspectorClient.cpp"

Deleted: trunk/Source/WebCore/inspector/InspectorBaseAgent.cpp (159161 => 159162)


--- trunk/Source/WebCore/inspector/InspectorBaseAgent.cpp	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/InspectorBaseAgent.cpp	2013-11-13 00:53:59 UTC (rev 159162)
@@ -1,80 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorBaseAgent.h"
-
-namespace WebCore {
-
-InspectorBaseAgentInterface::InspectorBaseAgentInterface(const String& name, InstrumentingAgents* instrumentingAgents)
-    : m_instrumentingAgents(instrumentingAgents)
-    , m_name(name)
-{
-}
-
-InspectorBaseAgentInterface::~InspectorBaseAgentInterface()
-{
-}
-
-void InspectorAgentRegistry::append(PassOwnPtr<InspectorBaseAgentInterface> agent)
-{
-    m_agents.append(agent);
-}
-
-void InspectorAgentRegistry::setFrontend(InspectorFrontend* frontend)
-{
-    for (size_t i = 0; i < m_agents.size(); i++)
-        m_agents[i]->setFrontend(frontend);
-}
-
-void InspectorAgentRegistry::clearFrontend()
-{
-    for (size_t i = 0; i < m_agents.size(); i++)
-        m_agents[i]->clearFrontend();
-}
-
-void InspectorAgentRegistry::registerInDispatcher(InspectorBackendDispatcher* dispatcher)
-{
-    for (size_t i = 0; i < m_agents.size(); i++)
-        m_agents[i]->registerInDispatcher(dispatcher);
-}
-
-void InspectorAgentRegistry::discardAgents()
-{
-    for (size_t i = 0; i < m_agents.size(); i++)
-        m_agents[i]->discardAgent();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorBaseAgent.h (159161 => 159162)


--- trunk/Source/WebCore/inspector/InspectorBaseAgent.h	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/InspectorBaseAgent.h	2013-11-13 00:53:59 UTC (rev 159162)
@@ -33,8 +33,6 @@
 
 #include "InspectorBackendDispatcher.h"
 #include <wtf/Forward.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -44,9 +42,14 @@
 
 class InspectorBaseAgentInterface {
 public:
-    InspectorBaseAgentInterface(const String&, InstrumentingAgents*);
-    virtual ~InspectorBaseAgentInterface();
+    InspectorBaseAgentInterface(const String& name, InstrumentingAgents* instrumentingAgents)
+        : m_instrumentingAgents(instrumentingAgents)
+        , m_name(name)
+    {
+    }
 
+    virtual ~InspectorBaseAgentInterface() { }
+
     virtual void setFrontend(InspectorFrontend*) { }
     virtual void clearFrontend() { }
     virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0;
@@ -61,19 +64,6 @@
     String m_name;
 };
 
-class InspectorAgentRegistry {
-public:
-    void append(PassOwnPtr<InspectorBaseAgentInterface>);
-
-    void setFrontend(InspectorFrontend*);
-    void clearFrontend();
-    void registerInDispatcher(InspectorBackendDispatcher*);
-    void discardAgents();
-
-private:
-    Vector<OwnPtr<InspectorBaseAgentInterface>> m_agents;
-};
-
 template<typename T>
 class InspectorBaseAgent : public InspectorBaseAgentInterface {
 public:

Modified: trunk/Source/WebCore/inspector/InspectorController.h (159161 => 159162)


--- trunk/Source/WebCore/inspector/InspectorController.h	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/InspectorController.h	2013-11-13 00:53:59 UTC (rev 159162)
@@ -33,6 +33,7 @@
 
 #if ENABLE(INSPECTOR)
 
+#include "InspectorAgentRegistry.h"
 #include "InspectorBaseAgent.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
@@ -48,7 +49,6 @@
 class InspectorAgent;
 class InspectorApplicationCacheAgent;
 class InspectorBackendDispatcher;
-class InspectorBaseAgentInterface;
 class InspectorClient;
 class InspectorDOMAgent;
 class InspectorDOMDebuggerAgent;

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.h (159161 => 159162)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.h	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.h	2013-11-13 00:53:59 UTC (rev 159162)
@@ -48,8 +48,6 @@
 class InspectorMemoryAgent : public InspectorBaseAgent<InspectorMemoryAgent>, public InspectorBackendDispatcher::MemoryCommandHandler {
     WTF_MAKE_NONCOPYABLE(InspectorMemoryAgent);
 public:
-    typedef Vector<OwnPtr<InspectorBaseAgentInterface>> InspectorAgents;
-
     static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents);
     virtual ~InspectorMemoryAgent();
 

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.h (159161 => 159162)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.h	2013-11-13 00:40:22 UTC (rev 159161)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.h	2013-11-13 00:53:59 UTC (rev 159162)
@@ -33,6 +33,7 @@
 
 #if ENABLE(INSPECTOR) && ENABLE(WORKERS)
 
+#include "InspectorAgentRegistry.h"
 #include "InspectorBaseAgent.h"
 #include <wtf/FastMalloc.h>
 #include <wtf/Forward.h>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to