Changeset 102187 in webkit
- Timestamp:
- Dec 6, 2011, 3:49:19 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 12 edited
-
CMakeLists.txt (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
GNUmakefile.list.am (modified) (1 diff)
-
Target.pri (modified) (2 diffs)
-
WebCore.gypi (modified) (1 diff)
-
WebCore.vcproj/WebCore.vcproj (modified) (1 diff)
-
WebCore.xcodeproj/project.pbxproj (modified) (5 diffs)
-
bindings/js/ScriptProfiler.h (modified) (1 diff)
-
bindings/v8/ScriptProfiler.cpp (modified) (2 diffs)
-
bindings/v8/ScriptProfiler.h (modified) (1 diff)
-
inspector/Inspector.json (modified) (1 diff)
-
inspector/InspectorController.cpp (modified) (2 diffs)
-
inspector/InspectorMemoryAgent.cpp (added)
-
inspector/InspectorMemoryAgent.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r101932 r102187 887 887 inspector/InspectorFrontendHost.cpp 888 888 inspector/InspectorInstrumentation.cpp 889 inspector/InspectorMemoryAgent.cpp 889 890 inspector/InspectorProfilerAgent.cpp 890 891 inspector/InspectorResourceAgent.cpp -
trunk/Source/WebCore/ChangeLog
r102186 r102187 1 2011-12-06 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: introduce a memory agent stub. 4 https://bugs.webkit.org/show_bug.cgi?id=73930 5 6 Reviewed by Timothy Hatcher. 7 8 We'd like to experiment with the memory stats and hence need a 9 nice home for that. Adding this undocumented agent / domain for now. 10 11 * CMakeLists.txt: 12 * GNUmakefile.list.am: 13 * Target.pri: 14 * WebCore.gypi: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * bindings/js/ScriptProfiler.h: 18 (WebCore::ScriptProfiler::nodeCount): 19 * bindings/v8/ScriptProfiler.cpp: 20 (WebCore::ScriptProfiler::nodeCount): 21 * bindings/v8/ScriptProfiler.h: 22 * inspector/Inspector.json: 23 * inspector/InspectorController.cpp: 24 (WebCore::InspectorController::InspectorController): 25 * inspector/InspectorMemoryAgent.cpp: Added. 26 (WebCore::InspectorMemoryAgent::~InspectorMemoryAgent): 27 (WebCore::InspectorMemoryAgent::getNodeCounter): 28 (WebCore::InspectorMemoryAgent::InspectorMemoryAgent): 29 * inspector/InspectorMemoryAgent.h: Added. 30 (WebCore::InspectorMemoryAgent::create): 31 1 32 2011-12-06 Julien Chaffraix <jchaffraix@webkit.org> 2 33 -
trunk/Source/WebCore/GNUmakefile.list.am
r101932 r102187 2068 2068 Source/WebCore/inspector/InspectorInstrumentation.cpp \ 2069 2069 Source/WebCore/inspector/InspectorInstrumentation.h \ 2070 Source/WebCore/inspector/InspectorMemoryAgent.cpp \ 2071 Source/WebCore/inspector/InspectorMemoryAgent.h \ 2070 2072 Source/WebCore/inspector/InspectorPageAgent.cpp \ 2071 2073 Source/WebCore/inspector/InspectorPageAgent.h \ -
trunk/Source/WebCore/Target.pri
r102067 r102187 867 867 inspector/InspectorFrontendHost.cpp \ 868 868 inspector/InspectorInstrumentation.cpp \ 869 inspector/InspectorMemoryAgent.cpp \ 869 870 inspector/InspectorPageAgent.cpp \ 870 871 inspector/InspectorProfilerAgent.cpp \ … … 1911 1912 inspector/InspectorFrontendHost.h \ 1912 1913 inspector/InspectorInstrumentation.h \ 1914 inspector/InspectorMemoryAgent.h \ 1913 1915 inspector/InspectorPageAgent.h \ 1914 1916 inspector/InspectorProfilerAgent.h \ -
trunk/Source/WebCore/WebCore.gypi
r102181 r102187 2756 2756 'inspector/InspectorInstrumentation.cpp', 2757 2757 'inspector/InspectorInstrumentation.h', 2758 'inspector/InspectorMemoryAgent.cpp', 2759 'inspector/InspectorMemoryAgent.h', 2758 2760 'inspector/InspectorPageAgent.cpp', 2759 2761 'inspector/InspectorPageAgent.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r101932 r102187 68535 68535 </File> 68536 68536 <File 68537 RelativePath="..\inspector\InspectorMemoryAgent.cpp" 68538 > 68539 </File> 68540 <File 68541 RelativePath="..\inspector\InspectorMemoryAgent.h" 68542 > 68543 </File> 68544 <File 68537 68545 RelativePath="..\inspector\InspectorPageAgent.cpp" 68538 68546 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r102097 r102187 1820 1820 7AA51B6E1483B61600AD2752 /* InspectorBaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51B6C1483B61600AD2752 /* InspectorBaseAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1821 1821 7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */; }; 1822 7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */; }; 1823 7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */; }; 1822 1824 7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */; }; 1823 1825 7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */; }; … … 9067 9069 7AA51B6C1483B61600AD2752 /* InspectorBaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBaseAgent.h; sourceTree = "<group>"; }; 9068 9070 7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBaseAgent.cpp; sourceTree = "<group>"; }; 9071 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorMemoryAgent.cpp; sourceTree = "<group>"; }; 9072 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorMemoryAgent.h; sourceTree = "<group>"; }; 9069 9073 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; }; 9070 9074 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = "<group>"; }; … … 14549 14553 20D629241253690B00081543 /* InspectorInstrumentation.cpp */, 14550 14554 20D629251253690B00081543 /* InspectorInstrumentation.h */, 14555 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */, 14556 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */, 14551 14557 4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */, 14552 14558 4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */, … … 24743 24749 312C0C41146DC6CC0016C911 /* Notification.h in Headers */, 24744 24750 3128CA6B147331630074C72A /* NotificationController.h in Headers */, 24751 7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */, 24745 24752 5038BF2814750F190095E0D1 /* CustomFilterOperation.h in Headers */, 24746 24753 5038BF2914750F190095E0D1 /* FilterOperation.h in Headers */, … … 27620 27627 A10DC76A14747BAB005E2471 /* StyleGridData.cpp in Sources */, 27621 27628 3128CA68147331520074C72A /* NotificationController.cpp in Sources */, 27629 7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */, 27622 27630 5038BF2A14750F190095E0D1 /* FilterOperations.cpp in Sources */, 27623 27631 6E3FAD3814733F4000E42306 /* JSWebGLCompressedTextures.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/ScriptProfiler.h
r101651 r102187 59 59 static bool isSampling() { return false; } 60 60 static bool hasHeapProfiler() { return false; } 61 // FIXME: Implement this counter for JSC. See bug 73936 for more details. 62 static unsigned domNodeCount() { return 0; } 61 63 }; 62 64 -
trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp
r97611 r102187 36 36 #include "RetainedDOMInfo.h" 37 37 #include "V8Binding.h" 38 #include "V8DOMMap.h" 38 39 #include "V8Node.h" 39 40 … … 146 147 } 147 148 149 namespace { 150 151 class CounterVisitor : public DOMWrapperMap<Node>::Visitor { 152 public: 153 CounterVisitor() : m_count(0) { } 154 155 void visitDOMWrapper(DOMDataStore* store, Node* node, v8::Persistent<v8::Object> wrapper) 156 { 157 Node* rootNode = node; 158 while (rootNode->parentNode()) 159 rootNode = rootNode->parentNode(); 160 161 if (m_roots.contains(rootNode)) 162 return; 163 m_roots.add(rootNode); 164 165 Node* currentNode = rootNode; 166 while ((currentNode = currentNode->traverseNextNode(rootNode))) 167 ++m_count; 168 } 169 170 unsigned nodeCount() 171 { 172 return m_count; 173 } 174 private: 175 HashSet<Node*> m_roots; 176 unsigned m_count; 177 }; 178 179 } // namespace 180 181 unsigned ScriptProfiler::domNodeCount() 182 { 183 CounterVisitor counterVisitor; 184 visitDOMNodes(&counterVisitor); 185 return counterVisitor.nodeCount(); 186 } 187 148 188 149 189 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/ScriptProfiler.h
r101651 r102187 64 64 static bool hasHeapProfiler() { return true; } 65 65 static void initialize(); 66 static unsigned domNodeCount(); 66 67 }; 67 68 -
trunk/Source/WebCore/inspector/Inspector.json
r102140 r102187 42 42 "parameters": [ 43 43 { "name": "id", "type": "integer" } 44 ] 45 } 46 ] 47 }, 48 { 49 "domain": "Memory", 50 "hidden": true, 51 "commands": [ 52 { 53 "name": "getDOMNodeCount", 54 "returns": [ 55 { "name": "count", "type": "integer" } 44 56 ] 45 57 } -
trunk/Source/WebCore/inspector/InspectorController.cpp
r101754 r102187 54 54 #include "InspectorFrontendClient.h" 55 55 #include "InspectorInstrumentation.h" 56 #include "InspectorMemoryAgent.h" 56 57 #include "InspectorPageAgent.h" 57 58 #include "InspectorProfilerAgent.h" … … 136 137 #endif 137 138 139 m_agents.append(InspectorMemoryAgent::create(m_instrumentingAgents.get(), m_state.get(), m_page)); 140 138 141 ASSERT_ARG(inspectorClient, inspectorClient); 139 142 m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent
Note:
See TracChangeset
for help on using the changeset viewer.