Web Inspector: CodeGenerator should not use pointers for out params of RefPtr type.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Dec 2011 05:51:31 +0000 (05:51 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Dec 2011 05:51:31 +0000 (05:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69366

Patch by Peter Rybin <peter.rybin@gmail.com> on 2011-12-20
Reviewed by Pavel Feldman.

Generator fixed and all usages are changed manually.

* inspector/CodeGeneratorInspector.py:
(RawTypes.BaseType):
(RawTypes.BaseType.get_output_argument_prefix):
(RawTypes.Object.get_output_argument_prefix):
(RawTypes.Array.get_output_argument_prefix):
(RawTypes):
(Generator.process_command):
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
(WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame):
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::clearFrontend):
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::getInlineStylesForNode):
(WebCore::InspectorCSSAgent::getComputedStyleForNode):
(WebCore::InspectorCSSAgent::getAllStyleSheets):
(WebCore::InspectorCSSAgent::getStyleSheet):
(WebCore::InspectorCSSAgent::setPropertyText):
(WebCore::InspectorCSSAgent::toggleProperty):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
(WebCore::InspectorCSSAgent::stopSelectorProfiler):
(WebCore::InspectorCSSAgent::stopSelectorProfilerImpl):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getDocument):
(WebCore::InspectorDOMAgent::querySelectorAll):
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::getSearchResults):
(WebCore::InspectorDOMAgent::resolveNode):
(WebCore::InspectorDOMAgent::getAttributes):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::getDOMStorageEntries):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
(WebCore::InspectorDebuggerAgent::setBreakpoint):
(WebCore::InspectorDebuggerAgent::searchInContent):
(WebCore::InspectorDebuggerAgent::setScriptSource):
(WebCore::InspectorDebuggerAgent::getFunctionLocation):
(WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getDOMNodeCount):
* inspector/InspectorMemoryAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::getResourceTree):
(WebCore::InspectorPageAgent::searchInResource):
(WebCore::InspectorPageAgent::searchInResources):
* inspector/InspectorPageAgent.h:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::getProfileHeaders):
(WebCore::InspectorProfilerAgent::getProfile):
(WebCore::InspectorProfilerAgent::getObjectByHeapObjectId):
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::evaluate):
(WebCore::InspectorRuntimeAgent::callFunctionOn):
(WebCore::InspectorRuntimeAgent::getProperties):
* inspector/InspectorRuntimeAgent.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103389 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/CodeGeneratorInspector.py
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorCSSAgent.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
Source/WebCore/inspector/InspectorDOMStorageAgent.h
Source/WebCore/inspector/InspectorDatabaseAgent.cpp
Source/WebCore/inspector/InspectorDatabaseAgent.h
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/InspectorMemoryAgent.cpp
Source/WebCore/inspector/InspectorMemoryAgent.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.h
Source/WebCore/inspector/InspectorRuntimeAgent.cpp
Source/WebCore/inspector/InspectorRuntimeAgent.h

index 3700665570808cb816cd7ea99683887ec876b859..8e45f1254bbd482b67f95a6254933865307863aa 100644 (file)
@@ -1,3 +1,80 @@
+2011-12-20  Peter Rybin  <peter.rybin@gmail.com>
+
+        Web Inspector: CodeGenerator should not use pointers for out params of RefPtr type.
+        https://bugs.webkit.org/show_bug.cgi?id=69366
+
+        Reviewed by Pavel Feldman.
+
+        Generator fixed and all usages are changed manually.
+
+        * inspector/CodeGeneratorInspector.py:
+        (RawTypes.BaseType):
+        (RawTypes.BaseType.get_output_argument_prefix):
+        (RawTypes.Object.get_output_argument_prefix):
+        (RawTypes.Array.get_output_argument_prefix):
+        (RawTypes):
+        (Generator.process_command):
+        * inspector/InspectorApplicationCacheAgent.cpp:
+        (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
+        (WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame):
+        * inspector/InspectorApplicationCacheAgent.h:
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::clearFrontend):
+        (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
+        (WebCore::InspectorCSSAgent::getInlineStylesForNode):
+        (WebCore::InspectorCSSAgent::getComputedStyleForNode):
+        (WebCore::InspectorCSSAgent::getAllStyleSheets):
+        (WebCore::InspectorCSSAgent::getStyleSheet):
+        (WebCore::InspectorCSSAgent::setPropertyText):
+        (WebCore::InspectorCSSAgent::toggleProperty):
+        (WebCore::InspectorCSSAgent::setRuleSelector):
+        (WebCore::InspectorCSSAgent::addRule):
+        (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
+        (WebCore::InspectorCSSAgent::stopSelectorProfiler):
+        (WebCore::InspectorCSSAgent::stopSelectorProfilerImpl):
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getDocument):
+        (WebCore::InspectorDOMAgent::querySelectorAll):
+        (WebCore::InspectorDOMAgent::getEventListenersForNode):
+        (WebCore::InspectorDOMAgent::getSearchResults):
+        (WebCore::InspectorDOMAgent::resolveNode):
+        (WebCore::InspectorDOMAgent::getAttributes):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorDOMStorageAgent.cpp:
+        (WebCore::InspectorDOMStorageAgent::getDOMStorageEntries):
+        * inspector/InspectorDOMStorageAgent.h:
+        * inspector/InspectorDatabaseAgent.cpp:
+        (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
+        * inspector/InspectorDatabaseAgent.h:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
+        (WebCore::InspectorDebuggerAgent::setBreakpoint):
+        (WebCore::InspectorDebuggerAgent::searchInContent):
+        (WebCore::InspectorDebuggerAgent::setScriptSource):
+        (WebCore::InspectorDebuggerAgent::getFunctionLocation):
+        (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore::InspectorMemoryAgent::getDOMNodeCount):
+        * inspector/InspectorMemoryAgent.h:
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::getCookies):
+        (WebCore::InspectorPageAgent::getResourceTree):
+        (WebCore::InspectorPageAgent::searchInResource):
+        (WebCore::InspectorPageAgent::searchInResources):
+        * inspector/InspectorPageAgent.h:
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::getProfileHeaders):
+        (WebCore::InspectorProfilerAgent::getProfile):
+        (WebCore::InspectorProfilerAgent::getObjectByHeapObjectId):
+        * inspector/InspectorProfilerAgent.h:
+        * inspector/InspectorRuntimeAgent.cpp:
+        (WebCore::InspectorRuntimeAgent::evaluate):
+        (WebCore::InspectorRuntimeAgent::callFunctionOn):
+        (WebCore::InspectorRuntimeAgent::getProperties):
+        * inspector/InspectorRuntimeAgent.h:
+
 2011-12-20  Eric Penner  <epenner@google.com>
 
         [chromium] m_triggerIdlePaints not reset after a compositeAndReadback
index dcdb32d55649fa905113d9992412490de5af8a92..bbd5b9e076f9dd986bdb379dda062de403d2f1ec 100755 (executable)
@@ -251,6 +251,10 @@ class RawTypes(object):
         def is_event_param_check_optional():
             return False
 
+        @staticmethod
+        def get_output_argument_prefix():
+            return "&"
+
     class String(BaseType):
         @classmethod
         def get_c_param_type(cls, param_type, optional):
@@ -372,6 +376,10 @@ class RawTypes(object):
         def is_event_param_check_optional():
             return True
 
+        @staticmethod
+        def get_output_argument_prefix():
+            return ""
+
         _plain_c_type = CParamType("RefPtr<InspectorObject>")
         _ref_c_type = CParamType("PassRefPtr<InspectorObject>")
 
@@ -432,6 +440,10 @@ class RawTypes(object):
         def is_event_param_check_optional():
             return True
 
+        @staticmethod
+        def get_output_argument_prefix():
+            return ""
+
         _plain_c_type = CParamType("RefPtr<InspectorArray>")
         _ref_c_type = CParamType("PassRefPtr<InspectorArray>")
 
@@ -1595,16 +1607,23 @@ class Generator:
             for json_return in json_command["returns"]:
 
                 json_return_name = json_return["name"]
+
+                optional = "optional" in json_return and json_return["optional"]
+
                 raw_type = resolve_param_raw_type(json_return, domain_name)
                 setter_type = raw_type.get_setter_name()
                 initializer = raw_type.get_c_initializer()
                 var_type = raw_type.get_c_param_type(ParamType.OUTPUT, None)
 
                 code = "    %s out_%s = %s;\n" % (var_type.get_text(), json_return_name, initializer)
-                param = ", &out_%s" % json_return_name
+                param = ", %sout_%s" % (raw_type.get_output_argument_prefix(), json_return_name)
                 cook = "        result->set%s(\"%s\", out_%s);\n" % (setter_type, json_return_name, json_return_name)
-                if var_type.get_text() == "bool" and "optional" in json_return and json_return["optional"]:
-                    cook = ("        if (out_%s)\n    " % json_return_name) + cook
+                if optional:
+                    if var_type.get_text() == "bool":
+                        cook = ("        if (out_%s)\n    " % json_return_name) + cook
+                    else:
+                        # FIXME: support optionals.
+                        cook = "        // FIXME: support optional here.\n" + cook
 
                 method_out_code += code
                 agent_call_param_list.append(param)
index b17e5451db972d408d72a00d34251f2057bb4500..14bea7637d9a869a603ff39946a4956457df6c3e 100644 (file)
@@ -103,9 +103,9 @@ void InspectorApplicationCacheAgent::networkStateChanged()
     m_frontend->networkStateUpdated(isNowOnline);
 }
 
-void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr<InspectorArray>* result)
+void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr<InspectorArray>& result)
 {
-    *result = InspectorArray::create();
+    result = InspectorArray::create();
 
     Frame* mainFrame = m_pageAgent->mainFrame();
     for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext(mainFrame)) {
@@ -121,7 +121,7 @@ void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr
             value->setString("frameId", m_pageAgent->frameId(frame));
             value->setString("manifestURL", manifestURL);
             value->setNumber("status", host->status());
-            (*result)->pushObject(value);
+            result->pushObject(value);
         }
     }
 }
@@ -145,7 +145,7 @@ void InspectorApplicationCacheAgent::getManifestForFrame(ErrorString* errorStrin
     *manifestURL = info.m_manifest.string();
 }
 
-void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* errorString, const String& frameId, RefPtr<InspectorObject>* applicationCache)
+void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* errorString, const String& frameId, RefPtr<InspectorObject>& applicationCache)
 {
     DocumentLoader* documentLoader = assertFrameWithDocumentLoader(errorString, frameId);
     if (!documentLoader)
@@ -157,7 +157,7 @@ void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* er
     ApplicationCacheHost::ResourceInfoList resources;
     host->fillResourceList(&resources);
 
-    *applicationCache = buildObjectForApplicationCache(resources, info);
+    applicationCache = buildObjectForApplicationCache(resources, info);
 }
 
 PassRefPtr<InspectorObject> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
index c316744c674f261d71dca367e4f7fc5cec7922d0..ac09297599328f547ee571348c4cdd05b6d2746d 100644 (file)
@@ -69,9 +69,9 @@ public:
 
     // ApplicationCache API for InspectorFrontend
     void enable(ErrorString*);
-    void getFramesWithManifests(ErrorString*, RefPtr<InspectorArray>* result);
+    void getFramesWithManifests(ErrorString*, RefPtr<InspectorArray>& result);
     void getManifestForFrame(ErrorString*, const String& frameId, String* manifestURL);
-    void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr<InspectorObject>* applicationCache);
+    void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr<InspectorObject>& applicationCache);
 
 private:
     InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorState*, InspectorPageAgent*);
index 55a4bc4624d71eb59efba89dcdf4c0b76ef62a00..104d867995e70be0a325fa5e17a991ae47bc926c 100644 (file)
@@ -315,7 +315,7 @@ void InspectorCSSAgent::clearFrontend()
     m_frontend = 0;
     clearPseudoState(true);
     String errorString;
-    stopSelectorProfiler(&errorString);
+    stopSelectorProfilerImpl(&errorString);
 }
 
 void InspectorCSSAgent::discardAgent()
@@ -390,7 +390,7 @@ void InspectorCSSAgent::recalcStyleForPseudoStateIfNeeded(Element* element, Insp
         element->ownerDocument()->styleSelectorChanged(RecalcStyleImmediately);
 }
 
-void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, bool* needPseudo, bool* needInherited, RefPtr<InspectorArray>* matchedCSSRules, RefPtr<InspectorArray>* pseudoIdRules, RefPtr<InspectorArray>* inheritedEntries)
+void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, bool* needPseudo, bool* needInherited, RefPtr<InspectorArray>& matchedCSSRules, RefPtr<InspectorArray>& pseudoIdRules, RefPtr<InspectorArray>& inheritedEntries)
 {
     Element* element = elementForId(errorString, nodeId);
     if (!element)
@@ -401,7 +401,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no
     // Matched rules.
     CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
     RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, CSSStyleSelector::AllCSSRules);
-    *matchedCSSRules = buildArrayForRuleList(matchedRules.get());
+    matchedCSSRules = buildArrayForRuleList(matchedRules.get());
 
     // Pseudo elements.
     if (!needPseudo || *needPseudo) {
@@ -416,7 +416,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no
             }
         }
 
-        *pseudoIdRules = pseudoElements.release();
+        pseudoIdRules = pseudoElements.release();
     }
 
     // Inherited styles.
@@ -438,11 +438,11 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no
             parentElement = parentElement->parentElement();
         }
 
-        *inheritedEntries = inheritedStyles.release();
+        inheritedEntries = inheritedStyles.release();
     }
 }
 
-void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nodeId, RefPtr<InspectorObject>* inlineStyle, RefPtr<InspectorArray>* attributes)
+void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nodeId, RefPtr<InspectorObject>& inlineStyle, RefPtr<InspectorArray>& attributes)
 {
     Element* element = elementForId(errorString, nodeId);
     if (!element)
@@ -452,11 +452,11 @@ void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nod
     if (!styleSheet)
         return;
 
-    *inlineStyle = styleSheet->buildObjectForStyle(element->style());
-    *attributes = buildArrayForAttributeStyles(element);
+    inlineStyle = styleSheet->buildObjectForStyle(element->style());
+    attributes = buildArrayForAttributeStyles(element);
 }
 
-void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<InspectorArray>* style)
+void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<InspectorArray>& style)
 {
     Element* element = elementForId(errorString, nodeId);
     if (!element)
@@ -466,10 +466,10 @@ void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
 
     RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = computedStyle(element, true);
     RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyleInfo, 0);
-    *style = inspectorStyle->buildArrayForComputedStyle();
+    style = inspectorStyle->buildArrayForComputedStyle();
 }
 
-void InspectorCSSAgent::getAllStyleSheets(ErrorString*, RefPtr<InspectorArray>* styleInfos)
+void InspectorCSSAgent::getAllStyleSheets(ErrorString*, RefPtr<InspectorArray>& styleInfos)
 {
     Vector<Document*> documents = m_domAgent->documents();
     for (Vector<Document*>::iterator it = documents.begin(); it != documents.end(); ++it) {
@@ -477,18 +477,18 @@ void InspectorCSSAgent::getAllStyleSheets(ErrorString*, RefPtr<InspectorArray>*
         for (unsigned i = 0; i < list->length(); ++i) {
             StyleSheet* styleSheet = list->item(i);
             if (styleSheet->isCSSStyleSheet())
-                collectStyleSheets(static_cast<CSSStyleSheet*>(styleSheet), styleInfos->get());
+                collectStyleSheets(static_cast<CSSStyleSheet*>(styleSheet), styleInfos.get());
         }
     }
 }
 
-void InspectorCSSAgent::getStyleSheet(ErrorString* errorString, const String& styleSheetId, RefPtr<InspectorObject>* styleSheetObject)
+void InspectorCSSAgent::getStyleSheet(ErrorString* errorString, const String& styleSheetId, RefPtr<InspectorObject>& styleSheetObject)
 {
     InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
     if (!inspectorStyleSheet)
         return;
 
-    *styleSheetObject = inspectorStyleSheet->buildObjectForStyleSheet();
+    styleSheetObject = inspectorStyleSheet->buildObjectForStyleSheet();
 }
 
 void InspectorCSSAgent::getStyleSheetText(ErrorString* errorString, const String& styleSheetId, String* result)
@@ -512,7 +512,7 @@ void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String
         *errorString = "Internal error setting style sheet text";
 }
 
-void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<InspectorObject>* result)
+void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<InspectorObject>& result)
 {
     InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
@@ -523,10 +523,10 @@ void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<I
 
     bool success = inspectorStyleSheet->setPropertyText(errorString, compoundId, propertyIndex, text, overwrite);
     if (success)
-        *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
+        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
 }
 
-void InspectorCSSAgent::toggleProperty(ErrorString* errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, bool disable, RefPtr<InspectorObject>* result)
+void InspectorCSSAgent::toggleProperty(ErrorString* errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, bool disable, RefPtr<InspectorObject>& result)
 {
     InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
@@ -537,10 +537,10 @@ void InspectorCSSAgent::toggleProperty(ErrorString* errorString, const RefPtr<In
 
     bool success = inspectorStyleSheet->toggleProperty(errorString, compoundId, propertyIndex, disable);
     if (success)
-        *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
+        result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
 }
 
-void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<InspectorObject>& fullRuleId, const String& selector, RefPtr<InspectorObject>* result)
+void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<InspectorObject>& fullRuleId, const String& selector, RefPtr<InspectorObject>& result)
 {
     InspectorCSSId compoundId(fullRuleId);
     ASSERT(!compoundId.isEmpty());
@@ -553,10 +553,10 @@ void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<I
     if (!success)
         return;
 
-    *result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
+    result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
 }
 
-void InspectorCSSAgent::addRule(ErrorString*, const int contextNodeId, const String& selector, RefPtr<InspectorObject>* result)
+void InspectorCSSAgent::addRule(ErrorString*, const int contextNodeId, const String& selector, RefPtr<InspectorObject>& result)
 {
     Node* node = m_domAgent->nodeForId(contextNodeId);
     if (!node)
@@ -569,16 +569,16 @@ void InspectorCSSAgent::addRule(ErrorString*, const int contextNodeId, const Str
     if (!newRule)
         return;
 
-    *result = inspectorStyleSheet->buildObjectForRule(newRule);
+    result = inspectorStyleSheet->buildObjectForRule(newRule);
 }
 
-void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<InspectorArray>* cssProperties)
+void InspectorCSSAgent::getSupportedCSSProperties(ErrorString*, RefPtr<InspectorArray>& cssProperties)
 {
     RefPtr<InspectorArray> properties = InspectorArray::create();
     for (int i = 0; i < numCSSProperties; ++i)
         properties->pushString(propertyNameStrings[i]);
 
-    *cssProperties = properties.release();
+    cssProperties = properties.release();
 }
 
 void InspectorCSSAgent::startSelectorProfiler(ErrorString*)
@@ -588,7 +588,12 @@ void InspectorCSSAgent::startSelectorProfiler(ErrorString*)
     m_state->setBoolean(CSSAgentState::isSelectorProfiling, true);
 }
 
-void InspectorCSSAgent::stopSelectorProfiler(ErrorString*, RefPtr<InspectorObject>* result)
+void InspectorCSSAgent::stopSelectorProfiler(ErrorString* errorString, RefPtr<InspectorObject>& result)
+{
+    stopSelectorProfilerImpl(errorString, &result);
+}
+
+void InspectorCSSAgent::stopSelectorProfilerImpl(ErrorString*, RefPtr<InspectorObject>* result)
 {
     if (!m_state->getBoolean(CSSAgentState::isSelectorProfiling))
         return;
index 0020014422ac26d9524fc86f43aaff07b9da1f98..863efc0d70cb5e16243436a0db2e029a55c5c230 100644 (file)
@@ -76,21 +76,22 @@ public:
     void reset();
     void mediaQueryResultChanged();
 
-    void getComputedStyleForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<InspectorArray>* style);
-    void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<InspectorObject>* inlineStyle, RefPtr<InspectorArray>* attributes);
-    void getMatchedStylesForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, bool* includePseudo, bool* includeInherited, RefPtr<InspectorArray>* matchedCSSRules, RefPtr<InspectorArray>* pseudoIdRules, RefPtr<InspectorArray>* inheritedEntries);
-    void getAllStyleSheets(ErrorString*, RefPtr<InspectorArray>* styleSheetInfos);
-    void getStyleSheet(ErrorString*, const String& styleSheetId, RefPtr<InspectorObject>* result);
+    void getComputedStyleForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, RefPtr<InspectorArray>& style);
+    void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<InspectorObject>& inlineStyle, RefPtr<InspectorArray>& attributes);
+    void getMatchedStylesForNode(ErrorString*, int nodeId, const RefPtr<InspectorArray>* forcedPseudoClasses, bool* includePseudo, bool* includeInherited, RefPtr<InspectorArray>& matchedCSSRules, RefPtr<InspectorArray>& pseudoIdRules, RefPtr<InspectorArray>& inheritedEntries);
+    void getAllStyleSheets(ErrorString*, RefPtr<InspectorArray>& styleSheetInfos);
+    void getStyleSheet(ErrorString*, const String& styleSheetId, RefPtr<InspectorObject>& result);
     void getStyleSheetText(ErrorString*, const String& styleSheetId, String* result);
     void setStyleSheetText(ErrorString*, const String& styleSheetId, const String& text);
-    void setPropertyText(ErrorString*, const RefPtr<InspectorObject>& styleId, int propertyIndex, const String& text, bool overwrite, RefPtr<InspectorObject>* result);
-    void toggleProperty(ErrorString*, const RefPtr<InspectorObject>& styleId, int propertyIndex, bool disable, RefPtr<InspectorObject>* result);
-    void setRuleSelector(ErrorString*, const RefPtr<InspectorObject>& ruleId, const String& selector, RefPtr<InspectorObject>* result);
-    void addRule(ErrorString*, const int contextNodeId, const String& selector, RefPtr<InspectorObject>* result);
-    void getSupportedCSSProperties(ErrorString*, RefPtr<InspectorArray>* result);
+    void setPropertyText(ErrorString*, const RefPtr<InspectorObject>& styleId, int propertyIndex, const String& text, bool overwrite, RefPtr<InspectorObject>& result);
+    void toggleProperty(ErrorString*, const RefPtr<InspectorObject>& styleId, int propertyIndex, bool disable, RefPtr<InspectorObject>& result);
+    void setRuleSelector(ErrorString*, const RefPtr<InspectorObject>& ruleId, const String& selector, RefPtr<InspectorObject>& result);
+    void addRule(ErrorString*, const int contextNodeId, const String& selector, RefPtr<InspectorObject>& result);
+    void getSupportedCSSProperties(ErrorString*, RefPtr<InspectorArray>& result);
 
     void startSelectorProfiler(ErrorString*);
-    void stopSelectorProfiler(ErrorString*, RefPtr<InspectorObject>* = 0);
+    void stopSelectorProfiler(ErrorString*, RefPtr<InspectorObject>&);
+    void stopSelectorProfilerImpl(ErrorString*, RefPtr<InspectorObject>* = 0);
     void willMatchRule(const CSSStyleRule*);
     void didMatchRule(bool);
     void willProcessRule(const CSSStyleRule*);
index 546c77d65300e804ae04e815cf8e0913c1d809da..22da990e0bb531dee1dd1c5b077b7920957931a1 100644 (file)
@@ -351,7 +351,7 @@ HTMLElement* InspectorDOMAgent::assertHTMLElement(ErrorString* errorString, int
     return toHTMLElement(element);
 }
 
-void InspectorDOMAgent::getDocument(ErrorString*, RefPtr<InspectorObject>* root)
+void InspectorDOMAgent::getDocument(ErrorString*, RefPtr<InspectorObject>& root)
 {
     m_state->setBoolean(DOMAgentState::documentRequested, true);
 
@@ -363,7 +363,7 @@ void InspectorDOMAgent::getDocument(ErrorString*, RefPtr<InspectorObject>* root)
     reset();
     m_document = doc;
 
-    *root = buildObjectForNode(m_document.get(), 2, &m_documentNodeToIdMap);
+    root = buildObjectForNode(m_document.get(), 2, &m_documentNodeToIdMap);
 }
 
 void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId)
@@ -421,7 +421,7 @@ void InspectorDOMAgent::querySelector(ErrorString* errorString, int nodeId, cons
         *elementId = pushNodePathToFrontend(element.get());
 }
 
-void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, const String& selectors, RefPtr<InspectorArray>* result)
+void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, const String& selectors, RefPtr<InspectorArray>& result)
 {
     Node* node = assertNode(errorString, nodeId);
     if (!node)
@@ -435,7 +435,7 @@ void InspectorDOMAgent::querySelectorAll(ErrorString* errorString, int nodeId, c
     }
 
     for (unsigned i = 0; i < nodes->length(); ++i)
-        (*result)->pushNumber(pushNodePathToFrontend(nodes->item(i)));
+        result->pushNumber(pushNodePathToFrontend(nodes->item(i)));
 }
 
 int InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush)
@@ -702,7 +702,7 @@ void InspectorDOMAgent::setNodeValue(ErrorString* errorString, int nodeId, const
         *errorString = "DOM Error while setting the node value";
 }
 
-void InspectorDOMAgent::getEventListenersForNode(ErrorString*, int nodeId, RefPtr<InspectorArray>* listenersArray)
+void InspectorDOMAgent::getEventListenersForNode(ErrorString*, int nodeId, RefPtr<InspectorArray>& listenersArray)
 {
     Node* node = nodeForId(nodeId);
     EventTargetData* d;
@@ -749,7 +749,7 @@ void InspectorDOMAgent::getEventListenersForNode(ErrorString*, int nodeId, RefPt
         for (size_t j = 0; j < vector.size(); ++j) {
             const RegisteredEventListener& listener = vector[j];
             if (listener.useCapture)
-                (*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
+                listenersArray->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
         }
     }
 
@@ -760,7 +760,7 @@ void InspectorDOMAgent::getEventListenersForNode(ErrorString*, int nodeId, RefPt
         for (size_t j = 0; j < vector.size(); ++j) {
             const RegisteredEventListener& listener = vector[j];
             if (!listener.useCapture)
-                (*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
+                listenersArray->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
         }
     }
 }
@@ -860,7 +860,7 @@ void InspectorDOMAgent::performSearch(ErrorString*, const String& whitespaceTrim
     *resultCount = resultsIt->second.size();
 }
 
-void InspectorDOMAgent::getSearchResults(ErrorString* errorString, const String& searchId, int fromIndex, int toIndex, RefPtr<InspectorArray>* nodeIds)
+void InspectorDOMAgent::getSearchResults(ErrorString* errorString, const String& searchId, int fromIndex, int toIndex, RefPtr<InspectorArray>& nodeIds)
 {
     SearchResults::iterator it = m_searchResults.find(searchId);
     if (it == m_searchResults.end()) {
@@ -875,7 +875,7 @@ void InspectorDOMAgent::getSearchResults(ErrorString* errorString, const String&
     }
 
     for (int i = fromIndex; i < toIndex; ++i)
-        (*nodeIds)->pushNumber(pushNodePathToFrontend((it->second)[i].get()));
+        nodeIds->pushNumber(pushNodePathToFrontend((it->second)[i].get()));
 }
 
 void InspectorDOMAgent::discardSearchResults(ErrorString*, const String& searchId)
@@ -1066,7 +1066,7 @@ void InspectorDOMAgent::moveTo(ErrorString* error, int nodeId, int targetElement
     *newNodeId = pushNodePathToFrontend(node);
 }
 
-void InspectorDOMAgent::resolveNode(ErrorString* error, int nodeId, const String* const objectGroup, RefPtr<InspectorObject>* result)
+void InspectorDOMAgent::resolveNode(ErrorString* error, int nodeId, const String* const objectGroup, RefPtr<InspectorObject>& result)
 {
     String objectGroupName = objectGroup ? *objectGroup : "";
     Node* node = nodeForId(nodeId);
@@ -1079,16 +1079,16 @@ void InspectorDOMAgent::resolveNode(ErrorString* error, int nodeId, const String
         *error = "Node with given id does not belong to the document";
         return;
     }
-    *result = object;
+    result = object;
 }
 
-void InspectorDOMAgent::getAttributes(ErrorString* errorString, int nodeId, RefPtr<InspectorArray>* result)
+void InspectorDOMAgent::getAttributes(ErrorString* errorString, int nodeId, RefPtr<InspectorArray>& result)
 {
     Element* element = assertElement(errorString, nodeId);
     if (!element)
         return;
 
-    *result = buildArrayForElementAttributes(element);
+    result = buildArrayForElementAttributes(element);
 }
 
 void InspectorDOMAgent::requestNode(ErrorString*, const String& objectId, int* nodeId)
index 50309d8c38e109fd560a3bfb4c5eff07f4efea87..4ade5bdb59ed18775f76ba9ad398c42583afa2e4 100644 (file)
@@ -115,8 +115,8 @@ public:
 
     // Methods called from the frontend for DOM nodes inspection.
     void querySelector(ErrorString*, int nodeId, const String& selectors, int* elementId);
-    void querySelectorAll(ErrorString*, int nodeId, const String& selectors, RefPtr<InspectorArray>* result);
-    void getDocument(ErrorString*, RefPtr<InspectorObject>* root);
+    void querySelectorAll(ErrorString*, int nodeId, const String& selectors, RefPtr<InspectorArray>& result);
+    void getDocument(ErrorString*, RefPtr<InspectorObject>& root);
     void requestChildNodes(ErrorString*, int nodeId);
     void setAttributeValue(ErrorString*, int elementId, const String& name, const String& value);
     void setAttributesAsText(ErrorString*, int elementId, const String& text, const String* const name);
@@ -126,12 +126,12 @@ public:
     void getOuterHTML(ErrorString*, int nodeId, WTF::String* outerHTML);
     void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML, int* newId);
     void setNodeValue(ErrorString*, int nodeId, const String& value);
-    void getEventListenersForNode(ErrorString*, int nodeId, RefPtr<InspectorArray>* listenersArray);
+    void getEventListenersForNode(ErrorString*, int nodeId, RefPtr<InspectorArray>& listenersArray);
     void performSearch(ErrorString*, const String& whitespaceTrimmedQuery, String* searchId, int* resultCount);
-    void getSearchResults(ErrorString*, const String& searchId, int fromIndex, int toIndex, RefPtr<InspectorArray>*);
+    void getSearchResults(ErrorString*, const String& searchId, int fromIndex, int toIndex, RefPtr<InspectorArray>&);
     void discardSearchResults(ErrorString*, const String& searchId);
-    void resolveNode(ErrorString*, int nodeId, const String* const objectGroup, RefPtr<InspectorObject>* result);
-    void getAttributes(ErrorString*, int nodeId, RefPtr<InspectorArray>* result);
+    void resolveNode(ErrorString*, int nodeId, const String* const objectGroup, RefPtr<InspectorObject>& result);
+    void getAttributes(ErrorString*, int nodeId, RefPtr<InspectorArray>& result);
     void setInspectModeEnabled(ErrorString*, bool enabled, const RefPtr<InspectorObject>* highlightConfig);
     void requestNode(ErrorString*, const String& objectId, int* nodeId);
     void pushNodeByPathToFrontend(ErrorString*, const String& path, int* nodeId);
index b811fba86d21864dfd0f0a76630b40400cc71343..63daf3922528797255cad0aadf2bca71a65261c5 100644 (file)
@@ -108,7 +108,7 @@ void InspectorDOMStorageAgent::disable(ErrorString*)
     m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, m_enabled);
 }
 
-void InspectorDOMStorageAgent::getDOMStorageEntries(ErrorString*, int storageId, RefPtr<InspectorArray>* entries)
+void InspectorDOMStorageAgent::getDOMStorageEntries(ErrorString*, int storageId, RefPtr<InspectorArray>& entries)
 {
     InspectorDOMStorageResource* storageResource = getDOMStorageResourceForId(storageId);
     if (storageResource) {
@@ -120,7 +120,7 @@ void InspectorDOMStorageAgent::getDOMStorageEntries(ErrorString*, int storageId,
             RefPtr<InspectorArray> entry = InspectorArray::create();
             entry->pushString(name);
             entry->pushString(value);
-            (*entries)->pushArray(entry);
+            entries->pushArray(entry);
         }
     }
 }
index e87ffe2337882ea4f98f07f4a703d1ebccd0876e..bd1d6a719ce8b214c052b909c38f087d63dc9678 100644 (file)
@@ -64,7 +64,7 @@ public:
     // Called from the front-end.
     void enable(ErrorString*);
     void disable(ErrorString*);
-    void getDOMStorageEntries(ErrorString*, int storageId, RefPtr<InspectorArray>* entries);
+    void getDOMStorageEntries(ErrorString*, int storageId, RefPtr<InspectorArray>& entries);
     void setDOMStorageItem(ErrorString*, int storageId, const String& key, const String& value, bool* success);
     void removeDOMStorageItem(ErrorString*, int storageId, const String& key, bool* success);
 
index 4c86e9ba0326d1ab002b5ee77d16f2597f95fd08..d96b1e766244c564af8225372d0860f807cfc052 100644 (file)
@@ -291,7 +291,7 @@ void InspectorDatabaseAgent::restore()
     m_enabled =  m_state->getBoolean(DatabaseAgentState::databaseAgentEnabled);
 }
 
-void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, int databaseId, RefPtr<InspectorArray>* names)
+void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, int databaseId, RefPtr<InspectorArray>& names)
 {
     if (!m_enabled) {
         *error = "Database agent is not enabled";
@@ -303,7 +303,7 @@ void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, int datab
         Vector<String> tableNames = database->tableNames();
         unsigned length = tableNames.size();
         for (unsigned i = 0; i < length; ++i)
-            (*names)->pushString(tableNames[i]);
+            names->pushString(tableNames[i]);
     }
 }
 
index 5e08fa89ba726f3d6625e8c6fe812f3e73c1fdf9..c9c2c53c44d5d35431085007b89c29b1b1026806 100644 (file)
@@ -64,7 +64,7 @@ public:
     // Called from the front-end.
     void enable(ErrorString*);
     void disable(ErrorString*);
-    void getDatabaseTableNames(ErrorString*, int databaseId, RefPtr<InspectorArray>* names);
+    void getDatabaseTableNames(ErrorString*, int databaseId, RefPtr<InspectorArray>& names);
     void executeSQL(ErrorString*, int databaseId, const String& query, bool* success, int* transactionId);
 
     // Called from the injected script.
index e9049caa8827058db847fdd208da93d0af0e0986..1b04aa58ba9de1deabec7389e12e22eb71d03c65 100644 (file)
@@ -198,7 +198,7 @@ static bool matches(const String& url, const String& pattern, bool isRegex)
     return url == pattern;
 }
 
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, String* outBreakpointId, RefPtr<InspectorArray>* locations)
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, String* outBreakpointId, RefPtr<InspectorArray>& locations)
 {
     if (!optionalURL == !optionalURLRegex) {
         *errorString = "Either url or urlRegex must be specified.";
@@ -226,7 +226,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int li
             continue;
         RefPtr<InspectorObject> location = resolveBreakpoint(breakpointId, it->first, breakpoint);
         if (location)
-            (*locations)->pushObject(location);
+            locations->pushObject(location);
     }
     *outBreakpointId = breakpointId;
 }
@@ -243,7 +243,7 @@ static bool parseLocation(ErrorString* errorString, RefPtr<InspectorObject> loca
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, PassRefPtr<InspectorObject> location, const String* const optionalCondition, String* outBreakpointId, RefPtr<InspectorObject>* actualLocation)
+void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, PassRefPtr<InspectorObject> location, const String* const optionalCondition, String* outBreakpointId, RefPtr<InspectorObject>& actualLocation)
 {
     String scriptId;
     int lineNumber;
@@ -258,8 +258,8 @@ void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, PassRefPtr<
     if (m_breakpointIdToDebugServerBreakpointIds.find(breakpointId) != m_breakpointIdToDebugServerBreakpointIds.end())
         return;
     ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition);
-    *actualLocation = resolveBreakpoint(breakpointId, scriptId, breakpoint);
-    if (*actualLocation)
+    actualLocation = resolveBreakpoint(breakpointId, scriptId, breakpoint);
+    if (actualLocation)
         *outBreakpointId = breakpointId;
     else
         *errorString = "Could not resolve breakpoint";
@@ -335,28 +335,28 @@ static PassRefPtr<InspectorObject> scriptToInspectorObject(ScriptObject scriptOb
     return value->asObject();
 }
 
-void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptId, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>* results)
+void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptId, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>& results)
 {
     bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
     bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
 
     ScriptsMap::iterator it = m_scripts.find(scriptId);
     if (it != m_scripts.end())
-        *results = ContentSearchUtils::searchInTextByLines(it->second.source, query, caseSensitive, isRegex);
+        results = ContentSearchUtils::searchInTextByLines(it->second.source, query, caseSensitive, isRegex);
     else
         *error = "No script for id: " + scriptId;
 }
 
-void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result)
+void InspectorDebuggerAgent::setScriptSource(ErrorString* error, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>& newCallFrames, RefPtr<InspectorObject>& result)
 {
     bool previewOnly = preview && *preview;
     ScriptObject resultObject;
     if (!scriptDebugServer().setScriptSource(scriptId, newContent, previewOnly, error, &m_currentCallStack, &resultObject))
         return;
-    *newCallFrames = currentCallFrames();
+    newCallFrames = currentCallFrames();
     RefPtr<InspectorObject> object = scriptToInspectorObject(resultObject);
     if (object)
-        *result = object;
+        result = object;
 }
 
 void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& scriptId, String* scriptSource)
@@ -368,14 +368,14 @@ void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& s
         *error = "No script for id: " + scriptId;
 }
 
-void InspectorDebuggerAgent::getFunctionLocation(ErrorString* errorString, const String& functionId, RefPtr<InspectorObject>* location)
+void InspectorDebuggerAgent::getFunctionLocation(ErrorString* errorString, const String& functionId, RefPtr<InspectorObject>& location)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(functionId);
     if (injectedScript.hasNoValue()) {
         *errorString = "Inspected frame has gone";
         return;
     }
-    injectedScript.getFunctionLocation(errorString, functionId, location);
+    injectedScript.getFunctionLocation(errorString, functionId, &location);
 }
 
 void InspectorDebuggerAgent::schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<InspectorObject> data)
@@ -451,14 +451,14 @@ void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, cons
         *errorString = "Internal error. Could not change pause on exceptions state";
 }
 
-void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const returnByValue, RefPtr<InspectorObject>* result, bool* wasThrown)
+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const returnByValue, RefPtr<InspectorObject>& result, bool* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(callFrameId);
     if (injectedScript.hasNoValue()) {
         *errorString = "Inspected frame has gone";
         return;
     }
-    injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, result, wasThrown);
+    injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, &result, wasThrown);
 }
 
 PassRefPtr<InspectorArray> InspectorDebuggerAgent::currentCallFrames()
index ba242dc7c5b2d6723cccfc9be6327a1e9b377d50..8939af80f45870f76d22afb29eb5abaa6a929f14 100644 (file)
@@ -81,15 +81,15 @@ public:
     // Part of the protocol.
     void setBreakpointsActive(ErrorString*, bool active);
 
-    void setBreakpointByUrl(ErrorString*, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, String* breakpointId, RefPtr<InspectorArray>* locations);
-    void setBreakpoint(ErrorString*, PassRefPtr<InspectorObject> location, const String* const optionalCondition, String* breakpointId, RefPtr<InspectorObject>* actualLocation);
+    void setBreakpointByUrl(ErrorString*, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, String* breakpointId, RefPtr<InspectorArray>& locations);
+    void setBreakpoint(ErrorString*, PassRefPtr<InspectorObject> location, const String* const optionalCondition, String* breakpointId, RefPtr<InspectorObject>& actualLocation);
     void removeBreakpoint(ErrorString*, const String& breakpointId);
     void continueToLocation(ErrorString*, PassRefPtr<InspectorObject> location);
 
-    void searchInContent(ErrorString*, const String& scriptId, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>*);
-    void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result);
+    void searchInContent(ErrorString*, const String& scriptId, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>&);
+    void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>& newCallFrames, RefPtr<InspectorObject>& result);
     void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource);
-    void getFunctionLocation(ErrorString*, const String& functionId, RefPtr<InspectorObject>* location);
+    void getFunctionLocation(ErrorString*, const String& functionId, RefPtr<InspectorObject>& location);
     void schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<InspectorObject> data);
     void cancelPauseOnNextStatement();
     void breakProgram(const String& breakReason, PassRefPtr<InspectorObject> data);
@@ -105,7 +105,7 @@ public:
                              const String* const objectGroup,
                              const bool* const includeCommandLineAPI,
                              const bool* const returnByValue,
-                             RefPtr<InspectorObject>* result,
+                             RefPtr<InspectorObject>& result,
                              bool* wasThrown);
 
     class Listener {
index 5e641880c398f9c470ae7b6acadb1710eeb3f5bd..852e03012502680d876f77bb7b2978c13cc3474e 100644 (file)
@@ -148,7 +148,7 @@ InspectorMemoryAgent::~InspectorMemoryAgent()
 {
 }
 
-void InspectorMemoryAgent::getDOMNodeCount(ErrorString*, RefPtr<InspectorArray>* result)
+void InspectorMemoryAgent::getDOMNodeCount(ErrorString*, RefPtr<InspectorArray>& result)
 {
     CounterVisitor counterVisitor(m_page);
     ScriptProfiler::visitJSDOMWrappers(&counterVisitor);
@@ -159,7 +159,7 @@ void InspectorMemoryAgent::getDOMNodeCount(ErrorString*, RefPtr<InspectorArray>*
             counterVisitor.visitNode(doc);
     }
 
-    *result = counterVisitor.counters();
+    result = counterVisitor.counters();
 }
 
 InspectorMemoryAgent::InspectorMemoryAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InspectorDOMAgent* domAgent)
index d8dafa8988692628dc3fc7724964cdc4d2fbf24d..b1bc115155dc013c506b3da20027b044bb91bddd 100644 (file)
@@ -57,7 +57,7 @@ public:
         return adoptPtr(new InspectorMemoryAgent(instrumentingAgents, state, page, domAgent));
     }
 
-    void getDOMNodeCount(ErrorString*, RefPtr<InspectorArray>* result);
+    void getDOMNodeCount(ErrorString*, RefPtr<InspectorArray>& result);
 
     ~InspectorMemoryAgent();
 
index 2de4d15fd40a0883434d47b9245514f94489a3a0..b1c9ac4b5fe3066c77b11188ebc94dff7dcfee90 100644 (file)
@@ -409,7 +409,7 @@ static Vector<KURL> allResourcesURLsForFrame(Frame* frame)
     return result;
 }
 
-void InspectorPageAgent::getCookies(ErrorString*, RefPtr<InspectorArray>* cookies, WTF::String* cookiesString)
+void InspectorPageAgent::getCookies(ErrorString*, RefPtr<InspectorArray>& cookies, WTF::String* cookiesString)
 {
     // If we can get raw cookies.
     ListHashSet<Cookie> rawCookiesList;
@@ -446,7 +446,7 @@ void InspectorPageAgent::getCookies(ErrorString*, RefPtr<InspectorArray>* cookie
     }
 
     if (rawCookiesImplemented)
-        *cookies = buildArrayForCookies(rawCookiesList);
+        cookies = buildArrayForCookies(rawCookiesList);
     else
         *cookiesString = stringCookiesList;
 }
@@ -464,9 +464,9 @@ void InspectorPageAgent::deleteCookie(ErrorString*, const String& cookieName, co
     }
 }
 
-void InspectorPageAgent::getResourceTree(ErrorString*, RefPtr<InspectorObject>* object)
+void InspectorPageAgent::getResourceTree(ErrorString*, RefPtr<InspectorObject>& object)
 {
-    *object = buildObjectForFrameTree(m_page->mainFrame());
+    object = buildObjectForFrameTree(m_page->mainFrame());
 }
 
 void InspectorPageAgent::getResourceContent(ErrorString* errorString, const String& frameId, const String& url, String* content, bool* base64Encoded)
@@ -491,9 +491,9 @@ static bool textContentForCachedResource(CachedResource* cachedResource, String*
     return false;
 }
 
-void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>* results)
+void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>& results)
 {
-    *results = InspectorArray::create();
+    results = InspectorArray::create();
 
     bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
     bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
@@ -520,7 +520,7 @@ void InspectorPageAgent::searchInResource(ErrorString*, const String& frameId, c
     if (!success)
         return;
 
-    *results = ContentSearchUtils::searchInTextByLines(content, query, caseSensitive, isRegex);
+    results = ContentSearchUtils::searchInTextByLines(content, query, caseSensitive, isRegex);
 }
 
 static PassRefPtr<InspectorObject> buildObjectForSearchResult(const String& frameId, const String& url, int matchesCount)
@@ -533,7 +533,7 @@ static PassRefPtr<InspectorObject> buildObjectForSearchResult(const String& fram
     return result;
 }
 
-void InspectorPageAgent::searchInResources(ErrorString*, const String& text, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>* results)
+void InspectorPageAgent::searchInResources(ErrorString*, const String& text, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>& results)
 {
     RefPtr<InspectorArray> searchResults = InspectorArray::create();
 
@@ -559,7 +559,7 @@ void InspectorPageAgent::searchInResources(ErrorString*, const String& text, con
         }
     }
 
-    *results = searchResults;
+    results = searchResults;
 }
 
 void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
index 2fa21c06ccd1b3da96d366c743dc3a82ea0302bd..79d22e5bc1e8699d33a3b778ff13b9b4a5dd5072 100644 (file)
@@ -93,12 +93,12 @@ public:
     void removeScriptToEvaluateOnLoad(ErrorString*, const String& identifier);
     void reload(ErrorString*, const bool* const optionalIgnoreCache, const String* optionalScriptToEvaluateOnLoad);
     void open(ErrorString*, const String& url, const bool* const inNewWindow);
-    void getCookies(ErrorString*, RefPtr<InspectorArray>* cookies, WTF::String* cookiesString);
+    void getCookies(ErrorString*, RefPtr<InspectorArray>& cookies, WTF::String* cookiesString);
     void deleteCookie(ErrorString*, const String& cookieName, const String& domain);
-    void getResourceTree(ErrorString*, RefPtr<InspectorObject>*);
+    void getResourceTree(ErrorString*, RefPtr<InspectorObject>&);
     void getResourceContent(ErrorString*, const String& frameId, const String& url, String* content, bool* base64Encoded);
-    void searchInResource(ErrorString*, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>*);
-    void searchInResources(ErrorString*, const String&, const bool* const caseSensitive, const bool* const isRegex, RefPtr<InspectorArray>*);
+    void searchInResource(ErrorString*, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<InspectorArray>&);
+    void searchInResources(ErrorString*, const String&, const bool* const caseSensitive, const bool* const isRegex, RefPtr<InspectorArray>&);
 
     // InspectorInstrumentation API
     void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
index 222822324a2953694ddd89f86db0a6fe838dc225..73cfa5f7c59fb64dec144059a7110ef9d67759ae 100644 (file)
@@ -192,14 +192,14 @@ String InspectorProfilerAgent::getCurrentUserInitiatedProfileName(bool increment
     return makeString(UserInitiatedProfileName, '.', String::number(m_currentUserInitiatedProfileNumber));
 }
 
-void InspectorProfilerAgent::getProfileHeaders(ErrorString*, RefPtr<InspectorArray>* headers)
+void InspectorProfilerAgent::getProfileHeaders(ErrorString*, RefPtr<InspectorArray>& headers)
 {
     ProfilesMap::iterator profilesEnd = m_profiles.end();
     for (ProfilesMap::iterator it = m_profiles.begin(); it != profilesEnd; ++it)
-        (*headers)->pushObject(createProfileHeader(*it->second));
+        headers->pushObject(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->pushObject(createSnapshotHeader(*it->second));
 }
 
 namespace {
@@ -217,21 +217,21 @@ private:
 
 } // namespace
 
-void InspectorProfilerAgent::getProfile(ErrorString*, const String& type, unsigned uid, RefPtr<InspectorObject>* profileObject)
+void InspectorProfilerAgent::getProfile(ErrorString*, const String& type, unsigned uid, RefPtr<InspectorObject>& profileObject)
 {
     if (type == CPUProfileType) {
         ProfilesMap::iterator it = m_profiles.find(uid);
         if (it != m_profiles.end()) {
-            *profileObject = createProfileHeader(*it->second);
-            (*profileObject)->setObject("head", it->second->buildInspectorObjectForHead());
+            profileObject = createProfileHeader(*it->second);
+            profileObject->setObject("head", it->second->buildInspectorObjectForHead());
             if (it->second->bottomUpHead())
-                (*profileObject)->setObject("bottomUpHead", it->second->buildInspectorObjectForBottomUpHead());
+                profileObject->setObject("bottomUpHead", it->second->buildInspectorObjectForBottomUpHead());
         }
     } else if (type == HeapProfileType) {
         HeapSnapshotsMap::iterator it = m_snapshots.find(uid);
         if (it != m_snapshots.end()) {
             RefPtr<ScriptHeapSnapshot> snapshot = it->second;
-            *profileObject = createSnapshotHeader(*snapshot);
+            profileObject = createSnapshotHeader(*snapshot);
             if (m_frontend) {
                 OutputStream stream(m_frontend, uid);
                 snapshot->writeJSON(&stream);
@@ -385,11 +385,11 @@ void InspectorProfilerAgent::toggleRecordButton(bool isProfiling)
         m_frontend->setRecordingProfile(isProfiling);
 }
 
-void InspectorProfilerAgent::getObjectByHeapObjectId(ErrorString* error, int id, RefPtr<InspectorObject>* result)
+void InspectorProfilerAgent::getObjectByHeapObjectId(ErrorString* error, int id, RefPtr<InspectorObject>& result)
 {
     RefPtr<InspectorValue> heapObject = ScriptProfiler::objectByHeapObjectId(id, m_injectedScriptManager);
     if (!heapObject->isNull())
-        heapObject->asObject(result);
+        heapObject->asObject(&result);
     else
         *error = "Object is not available.";
 }
index d473390a37218ef787ff456d5596e3ab292e0aa0..02bcb7b4328a75d0ad2d56fd447bf1f7e892ae5b 100644 (file)
@@ -81,8 +81,8 @@ public:
     void enable(bool skipRecompile);
     bool enabled() { return m_enabled; }
     String getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false);
-    void getProfileHeaders(ErrorString* error, RefPtr<InspectorArray>* headers);
-    void getProfile(ErrorString* error, const String& type, unsigned uid, RefPtr<InspectorObject>* profileObject);
+    void getProfileHeaders(ErrorString* error, RefPtr<InspectorArray>& headers);
+    void getProfile(ErrorString* error, const String& type, unsigned uid, RefPtr<InspectorObject>& profileObject);
     void removeProfile(ErrorString* error, const String& type, unsigned uid);
 
     virtual void setFrontend(InspectorFrontend*);
@@ -92,7 +92,7 @@ public:
     void takeHeapSnapshot(ErrorString*);
     void toggleRecordButton(bool isProfiling);
 
-    void getObjectByHeapObjectId(ErrorString*, int id, RefPtr<InspectorObject>* result);
+    void getObjectByHeapObjectId(ErrorString*, int id, RefPtr<InspectorObject>& result);
 
 private:
     typedef HashMap<unsigned int, RefPtr<ScriptProfile> > ProfilesMap;
index 77692a5691b7329afec215776f29069923ecfc52..7417f8ec0207948eadff10fa61cf0fcecc11715a 100644 (file)
@@ -71,7 +71,7 @@ InspectorRuntimeAgent::~InspectorRuntimeAgent()
     m_instrumentingAgents->setInspectorRuntimeAgent(0);
 }
 
-void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptions, const String* const frameId, const bool* const returnByValue, RefPtr<InspectorObject>* result, bool* wasThrown)
+void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptions, const String* const frameId, const bool* const returnByValue, RefPtr<InspectorObject>& result, bool* wasThrown)
 {
     ScriptState* scriptState = 0;
     if (frameId) {
@@ -97,7 +97,7 @@ void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& exp
     }
 #endif
 
-    injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), result, wasThrown);
+    injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), &result, wasThrown);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (pauseStateChanged)
@@ -105,7 +105,7 @@ void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& exp
 #endif
 }
 
-void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const returnByValue, RefPtr<InspectorObject>* result, bool* wasThrown)
+void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const returnByValue, RefPtr<InspectorObject>& result, bool* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     if (injectedScript.hasNoValue()) {
@@ -115,17 +115,17 @@ void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const Strin
     String arguments;
     if (optionalArguments)
         arguments = (*optionalArguments)->toJSONString();
-    injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), result, wasThrown);
+    injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), &result, wasThrown);
 }
 
-void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result)
+void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>& result)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     if (injectedScript.hasNoValue()) {
         *errorString = "Inspected frame has gone";
         return;
     }
-    injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, result);
+    injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, &result);
 }
 
 void InspectorRuntimeAgent::releaseObject(ErrorString*, const String& objectId)
index 9145c6c8a227e9ece069fe07a2cd7e87fe1b28e4..79a202b89da713c92398d68d1f220d3938089ba0 100644 (file)
@@ -64,17 +64,17 @@ public:
                   const bool* const doNotPauseOnExceptions,
                   const String* const frameId,
                   const bool* const returnByValue,
-                  RefPtr<InspectorObject>* result,
+                  RefPtr<InspectorObject>& result,
                   bool* wasThrown);
     void callFunctionOn(ErrorString*,
                         const String& objectId,
                         const String& expression,
                         const RefPtr<InspectorArray>* const optionalArguments,
                         const bool* const returnByValue,
-                        RefPtr<InspectorObject>* result,
+                        RefPtr<InspectorObject>& result,
                         bool* wasThrown);
     void releaseObject(ErrorString*, const String& objectId);
-    void getProperties(ErrorString*, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result);
+    void getProperties(ErrorString*, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>& result);
     void releaseObjectGroup(ErrorString*, const String& objectGroup);
     void run(ErrorString*);