Title: [113318] trunk/Source/WebCore
Revision
113318
Author
[email protected]
Date
2012-04-05 06:25:04 -0700 (Thu, 05 Apr 2012)

Log Message

Web Inspector: CodeGeneratorInspector.py: switch FileSystem, Profiler and Worker domains to typed API
https://bugs.webkit.org/show_bug.cgi?id=83069

Patch by Peter Rybin <[email protected]> on 2012-04-05
Reviewed by Yury Semikhatsky.

Domains are switched to 'strict' mode. However, hardly any changes were needed in C++ code because
only basic types are currently used in Inspector.json.

* inspector/CodeGeneratorInspector.py:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::getProfileHeaders):
(WebCore):
(WebCore::InspectorProfilerAgent::getObjectByHeapObjectId):
* inspector/InspectorProfilerAgent.h:
(InspectorProfilerAgent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113317 => 113318)


--- trunk/Source/WebCore/ChangeLog	2012-04-05 12:49:20 UTC (rev 113317)
+++ trunk/Source/WebCore/ChangeLog	2012-04-05 13:25:04 UTC (rev 113318)
@@ -1,3 +1,21 @@
+2012-04-05  Peter Rybin  <[email protected]>
+
+        Web Inspector: CodeGeneratorInspector.py: switch FileSystem, Profiler and Worker domains to typed API
+        https://bugs.webkit.org/show_bug.cgi?id=83069
+
+        Reviewed by Yury Semikhatsky.
+
+        Domains are switched to 'strict' mode. However, hardly any changes were needed in C++ code because
+        only basic types are currently used in Inspector.json.
+
+        * inspector/CodeGeneratorInspector.py:
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::getProfileHeaders):
+        (WebCore):
+        (WebCore::InspectorProfilerAgent::getObjectByHeapObjectId):
+        * inspector/InspectorProfilerAgent.h:
+        (InspectorProfilerAgent):
+
 2012-04-05  Levi Weintraub  <[email protected]>
 
         DOM measurement APIs should operate on pixel snapped values.

Modified: trunk/Source/WebCore/inspector/CodeGeneratorInspector.py (113317 => 113318)


--- trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2012-04-05 12:49:20 UTC (rev 113317)
+++ trunk/Source/WebCore/inspector/CodeGeneratorInspector.py	2012-04-05 13:25:04 UTC (rev 113318)
@@ -62,7 +62,8 @@
 STRICT_ENABLED_DOMAINS = ["Console", "DOMDebugger",
                           "CSS", "Debugger", "DOM", "Network", "Page", "Runtime",
                           "Inspector", "Memory", "Database",
-                          "IndexedDB", "DOMStorage", "ApplicationCache"]
+                          "IndexedDB", "DOMStorage", "ApplicationCache",
+                          "FileSystem", "Profiler", "Worker"]
 
 
 cmdline_parser = optparse.OptionParser()
@@ -2289,6 +2290,16 @@
     };
 };
 
+template<>
+struct ArrayItemHelper<InspectorObject> {
+    struct Traits {
+        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorObject> value)
+        {
+            array->pushObject(value);
+        }
+    };
+};
+
 template<typename T>
 struct ArrayItemHelper<TypeBuilder::Array<T> > {
     struct Traits {

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp (113317 => 113318)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2012-04-05 12:49:20 UTC (rev 113317)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2012-04-05 13:25:04 UTC (rev 113318)
@@ -240,14 +240,16 @@
     return makeString(UserInitiatedProfileName, '.', String::number(m_currentUserInitiatedProfileNumber));
 }
 
-void InspectorProfilerAgent::getProfileHeaders(ErrorString*, RefPtr<InspectorArray>& headers)
+void InspectorProfilerAgent::getProfileHeaders(ErrorString*, RefPtr<TypeBuilder::Array<InspectorObject> >& headers)
 {
+    headers = TypeBuilder::Array<InspectorObject>::create();
+
     ProfilesMap::iterator profilesEnd = m_profiles.end();
     for (ProfilesMap::iterator it = m_profiles.begin(); it != profilesEnd; ++it)
-        headers->pushObject(createProfileHeader(*it->second));
+        headers->addItem(createProfileHeader(*it->second));
     HeapSnapshotsMap::iterator snapshotsEnd = m_snapshots.end();
     for (HeapSnapshotsMap::iterator it = m_snapshots.begin(); it != snapshotsEnd; ++it)
-        headers->pushObject(createSnapshotHeader(*it->second));
+        headers->addItem(createSnapshotHeader(*it->second));
 }
 
 namespace {
@@ -426,7 +428,7 @@
         m_frontend->setRecordingProfile(isProfiling);
 }
 
-void InspectorProfilerAgent::getObjectByHeapObjectId(ErrorString* error, int id, const String* objectGroup, RefPtr<InspectorObject>& result)
+void InspectorProfilerAgent::getObjectByHeapObjectId(ErrorString* error, int id, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result)
 {
     ScriptObject heapObject = ScriptProfiler::objectByHeapObjectId(id);
     if (heapObject.hasNoValue()) {

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.h (113317 => 113318)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.h	2012-04-05 12:49:20 UTC (rev 113317)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.h	2012-04-05 13:25:04 UTC (rev 113318)
@@ -85,7 +85,7 @@
     void enable(bool skipRecompile);
     bool enabled() { return m_enabled; }
     String getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false);
-    virtual void getProfileHeaders(ErrorString*, RefPtr<InspectorArray>& headers);
+    virtual void getProfileHeaders(ErrorString*, RefPtr<TypeBuilder::Array<InspectorObject> >& headers);
     virtual void getProfile(ErrorString*, const String& type, int uid, RefPtr<InspectorObject>& profileObject);
     virtual void removeProfile(ErrorString*, const String& type, int uid);
 
@@ -96,7 +96,7 @@
     virtual void takeHeapSnapshot(ErrorString*);
     void toggleRecordButton(bool isProfiling);
 
-    virtual void getObjectByHeapObjectId(ErrorString*, int id, const String* objectGroup, RefPtr<InspectorObject>& result);
+    virtual void getObjectByHeapObjectId(ErrorString*, int id, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result);
 
 protected:
     InspectorProfilerAgent(InstrumentingAgents*, InspectorConsoleAgent*, InspectorState*, InjectedScriptManager*);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to