Unreviewed, rolling out r178039.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jan 2015 19:32:05 +0000 (19:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jan 2015 19:32:05 +0000 (19:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140187

Breaks ObjC Inspector Protocol (Requested by JoePeck on
#webkit).

Reverted changeset:

"Web Inspector: purge PassRefPtr from Inspector code and use
Ref for typed and untyped protocol objects"
https://bugs.webkit.org/show_bug.cgi?id=140053
http://trac.webkit.org/changeset/178039

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

126 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bindings/ScriptValue.cpp
Source/JavaScriptCore/bindings/ScriptValue.h
Source/JavaScriptCore/inspector/ConsoleMessage.cpp
Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp
Source/JavaScriptCore/inspector/ContentSearchUtilities.h
Source/JavaScriptCore/inspector/InjectedScript.cpp
Source/JavaScriptCore/inspector/InjectedScript.h
Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
Source/JavaScriptCore/inspector/InspectorEnvironment.h
Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
Source/JavaScriptCore/inspector/InspectorValues.cpp
Source/JavaScriptCore/inspector/InspectorValues.h
Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
Source/JavaScriptCore/inspector/ScriptCallFrame.cpp
Source/JavaScriptCore/inspector/ScriptCallFrame.h
Source/JavaScriptCore/inspector/ScriptCallStack.cpp
Source/JavaScriptCore/inspector/ScriptCallStack.h
Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.h
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py
Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/replay/EncodedValue.cpp
Source/JavaScriptCore/replay/EncodedValue.h
Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py
Source/JavaScriptCore/runtime/ConsoleClient.cpp
Source/JavaScriptCore/runtime/ConsoleClient.h
Source/JavaScriptCore/runtime/TypeSet.cpp
Source/JavaScriptCore/runtime/TypeSet.h
Source/WTF/ChangeLog
Source/WTF/wtf/Stopwatch.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/html/parser/XSSAuditorDelegate.cpp
Source/WebCore/inspector/CommandLineAPIHost.cpp
Source/WebCore/inspector/CommandLineAPIHost.h
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorCSSAgent.h
Source/WebCore/inspector/InspectorConsoleInstrumentation.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
Source/WebCore/inspector/InspectorDOMStorageAgent.h
Source/WebCore/inspector/InspectorDatabaseAgent.cpp
Source/WebCore/inspector/InspectorDatabaseAgent.h
Source/WebCore/inspector/InspectorDatabaseInstrumentation.h
Source/WebCore/inspector/InspectorDatabaseResource.cpp
Source/WebCore/inspector/InspectorDatabaseResource.h
Source/WebCore/inspector/InspectorFrontendHost.h
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
Source/WebCore/inspector/InspectorLayerTreeAgent.h
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorOverlay.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/inspector/InspectorReplayAgent.cpp
Source/WebCore/inspector/InspectorReplayAgent.h
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/inspector/InspectorResourceAgent.h
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/InspectorStyleSheet.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/InspectorWorkerAgent.cpp
Source/WebCore/inspector/InspectorWorkerAgent.h
Source/WebCore/inspector/NetworkResourcesData.cpp
Source/WebCore/inspector/NetworkResourcesData.h
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/TimelineRecordFactory.h
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerInspectorController.h
Source/WebCore/page/PageConsoleClient.cpp
Source/WebCore/page/PageConsoleClient.h
Source/WebCore/replay/ReplayController.cpp
Source/WebCore/replay/ReplayInputCreationMethods.cpp
Source/WebCore/workers/SharedWorkerGlobalScope.cpp
Source/WebCore/workers/SharedWorkerGlobalScope.h
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in

index 43b8adf..e85de2d 100644 (file)
@@ -1,3 +1,18 @@
+2015-01-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r178039.
+        https://bugs.webkit.org/show_bug.cgi?id=140187
+
+        Breaks ObjC Inspector Protocol (Requested by JoePeck on
+        #webkit).
+
+        Reverted changeset:
+
+        "Web Inspector: purge PassRefPtr from Inspector code and use
+        Ref for typed and untyped protocol objects"
+        https://bugs.webkit.org/show_bug.cgi?id=140053
+        http://trac.webkit.org/changeset/178039
+
 2015-01-06  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
index 9e2251d..d046ab2 100644 (file)
@@ -98,7 +98,7 @@ bool ScriptValue::isFunction() const
 }
 
 #if ENABLE(INSPECTOR)
-static RefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSValue value, int maxDepth)
+static PassRefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSValue value, int maxDepth)
 {
     if (!value) {
         ASSERT_NOT_REACHED();
@@ -123,7 +123,7 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSValue
 
     if (value.isObject()) {
         if (isJSArray(value)) {
-            Ref<InspectorArray> inspectorArray = InspectorArray::create();
+            RefPtr<InspectorArray> inspectorArray = InspectorArray::create();
             JSArray* array = asArray(value);
             unsigned length = array->length();
             for (unsigned i = 0; i < length; i++) {
@@ -131,11 +131,11 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSValue
                 RefPtr<InspectorValue> elementValue = jsToInspectorValue(scriptState, element, maxDepth);
                 if (!elementValue)
                     return nullptr;
-                inspectorArray->pushValue(WTF::move(elementValue));
+                inspectorArray->pushValue(elementValue);
             }
-            return WTF::move(inspectorArray);
+            return inspectorArray;
         }
-        Ref<InspectorObject> inspectorObject = InspectorObject::create();
+        RefPtr<InspectorObject> inspectorObject = InspectorObject::create();
         JSObject* object = value.getObject();
         PropertyNameArray propertyNames(scriptState);
         object->methodTable()->getOwnPropertyNames(object, scriptState, propertyNames, ExcludeDontEnumProperties);
@@ -145,16 +145,16 @@ static RefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSValue
             RefPtr<InspectorValue> inspectorValue = jsToInspectorValue(scriptState, propertyValue, maxDepth);
             if (!inspectorValue)
                 return nullptr;
-            inspectorObject->setValue(name.string(), WTF::move(inspectorValue));
+            inspectorObject->setValue(name.string(), inspectorValue);
         }
-        return WTF::move(inspectorObject);
+        return inspectorObject;
     }
 
     ASSERT_NOT_REACHED();
     return nullptr;
 }
 
-RefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
+PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
 {
     JSLockHolder holder(scriptState);
     return jsToInspectorValue(scriptState, m_value.get(), InspectorValue::maxDepth);
index fef7702..d5fade9 100644 (file)
@@ -66,7 +66,7 @@ public:
     bool operator==(const ScriptValue& other) const { return m_value == other.m_value; }
 
 #if ENABLE(INSPECTOR)
-    RefPtr<Inspector::InspectorValue> toInspectorValue(JSC::ExecState*) const;
+    PassRefPtr<Inspector::InspectorValue> toInspectorValue(JSC::ExecState*) const;
 #endif
 
 private:
index 202e164..f7d1e55 100644 (file)
@@ -181,11 +181,10 @@ static Inspector::Protocol::Console::ConsoleMessage::Level messageLevelValue(Mes
 
 void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFrontendDispatcher, Inspector::InjectedScriptManager* injectedScriptManager, bool generatePreview)
 {
-    Ref<Inspector::Protocol::Console::ConsoleMessage> jsonObj = Inspector::Protocol::Console::ConsoleMessage::create()
+    RefPtr<Inspector::Protocol::Console::ConsoleMessage> jsonObj = Inspector::Protocol::Console::ConsoleMessage::create()
         .setSource(messageSourceValue(m_source))
         .setLevel(messageLevelValue(m_level))
-        .setText(m_message)
-        .release();
+        .setText(m_message);
 
     // FIXME: only send out type for ConsoleAPI source messages.
     jsonObj->setType(messageTypeValue(m_type));
@@ -200,7 +199,7 @@ void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFr
     if (m_arguments && m_arguments->argumentCount()) {
         InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(m_arguments->globalState());
         if (!injectedScript.hasNoValue()) {
-            Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>> jsonArgs = Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>::create();
+            RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>> jsonArgs = Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>::create();
             if (m_type == MessageType::Table && generatePreview && m_arguments->argumentCount()) {
                 Deprecated::ScriptValue table = m_arguments->argumentAt(0);
                 Deprecated::ScriptValue columns = m_arguments->argumentCount() > 1 ? m_arguments->argumentAt(1) : Deprecated::ScriptValue();
@@ -209,7 +208,7 @@ void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFr
                     ASSERT_NOT_REACHED();
                     return;
                 }
-                jsonArgs->addItem(inspectorValue.copyRef());
+                jsonArgs->addItem(inspectorValue);
             } else {
                 for (unsigned i = 0; i < m_arguments->argumentCount(); ++i) {
                     RefPtr<Inspector::Protocol::Runtime::RemoteObject> inspectorValue = injectedScript.wrapObject(m_arguments->argumentAt(i), ASCIILiteral("console"), generatePreview);
@@ -217,17 +216,17 @@ void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFr
                         ASSERT_NOT_REACHED();
                         return;
                     }
-                    jsonArgs->addItem(inspectorValue.copyRef());
+                    jsonArgs->addItem(inspectorValue);
                 }
             }
-            jsonObj->setParameters(WTF::move(jsonArgs));
+            jsonObj->setParameters(jsonArgs);
         }
     }
 
     if (m_callStack)
         jsonObj->setStackTrace(m_callStack->buildInspectorArray());
 
-    consoleFrontendDispatcher->messageAdded(WTF::move(jsonObj));
+    consoleFrontendDispatcher->messageAdded(jsonObj);
 }
 
 void ConsoleMessage::updateRepeatCountInConsole(InspectorConsoleFrontendDispatcher* consoleFrontendDispatcher)
index f5df0bf..8e57637 100644 (file)
@@ -120,7 +120,7 @@ std::unique_ptr<Vector<size_t>> lineEndings(const String& text)
     return result;
 }
 
-static Ref<Inspector::Protocol::GenericTypes::SearchMatch> buildObjectForSearchMatch(size_t lineNumber, const String& lineContent)
+static PassRefPtr<Inspector::Protocol::GenericTypes::SearchMatch> buildObjectForSearchMatch(size_t lineNumber, const String& lineContent)
 {
     return Inspector::Protocol::GenericTypes::SearchMatch::create()
         .setLineNumber(lineNumber)
@@ -153,17 +153,15 @@ int countRegularExpressionMatches(const JSC::Yarr::RegularExpression& regex, con
     return result;
 }
 
-Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
+PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
 {
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> result = Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>::create();
+    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> result = Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>::create();
 
     JSC::Yarr::RegularExpression regex = ContentSearchUtilities::createSearchRegex(query, caseSensitive, isRegex);
     Vector<std::pair<size_t, String>> matches = getRegularExpressionMatchesByLines(regex, text);
 
-    for (const auto& match : matches) {
-        Ref<Inspector::Protocol::GenericTypes::SearchMatch> matchObject = buildObjectForSearchMatch(match.first, match.second);
-        result->addItem(WTF::move(matchObject));
-    }
+    for (const auto& match : matches)
+        result->addItem(buildObjectForSearchMatch(match.first, match.second));
 
     return result;
 }
index b3b6161..988a0f2 100644 (file)
@@ -46,7 +46,7 @@ namespace ContentSearchUtilities {
 
 JS_EXPORT_PRIVATE JSC::Yarr::RegularExpression createSearchRegex(const String& query, bool caseSensitive, bool isRegex);
 JS_EXPORT_PRIVATE int countRegularExpressionMatches(const JSC::Yarr::RegularExpression&, const String&);
-JS_EXPORT_PRIVATE Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
+JS_EXPORT_PRIVATE PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
 JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings);
 JS_EXPORT_PRIVATE std::unique_ptr<Vector<size_t>> lineEndings(const String&);
 
index 3b83d08..95fa75d 100644 (file)
@@ -106,7 +106,7 @@ void InjectedScript::getFunctionDetails(ErrorString& errorString, const String&
         return;
     }
 
-    *result = BindingTraits<Inspector::Protocol::Debugger::FunctionDetails>::runtimeCast(WTF::move(resultValue));
+    *result = BindingTraits<Inspector::Protocol::Debugger::FunctionDetails>::runtimeCast(resultValue);
 }
 
 void InjectedScript::getProperties(ErrorString& errorString, const String& objectId, bool ownProperties, RefPtr<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
@@ -122,7 +122,7 @@ void InjectedScript::getProperties(ErrorString& errorString, const String& objec
         return;
     }
 
-    *properties = BindingTraits<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTF::move(result));
+    *properties = BindingTraits<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(result);
 }
 
 void InjectedScript::getInternalProperties(ErrorString& errorString, const String& objectId, RefPtr<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>* properties)
@@ -137,12 +137,12 @@ void InjectedScript::getInternalProperties(ErrorString& errorString, const Strin
         return;
     }
 
-    auto array = BindingTraits<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>::runtimeCast(WTF::move(result));
+    auto array = BindingTraits<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>::runtimeCast(result);
     if (array->length() > 0)
         *properties = array;
 }
 
-Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames)
+PassRefPtr<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames)
 {
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler());
@@ -153,12 +153,12 @@ Ref<Array<Inspector::Protocol::Debugger::CallFrame>> InjectedScript::wrapCallFra
     ASSERT(!hadException);
     RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(scriptState());
     if (result->type() == InspectorValue::Type::Array)
-        return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTF::move(result)).releaseNonNull();
+        return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(result);
 
     return Array<Inspector::Protocol::Debugger::CallFrame>::create();
 }
 
-RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const
+PassRefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const
 {
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapObject"), inspectorEnvironment()->functionCallHandler());
@@ -179,7 +179,7 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(co
     return BindingTraits<Inspector::Protocol::Runtime::RemoteObject>::runtimeCast(resultObject);
 }
 
-RefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const
+PassRefPtr<Inspector::Protocol::Runtime::RemoteObject> InjectedScript::wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const
 {
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapTable"), inspectorEnvironment()->functionCallHandler());
index 29092b0..42c790d 100644 (file)
@@ -62,9 +62,9 @@ public:
     void getProperties(ErrorString&, const String& objectId, bool ownProperties, RefPtr<Protocol::Array<Protocol::Runtime::PropertyDescriptor>>* result);
     void getInternalProperties(ErrorString&, const String& objectId, RefPtr<Protocol::Array<Protocol::Runtime::InternalPropertyDescriptor>>* result);
 
-    Ref<Protocol::Array<Protocol::Debugger::CallFrame>> wrapCallFrames(const Deprecated::ScriptValue&);
-    RefPtr<Protocol::Runtime::RemoteObject> wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const;
-    RefPtr<Protocol::Runtime::RemoteObject> wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const;
+    PassRefPtr<Protocol::Array<Protocol::Debugger::CallFrame>> wrapCallFrames(const Deprecated::ScriptValue&);
+    PassRefPtr<Protocol::Runtime::RemoteObject> wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const;
+    PassRefPtr<Protocol::Runtime::RemoteObject> wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const;
 
     void setExceptionValue(const Deprecated::ScriptValue&);
     void clearExceptionValue();
index 7de0519..dd1298c 100644 (file)
@@ -135,20 +135,15 @@ void InjectedScriptBase::makeEvalCall(ErrorString& errorString, Deprecated::Scri
         return;
     }
 
-    RefPtr<InspectorObject> resultObject;
-    if (!resultPair->getObject(ASCIILiteral("result"), resultObject)) {
-        errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag");
-        return;
-    }
-
-    bool wasThrownValue = false;
-    if (!resultPair->getBoolean(ASCIILiteral("wasThrown"), wasThrownValue)) {
+    RefPtr<InspectorObject> resultObject = resultPair->getObject(ASCIILiteral("result"));
+    bool wasThrownVal = false;
+    if (!resultObject || !resultPair->getBoolean(ASCIILiteral("wasThrown"), wasThrownVal)) {
         errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag");
         return;
     }
 
     *objectResult = BindingTraits<Protocol::Runtime::RemoteObject>::runtimeCast(resultObject);
-    *wasThrown = wasThrownValue;
+    *wasThrown = wasThrownVal;
 }
 
 } // namespace Inspector
index 895a096..dbe793e 100644 (file)
@@ -36,8 +36,8 @@
 
 namespace Inspector {
 
-InspectorBackendDispatcher::CallbackBase::CallbackBase(Ref<InspectorBackendDispatcher>&& backendDispatcher, int id)
-    : m_backendDispatcher(WTF::move(backendDispatcher))
+InspectorBackendDispatcher::CallbackBase::CallbackBase(PassRefPtr<InspectorBackendDispatcher> backendDispatcher, int id)
+    : m_backendDispatcher(backendDispatcher)
     , m_id(id)
     , m_alreadySent(false)
 {
@@ -54,18 +54,18 @@ void InspectorBackendDispatcher::CallbackBase::sendFailure(const ErrorString& er
     sendIfActive(nullptr, error);
 }
 
-void InspectorBackendDispatcher::CallbackBase::sendIfActive(RefPtr<InspectorObject>&& partialMessage, const ErrorString& invocationError)
+void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr<InspectorObject> partialMessage, const ErrorString& invocationError)
 {
     if (m_alreadySent)
         return;
 
-    m_backendDispatcher->sendResponse(m_id, WTF::move(partialMessage), invocationError);
+    m_backendDispatcher->sendResponse(m_id, partialMessage, invocationError);
     m_alreadySent = true;
 }
 
-Ref<InspectorBackendDispatcher> InspectorBackendDispatcher::create(InspectorFrontendChannel* inspectorFrontendChannel)
+PassRefPtr<InspectorBackendDispatcher> InspectorBackendDispatcher::create(InspectorFrontendChannel* inspectorFrontendChannel)
 {
-    return adoptRef(*new InspectorBackendDispatcher(inspectorFrontendChannel));
+    return adoptRef(new InspectorBackendDispatcher(inspectorFrontendChannel));
 }
 
 void InspectorBackendDispatcher::registerDispatcherForDomain(const String& domain, InspectorSupplementalBackendDispatcher* dispatcher)
@@ -90,8 +90,8 @@ void InspectorBackendDispatcher::dispatch(const String& message)
         return;
     }
 
-    RefPtr<InspectorValue> callIdValue;
-    if (!messageObject->getValue(ASCIILiteral("id"), callIdValue)) {
+    RefPtr<InspectorValue> callIdValue = messageObject->get(ASCIILiteral("id"));
+    if (!callIdValue) {
         reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("'id' property was not found"));
         return;
     }
@@ -102,8 +102,8 @@ void InspectorBackendDispatcher::dispatch(const String& message)
         return;
     }
 
-    RefPtr<InspectorValue> methodValue;
-    if (!messageObject->getValue(ASCIILiteral("method"), methodValue)) {
+    RefPtr<InspectorValue> methodValue = messageObject->get(ASCIILiteral("method"));
+    if (!methodValue) {
         reportProtocolError(&callId, InvalidRequest, ASCIILiteral("'method' property wasn't found"));
         return;
     }
@@ -128,10 +128,10 @@ void InspectorBackendDispatcher::dispatch(const String& message)
     }
 
     String domainMethod = method.substring(position + 1);
-    domainDispatcher->dispatch(callId, domainMethod, messageObject.releaseNonNull());
+    domainDispatcher->dispatch(callId, domainMethod, messageObject.release());
 }
 
-void InspectorBackendDispatcher::sendResponse(long callId, RefPtr<InspectorObject>&& result, const ErrorString& invocationError)
+void InspectorBackendDispatcher::sendResponse(long callId, PassRefPtr<InspectorObject> result, const ErrorString& invocationError)
 {
     if (!m_inspectorFrontendChannel)
         return;
@@ -141,7 +141,7 @@ void InspectorBackendDispatcher::sendResponse(long callId, RefPtr<InspectorObjec
         return;
     }
 
-    Ref<InspectorObject> responseMessage = InspectorObject::create();
+    RefPtr<InspectorObject> responseMessage = InspectorObject::create();
     responseMessage->setObject(ASCIILiteral("result"), result);
     responseMessage->setInteger(ASCIILiteral("id"), callId);
     m_inspectorFrontendChannel->sendMessageToFrontend(responseMessage->toJSONString());
@@ -152,7 +152,7 @@ void InspectorBackendDispatcher::reportProtocolError(const long* const callId, C
     reportProtocolError(callId, errorCode, errorMessage, nullptr);
 }
 
-void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode errorCode, const String& errorMessage, RefPtr<Inspector::Protocol::Array<String>>&& data) const
+void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode errorCode, const String& errorMessage, PassRefPtr<InspectorArray> data) const
 {
     static const int errorCodes[] = {
         -32700, // ParseError
@@ -163,21 +163,21 @@ void InspectorBackendDispatcher::reportProtocolError(const long* const callId, C
         -32000, // ServerError
     };
 
-    ASSERT_ARG(errorCode, errorCode >= 0);
-    ASSERT_ARG(errorCode, (unsigned)errorCode < WTF_ARRAY_LENGTH(errorCodes));
-    ASSERT_ARG(errorCode, errorCodes[errorCode]);
+    ASSERT(errorCode >= 0);
+    ASSERT((unsigned)errorCode < WTF_ARRAY_LENGTH(errorCodes));
+    ASSERT(errorCodes[errorCode]);
 
     if (!m_inspectorFrontendChannel)
         return;
 
-    Ref<InspectorObject> error = InspectorObject::create();
+    RefPtr<InspectorObject> error = InspectorObject::create();
     error->setInteger(ASCIILiteral("code"), errorCodes[errorCode]);
     error->setString(ASCIILiteral("message"), errorMessage);
     if (data)
-        error->setArray(ASCIILiteral("data"), WTF::move(data));
+        error->setArray(ASCIILiteral("data"), data);
 
-    Ref<InspectorObject> message = InspectorObject::create();
-    message->setObject(ASCIILiteral("error"), WTF::move(error));
+    RefPtr<InspectorObject> message = InspectorObject::create();
+    message->setObject(ASCIILiteral("error"), error.release());
     if (callId)
         message->setInteger(ASCIILiteral("id"), *callId);
     else
@@ -187,36 +187,37 @@ void InspectorBackendDispatcher::reportProtocolError(const long* const callId, C
 }
 
 template<typename ReturnValueType, typename ValueType, typename DefaultValueType>
-static ReturnValueType getPropertyValue(InspectorObject* object, const String& name, bool* out_optionalValueFound, Inspector::Protocol::Array<String>& protocolErrors, DefaultValueType defaultValue, bool (*asMethod)(InspectorValue&, ValueType&), const char* typeName)
+static ReturnValueType getPropertyValue(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors, DefaultValueType defaultValue, bool (*asMethod)(InspectorValue&, ValueType&), const char* typeName)
 {
-    ValueType result = defaultValue;
-    // out_optionalValueFound signals to the caller whether an optional property was found.
-    // if out_optionalValueFound == nullptr, then this is a required property.
-    if (out_optionalValueFound)
-        *out_optionalValueFound = false;
+    ASSERT(protocolErrors);
+
+    ValueType value = defaultValue;
+    if (valueFound)
+        *valueFound = false;
 
     if (!object) {
-        if (!out_optionalValueFound)
-            protocolErrors.addItem(String::format("'params' object must contain required parameter '%s' with type '%s'.", name.utf8().data(), typeName));
-        return result;
+        if (!valueFound)
+            protocolErrors->pushString(String::format("'params' object must contain required parameter '%s' with type '%s'.", name.utf8().data(), typeName));
+        return value;
     }
 
-    auto findResult = object->find(name);
-    if (findResult == object->end()) {
-        if (!out_optionalValueFound)
-            protocolErrors.addItem(String::format("Parameter '%s' with type '%s' was not found.", name.utf8().data(), typeName));
-        return result;
+    InspectorObject::const_iterator end = object->end();
+    InspectorObject::const_iterator valueIterator = object->find(name);
+    if (valueIterator == end) {
+        if (!valueFound)
+            protocolErrors->pushString(String::format("Parameter '%s' with type '%s' was not found.", name.utf8().data(), typeName));
+        return value;
     }
 
-    if (!asMethod(*findResult->value, result)) {
-        protocolErrors.addItem(String::format("Parameter '%s' has wrong type. It must be '%s'.", name.utf8().data(), typeName));
-        return result;
+    if (!asMethod(*valueIterator->value, value)) {
+        protocolErrors->pushString(String::format("Parameter '%s' has wrong type. It must be '%s'.", name.utf8().data(), typeName));
+        return value;
     }
 
-    if (out_optionalValueFound)
-        *out_optionalValueFound = true;
+    if (valueFound)
+        *valueFound = true;
 
-    return result;
+    return value;
 }
 
 struct AsMethodBridges {
@@ -229,39 +230,39 @@ struct AsMethodBridges {
     static bool asValue(InspectorValue& value, RefPtr<InspectorValue>& output) { return value.asValue(output); }
 };
 
-int InspectorBackendDispatcher::getInteger(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+int InspectorBackendDispatcher::getInteger(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
     return getPropertyValue<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInteger, "Integer");
 }
 
-double InspectorBackendDispatcher::getDouble(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+double InspectorBackendDispatcher::getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
     return getPropertyValue<double, double, double>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asDouble, "Number");
 }
 
-String InspectorBackendDispatcher::getString(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+String InspectorBackendDispatcher::getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
     return getPropertyValue<String, String, String>(object, name, valueFound, protocolErrors, "", AsMethodBridges::asString, "String");
 }
 
-bool InspectorBackendDispatcher::getBoolean(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+bool InspectorBackendDispatcher::getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
     return getPropertyValue<bool, bool, bool>(object, name, valueFound, protocolErrors, false, AsMethodBridges::asBoolean, "Boolean");
 }
 
-RefPtr<InspectorObject> InspectorBackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+PassRefPtr<InspectorObject> InspectorBackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
-    return getPropertyValue<RefPtr<InspectorObject>, RefPtr<InspectorObject>, InspectorObject*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asObject, "Object");
+    return getPropertyValue<PassRefPtr<InspectorObject>, RefPtr<InspectorObject>, InspectorObject*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asObject, "Object");
 }
 
-RefPtr<InspectorArray> InspectorBackendDispatcher::getArray(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+PassRefPtr<InspectorArray> InspectorBackendDispatcher::getArray(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
-    return getPropertyValue<RefPtr<InspectorArray>, RefPtr<InspectorArray>, InspectorArray*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asArray, "Array");
+    return getPropertyValue<PassRefPtr<InspectorArray>, RefPtr<InspectorArray>, InspectorArray*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asArray, "Array");
 }
 
-RefPtr<InspectorValue> InspectorBackendDispatcher::getValue(InspectorObject* object, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors)
+PassRefPtr<InspectorValue> InspectorBackendDispatcher::getValue(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
 {
-    return getPropertyValue<RefPtr<InspectorValue>, RefPtr<InspectorValue>, InspectorValue*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asValue, "Value");
+    return getPropertyValue<PassRefPtr<InspectorValue>, RefPtr<InspectorValue>, InspectorValue*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asValue, "Value");
 }
 
 } // namespace Inspector
index 86cbd9e..a99e6ea 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef InspectorBackendDispatcher_h
 #define InspectorBackendDispatcher_h
 
-#include "InspectorProtocolTypes.h"
+#include "InspectorValues.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -40,31 +40,30 @@ typedef String ErrorString;
 
 class InspectorSupplementalBackendDispatcher : public RefCounted<InspectorSupplementalBackendDispatcher> {
 public:
-    InspectorSupplementalBackendDispatcher(InspectorBackendDispatcher& backendDispatcher)
-        : m_backendDispatcher(backendDispatcher) { }
+    InspectorSupplementalBackendDispatcher(InspectorBackendDispatcher* backendDispatcher) : m_backendDispatcher(backendDispatcher) { }
     virtual ~InspectorSupplementalBackendDispatcher() { }
-    virtual void dispatch(long callId, const String& method, Ref<InspectorObject>&& message) = 0;
+    virtual void dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message) = 0;
 protected:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 class JS_EXPORT_PRIVATE InspectorBackendDispatcher : public RefCounted<InspectorBackendDispatcher> {
 public:
-    static Ref<InspectorBackendDispatcher> create(InspectorFrontendChannel*);
+    static PassRefPtr<InspectorBackendDispatcher> create(InspectorFrontendChannel*);
 
     class JS_EXPORT_PRIVATE CallbackBase : public RefCounted<CallbackBase> {
     public:
-        CallbackBase(Ref<InspectorBackendDispatcher>&&, int id);
+        CallbackBase(PassRefPtr<InspectorBackendDispatcher>, int id);
 
         bool isActive() const;
         void sendFailure(const ErrorString&);
         void disable() { m_alreadySent = true; }
 
     protected:
-        void sendIfActive(RefPtr<InspectorObject>&& partialMessage, const ErrorString& invocationError);
+        void sendIfActive(PassRefPtr<InspectorObject> partialMessage, const ErrorString& invocationError);
 
     private:
-        Ref<InspectorBackendDispatcher> m_backendDispatcher;
+        RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
         int m_id;
         bool m_alreadySent;
     };
@@ -83,17 +82,17 @@ public:
 
     void registerDispatcherForDomain(const String& domain, InspectorSupplementalBackendDispatcher*);
     void dispatch(const String& message);
-    void sendResponse(long callId, RefPtr<InspectorObject>&& result, const ErrorString& invocationError);
+    void sendResponse(long callId, PassRefPtr<InspectorObject> result, const ErrorString& invocationError);
     void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage) const;
-    void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, RefPtr<Inspector::Protocol::Array<String>>&& data) const;
-
-    static int getInteger(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static double getDouble(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static String getString(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static bool getBoolean(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static RefPtr<InspectorValue> getValue(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static RefPtr<InspectorObject> getObject(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
-    static RefPtr<InspectorArray> getArray(InspectorObject*, const String& name, bool* valueFound, Inspector::Protocol::Array<String>& protocolErrors);
+    void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<InspectorArray> data) const;
+
+    static int getInteger(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static double getDouble(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static String getString(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static bool getBoolean(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static PassRefPtr<InspectorValue> getValue(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static PassRefPtr<InspectorObject> getObject(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static PassRefPtr<InspectorArray> getArray(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);
 
 private:
     InspectorBackendDispatcher(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
index 18df142..ae2a7cd 100644 (file)
@@ -51,7 +51,7 @@ public:
     virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) = 0;
     virtual void didCallInjectedScriptFunction(JSC::ExecState*) = 0;
     virtual void frontendInitialized() = 0;
-    virtual Ref<WTF::Stopwatch> executionStopwatch() = 0;
+    virtual PassRefPtr<WTF::Stopwatch> executionStopwatch() = 0;
 };
 
 } // namespace Inspector
index 296f3a8..143def8 100644 (file)
 
 #include "InspectorValues.h"
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
 namespace Protocol {
 
-template<typename T> struct BindingTraits;
-
 template<typename T>
 class OptOutput {
 public:
@@ -64,44 +63,128 @@ private:
     WTF_MAKE_NONCOPYABLE(OptOutput);
 };
 
+// This class provides "Traits" type for the input type T. It is programmed using C++ template specialization
+// technique. By default it simply takes "ItemTraits" type from T, but it doesn't work with the base types.
+template<typename T>
+struct ArrayItemHelper {
+    typedef typename T::ItemTraits Traits;
+};
+
 template<typename T>
 class Array : public InspectorArrayBase {
 private:
     Array() { }
 
-    InspectorArray& openAccessors()
+    InspectorArray* openAccessors()
     {
         COMPILE_ASSERT(sizeof(InspectorArray) == sizeof(Array<T>), cannot_cast);
-        return *static_cast<InspectorArray*>(static_cast<InspectorArrayBase*>(this));
+        return static_cast<InspectorArray*>(static_cast<InspectorArrayBase*>(this));
     }
 
 public:
-    void addItem(Ref<T>&& value)
+    void addItem(PassRefPtr<T> value)
     {
-        openAccessors().pushValue(&value.get());
+        ArrayItemHelper<T>::Traits::pushRefPtr(this->openAccessors(), value);
     }
 
-    void addItem(RefPtr<T>&& value)
+    void addItem(T value)
     {
-        openAccessors().pushValue(WTF::move(value));
-    }
-    
-    void addItem(const String& value)
-    {
-        openAccessors().pushString(value);
+        ArrayItemHelper<T>::Traits::pushRaw(this->openAccessors(), value);
     }
 
-    void addItem(int value)
+    static PassRefPtr<Array<T>> create()
     {
-        openAccessors().pushInteger(value);
+        return adoptRef(new Array<T>());
     }
-    
-    static Ref<Array<T>> create()
+};
+
+struct StructItemTraits {
+    static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
     {
-        return adoptRef(*new Array<T>());
+        array->pushValue(value);
     }
 };
 
+template<>
+struct ArrayItemHelper<String> {
+    struct Traits {
+        static void pushRaw(InspectorArray* array, const String& value)
+        {
+            array->pushString(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<int> {
+    struct Traits {
+        static void pushRaw(InspectorArray* array, int value)
+        {
+            array->pushInteger(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<double> {
+    struct Traits {
+        static void pushRaw(InspectorArray* array, double value)
+        {
+            array->pushDouble(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<bool> {
+    struct Traits {
+        static void pushRaw(InspectorArray* array, bool value)
+        {
+            array->pushBoolean(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<InspectorValue> {
+    struct Traits {
+        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
+        {
+            array->pushValue(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<InspectorObject> {
+    struct Traits {
+        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
+        {
+            array->pushValue(value);
+        }
+    };
+};
+
+template<>
+struct ArrayItemHelper<InspectorArray> {
+    struct Traits {
+        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorArray> value)
+        {
+            array->pushArray(value);
+        }
+    };
+};
+
+template<typename T>
+struct ArrayItemHelper<Protocol::Array<T>> {
+    struct Traits {
+        static void pushRefPtr(InspectorArray* array, PassRefPtr<Protocol::Array<T>> value)
+        {
+            array->pushValue(value);
+        }
+    };
+};
+
 // Helper methods for Protocol and other Inspector types are provided by
 // specializations of BindingTraits<T>. Some are generated for protocol types.
 
@@ -109,9 +192,8 @@ template<typename T>
 struct BindingTraits {
     typedef T BindingType;
 
-    static void push(InspectorArray&, BindingType&);
     static InspectorValue::Type typeTag();
-    static RefPtr<T> runtimeCast(RefPtr<InspectorObject>&&);
+    static PassRefPtr<T> runtimeCast(PassRefPtr<InspectorObject>);
 #if !ASSERT_DISABLED
     static void assertValueHasExpectedType(InspectorValue*);
 #endif // !ASSERT_DISABLED
@@ -122,16 +204,15 @@ struct PrimitiveBindingTraits {
 #if !ASSERT_DISABLED
     static void assertValueHasExpectedType(InspectorValue* value)
     {
-        ASSERT_ARG(value, value && value->type() == TYPE);
+        ASSERT(value->type() == TYPE);
     }
 #endif // !ASSERT_DISABLED
 };
 
 template<typename T>
 struct BindingTraits<Protocol::Array<T>> {
-    static RefPtr<Array<T>> runtimeCast(RefPtr<InspectorValue>&& value)
+    static PassRefPtr<Array<T>> runtimeCast(PassRefPtr<InspectorValue> value)
     {
-        ASSERT_ARG(value, value);
         RefPtr<InspectorArray> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
@@ -145,7 +226,6 @@ struct BindingTraits<Protocol::Array<T>> {
 #if !ASSERT_DISABLED
     static void assertValueHasExpectedType(InspectorValue* value)
     {
-        ASSERT_ARG(value, value);
         RefPtr<InspectorArray> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
index 42a6b5f..2a2a0bc 100644 (file)
@@ -347,7 +347,7 @@ bool decodeString(const UChar* start, const UChar* end, String& output)
     return true;
 }
 
-RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
+PassRefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
 {
     if (depth > stackLimit)
         return nullptr;
@@ -385,14 +385,14 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
         break;
     }
     case ARRAY_BEGIN: {
-        Ref<InspectorArray> array = InspectorArray::create();
+        RefPtr<InspectorArray> array = InspectorArray::create();
         start = tokenEnd;
         token = parseToken(start, end, &tokenStart, &tokenEnd);
         while (token != ARRAY_END) {
             RefPtr<InspectorValue> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
             if (!arrayNode)
                 return nullptr;
-            array->pushValue(WTF::move(arrayNode));
+            array->pushValue(arrayNode);
 
             // After a list value, we expect a comma or the end of the list.
             start = tokenEnd;
@@ -409,11 +409,11 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
         }
         if (token != ARRAY_END)
             return nullptr;
-        result = WTF::move(array);
+        result = array.release();
         break;
     }
     case OBJECT_BEGIN: {
-        Ref<InspectorObject> object = InspectorObject::create();
+        RefPtr<InspectorObject> object = InspectorObject::create();
         start = tokenEnd;
         token = parseToken(start, end, &tokenStart, &tokenEnd);
         while (token != OBJECT_END) {
@@ -432,7 +432,7 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
             RefPtr<InspectorValue> value = buildValue(start, end, &tokenEnd, depth + 1);
             if (!value)
                 return nullptr;
-            object->setValue(key, WTF::move(value));
+            object->setValue(key, value);
             start = tokenEnd;
 
             // After a key/value pair, we expect a comma or the end of the
@@ -450,7 +450,7 @@ RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UC
         }
         if (token != OBJECT_END)
             return nullptr;
-        result = WTF::move(object);
+        result = object.release();
         break;
     }
 
@@ -739,8 +739,8 @@ InspectorObject* InspectorObjectBase::openAccessors()
 
 bool InspectorObjectBase::getBoolean(const String& name, bool& output) const
 {
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
+    RefPtr<InspectorValue> value = get(name);
+    if (!value)
         return false;
 
     return value->asBoolean(output);
@@ -748,39 +748,40 @@ bool InspectorObjectBase::getBoolean(const String& name, bool& output) const
 
 bool InspectorObjectBase::getString(const String& name, String& output) const
 {
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
+    RefPtr<InspectorValue> value = get(name);
+    if (!value)
         return false;
-
     return value->asString(output);
 }
 
-bool InspectorObjectBase::getObject(const String& name, RefPtr<InspectorObject>& output) const
+PassRefPtr<InspectorObject> InspectorObjectBase::getObject(const String& name) const
 {
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
+    PassRefPtr<InspectorValue> value = get(name);
+    if (!value)
+        return nullptr;
 
-    return value->asObject(output);
+    RefPtr<InspectorObject> result;
+    value->asObject(result);
+    return result.release();
 }
 
-bool InspectorObjectBase::getArray(const String& name, RefPtr<InspectorArray>& output) const
+PassRefPtr<InspectorArray> InspectorObjectBase::getArray(const String& name) const
 {
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
+    PassRefPtr<InspectorValue> value = get(name);
+    if (!value)
+        return nullptr;
 
-    return value->asArray(output);
+    RefPtr<InspectorArray> result;
+    value->asArray(result);
+    return result.release();
 }
 
-bool InspectorObjectBase::getValue(const String& name, RefPtr<InspectorValue>& output) const
+PassRefPtr<InspectorValue> InspectorObjectBase::get(const String& name) const
 {
-    Dictionary::const_iterator findResult = m_data.find(name);
-    if (findResult == m_data.end())
-        return false;
-
-    output = findResult->value;
-    return true;
+    Dictionary::const_iterator it = m_data.find(name);
+    if (it == m_data.end())
+        return nullptr;
+    return it->value;
 }
 
 void InspectorObjectBase::remove(const String& name)
@@ -798,13 +799,13 @@ void InspectorObjectBase::writeJSON(StringBuilder& output) const
 {
     output.append('{');
     for (size_t i = 0; i < m_order.size(); ++i) {
-        auto findResult = m_data.find(m_order[i]);
-        ASSERT(findResult != m_data.end());
+        Dictionary::const_iterator it = m_data.find(m_order[i]);
+        ASSERT(it != m_data.end());
         if (i)
             output.append(',');
-        doubleQuoteString(findResult->key, output);
+        doubleQuoteString(it->key, output);
         output.append(':');
-        findResult->value->writeJSON(output);
+        it->value->writeJSON(output);
     }
     output.append('}');
 }
@@ -844,50 +845,50 @@ InspectorArrayBase::InspectorArrayBase()
 {
 }
 
-RefPtr<InspectorValue> InspectorArrayBase::get(size_t index)
+PassRefPtr<InspectorValue> InspectorArrayBase::get(size_t index)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(index < m_data.size());
     return m_data[index];
 }
 
-Ref<InspectorObject> InspectorObject::create()
+PassRefPtr<InspectorObject> InspectorObject::create()
 {
-    return adoptRef(*new InspectorObject);
+    return adoptRef(new InspectorObject);
 }
 
-Ref<InspectorArray> InspectorArray::create()
+PassRefPtr<InspectorArray> InspectorArray::create()
 {
-    return adoptRef(*new InspectorArray);
+    return adoptRef(new InspectorArray);
 }
 
-Ref<InspectorValue> InspectorValue::null()
+PassRefPtr<InspectorValue> InspectorValue::null()
 {
-    return adoptRef(*new InspectorValue);
+    return adoptRef(new InspectorValue);
 }
 
-Ref<InspectorString> InspectorString::create(const String& value)
+PassRefPtr<InspectorString> InspectorString::create(const String& value)
 {
-    return adoptRef(*new InspectorString(value));
+    return adoptRef(new InspectorString(value));
 }
 
-Ref<InspectorString> InspectorString::create(const char* value)
+PassRefPtr<InspectorString> InspectorString::create(const char* value)
 {
-    return adoptRef(*new InspectorString(value));
+    return adoptRef(new InspectorString(value));
 }
 
-Ref<InspectorBasicValue> InspectorBasicValue::create(bool value)
+PassRefPtr<InspectorBasicValue> InspectorBasicValue::create(bool value)
 {
-    return adoptRef(*new InspectorBasicValue(value));
+    return adoptRef(new InspectorBasicValue(value));
 }
 
-Ref<InspectorBasicValue> InspectorBasicValue::create(int value)
+PassRefPtr<InspectorBasicValue> InspectorBasicValue::create(int value)
 {
-    return adoptRef(*new InspectorBasicValue(value));
+    return adoptRef(new InspectorBasicValue(value));
 }
 
-Ref<InspectorBasicValue> InspectorBasicValue::create(double value)
+PassRefPtr<InspectorBasicValue> InspectorBasicValue::create(double value)
 {
-    return adoptRef(*new InspectorBasicValue(value));
+    return adoptRef(new InspectorBasicValue(value));
 }
 
 } // namespace Inspector
index baffcb0..296af7d 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef InspectorValues_h
 #define InspectorValues_h
 
-#include <wtf/Assertions.h>
+#include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
@@ -54,7 +54,7 @@ public:
         : m_type(Type::Null) { }
     virtual ~InspectorValue() { }
 
-    static Ref<InspectorValue> null();
+    static PassRefPtr<InspectorValue> null();
 
     enum class Type {
         Null = 0,
@@ -99,9 +99,9 @@ private:
 class JS_EXPORT_PRIVATE InspectorBasicValue : public InspectorValue {
 public:
 
-    static Ref<InspectorBasicValue> create(bool);
-    static Ref<InspectorBasicValue> create(int);
-    static Ref<InspectorBasicValue> create(double);
+    static PassRefPtr<InspectorBasicValue> create(bool);
+    static PassRefPtr<InspectorBasicValue> create(int);
+    static PassRefPtr<InspectorBasicValue> create(double);
 
     virtual bool asBoolean(bool&) const override;
     // Numbers from the frontend are always parsed as doubles, so we allow
@@ -138,8 +138,8 @@ private:
 
 class JS_EXPORT_PRIVATE InspectorString : public InspectorValue {
 public:
-    static Ref<InspectorString> create(const String&);
-    static Ref<InspectorString> create(const char*);
+    static PassRefPtr<InspectorString> create(const String&);
+    static PassRefPtr<InspectorString> create(const char*);
 
     virtual bool asString(String& output) const override;
 
@@ -177,9 +177,9 @@ protected:
     void setInteger(const String& name, int);
     void setDouble(const String& name, double);
     void setString(const String& name, const String&);
-    void setValue(const String& name, RefPtr<InspectorValue>&&);
-    void setObject(const String& name, RefPtr<InspectorObjectBase>&&);
-    void setArray(const String& name, RefPtr<InspectorArrayBase>&&);
+    void setValue(const String& name, PassRefPtr<InspectorValue>);
+    void setObject(const String& name, PassRefPtr<InspectorObjectBase>);
+    void setArray(const String& name, PassRefPtr<InspectorArrayBase>);
 
     iterator find(const String& name);
     const_iterator find(const String& name) const;
@@ -188,25 +188,23 @@ protected:
     bool getBoolean(const String& name, bool& output) const;
     template<class T> bool getDouble(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value;
-        if (!getValue(name, value))
+        RefPtr<InspectorValue> value = get(name);
+        if (!value)
             return false;
-
         return value->asDouble(output);
     }
     template<class T> bool getInteger(const String& name, T& output) const
     {
-        RefPtr<InspectorValue> value;
-        if (!getValue(name, value))
+        RefPtr<InspectorValue> value = get(name);
+        if (!value)
             return false;
-
         return value->asInteger(output);
     }
 
     bool getString(const String& name, String& output) const;
-    bool getObject(const String& name, RefPtr<InspectorObject>&) const;
-    bool getArray(const String& name, RefPtr<InspectorArray>&) const;
-    bool getValue(const String& name, RefPtr<InspectorValue>&) const;
+    PassRefPtr<InspectorObject> getObject(const String& name) const;
+    PassRefPtr<InspectorArray> getArray(const String& name) const;
+    PassRefPtr<InspectorValue> get(const String& name) const;
 
     void remove(const String& name);
 
@@ -229,7 +227,7 @@ private:
 
 class InspectorObject : public InspectorObjectBase {
 public:
-    static JS_EXPORT_PRIVATE Ref<InspectorObject> create();
+    static JS_EXPORT_PRIVATE PassRefPtr<InspectorObject> create();
 
     using InspectorObjectBase::asObject;
 
@@ -248,7 +246,7 @@ public:
     using InspectorObjectBase::getString;
     using InspectorObjectBase::getObject;
     using InspectorObjectBase::getArray;
-    using InspectorObjectBase::getValue;
+    using InspectorObjectBase::get;
 
     using InspectorObjectBase::remove;
 
@@ -275,11 +273,11 @@ protected:
     void pushInteger(int);
     void pushDouble(double);
     void pushString(const String&);
-    void pushValue(RefPtr<InspectorValue>&&);
-    void pushObject(RefPtr<InspectorObjectBase>&&);
-    void pushArray(RefPtr<InspectorArrayBase>&&);
+    void pushValue(PassRefPtr<InspectorValue>);
+    void pushObject(PassRefPtr<InspectorObject>);
+    void pushArray(PassRefPtr<InspectorArray>);
 
-    RefPtr<InspectorValue> get(size_t index);
+    PassRefPtr<InspectorValue> get(size_t index);
 
     virtual void writeJSON(StringBuilder& output) const override;
 
@@ -297,7 +295,7 @@ private:
 
 class InspectorArray : public InspectorArrayBase {
 public:
-    static JS_EXPORT_PRIVATE Ref<InspectorArray> create();
+    static JS_EXPORT_PRIVATE PassRefPtr<InspectorArray> create();
 
     using InspectorArrayBase::asArray;
 
@@ -346,24 +344,24 @@ inline void InspectorObjectBase::setString(const String& name, const String& val
     setValue(name, InspectorString::create(value));
 }
 
-inline void InspectorObjectBase::setValue(const String& name, RefPtr<InspectorValue>&& value)
+inline void InspectorObjectBase::setValue(const String& name, PassRefPtr<InspectorValue> value)
 {
     ASSERT(value);
-    if (m_data.set(name, WTF::move(value)).isNewEntry)
+    if (m_data.set(name, value).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setObject(const String& name, RefPtr<InspectorObjectBase>&& value)
+inline void InspectorObjectBase::setObject(const String& name, PassRefPtr<InspectorObjectBase> value)
 {
     ASSERT(value);
-    if (m_data.set(name, WTF::move(value)).isNewEntry)
+    if (m_data.set(name, value).isNewEntry)
         m_order.append(name);
 }
 
-inline void InspectorObjectBase::setArray(const String& name, RefPtr<InspectorArrayBase>&& value)
+inline void InspectorObjectBase::setArray(const String& name, PassRefPtr<InspectorArrayBase> value)
 {
     ASSERT(value);
-    if (m_data.set(name, WTF::move(value)).isNewEntry)
+    if (m_data.set(name, value).isNewEntry)
         m_order.append(name);
 }
 
@@ -387,22 +385,22 @@ inline void InspectorArrayBase::pushString(const String& value)
     m_data.append(InspectorString::create(value));
 }
 
-inline void InspectorArrayBase::pushValue(RefPtr<InspectorValue>&& value)
+inline void InspectorArrayBase::pushValue(PassRefPtr<InspectorValue> value)
 {
     ASSERT(value);
-    m_data.append(WTF::move(value));
+    m_data.append(value);
 }
 
-inline void InspectorArrayBase::pushObject(RefPtr<InspectorObjectBase>&& value)
+inline void InspectorArrayBase::pushObject(PassRefPtr<InspectorObject> value)
 {
     ASSERT(value);
-    m_data.append(WTF::move(value));
+    m_data.append(value);
 }
 
-inline void InspectorArrayBase::pushArray(RefPtr<InspectorArrayBase>&& value)
+inline void InspectorArrayBase::pushArray(PassRefPtr<InspectorArray> value)
 {
     ASSERT(value);
-    m_data.append(WTF::move(value));
+    m_data.append(value);
 }
 
 } // namespace Inspector
index a7fb104..500afe2 100644 (file)
@@ -75,18 +75,19 @@ JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent*
     });
 }
 
-void JSGlobalObjectConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void JSGlobalObjectConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, PassRefPtr<ScriptArguments> prpArguments)
 {
+    RefPtr<ScriptArguments> arguments = prpArguments;
 
     if (JSGlobalObjectConsoleClient::logToSystemConsole())
-        ConsoleClient::printConsoleMessageWithArguments(MessageSource::ConsoleAPI, type, level, exec, arguments.copyRef());
+        ConsoleClient::printConsoleMessageWithArguments(MessageSource::ConsoleAPI, type, level, exec, arguments);
 
     String message;
     arguments->getFirstArgumentAsString(message);
-    m_consoleAgent->addMessageToConsole(MessageSource::ConsoleAPI, type, level, message, exec, WTF::move(arguments));
+    m_consoleAgent->addMessageToConsole(MessageSource::ConsoleAPI, type, level, message, exec, arguments.release());
 }
 
-void JSGlobalObjectConsoleClient::count(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void JSGlobalObjectConsoleClient::count(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
     m_consoleAgent->count(exec, arguments);
 }
@@ -109,10 +110,10 @@ void JSGlobalObjectConsoleClient::time(ExecState*, const String& title)
 void JSGlobalObjectConsoleClient::timeEnd(ExecState* exec, const String& title)
 {
     RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(exec, 1));
-    m_consoleAgent->stopTiming(title, WTF::move(callStack));
+    m_consoleAgent->stopTiming(title, callStack.release());
 }
 
-void JSGlobalObjectConsoleClient::timeStamp(ExecState*, RefPtr<ScriptArguments>&&)
+void JSGlobalObjectConsoleClient::timeStamp(ExecState*, PassRefPtr<ScriptArguments>)
 {
     // FIXME: JSContext inspection needs a timeline.
     warnUnimplemented(ASCIILiteral("console.timeStamp"));
index e35e9b6..f4ab91e 100644 (file)
@@ -43,17 +43,17 @@ public:
     static void initializeLogToSystemConsole();
 
 protected:
-    virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
-    virtual void count(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
+    virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, PassRefPtr<ScriptArguments>) override;
+    virtual void count(JSC::ExecState*, PassRefPtr<ScriptArguments>) override;
     virtual void profile(JSC::ExecState*, const String& title) override;
     virtual void profileEnd(JSC::ExecState*, const String& title) override;
     virtual void time(JSC::ExecState*, const String& title) override;
     virtual void timeEnd(JSC::ExecState*, const String& title) override;
-    virtual void timeStamp(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
+    virtual void timeStamp(JSC::ExecState*, PassRefPtr<ScriptArguments>) override;
 
 private:
     void warnUnimplemented(const String& method);
-    void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&);
+    void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, PassRefPtr<ScriptArguments>);
 
     InspectorConsoleAgent* m_consoleAgent;
 };
index b8adecb..bc8c4b1 100644 (file)
@@ -222,9 +222,9 @@ void JSGlobalObjectInspectorController::frontendInitialized()
 #endif
 }
 
-Ref<Stopwatch> JSGlobalObjectInspectorController::executionStopwatch()
+PassRefPtr<Stopwatch> JSGlobalObjectInspectorController::executionStopwatch()
 {
-    return m_executionStopwatch.copyRef();
+    return m_executionStopwatch;
 }
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
index 2a02184..a60d47b 100644 (file)
@@ -93,7 +93,7 @@ public:
     virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String&, int) override { }
     virtual void didCallInjectedScriptFunction(JSC::ExecState*) override { }
     virtual void frontendInitialized() override;
-    virtual Ref<WTF::Stopwatch> executionStopwatch() override;
+    virtual PassRefPtr<WTF::Stopwatch> executionStopwatch() override;
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     virtual AugmentableInspectorControllerClient* augmentableInspectorControllerClient() const override { return m_augmentingClient; } 
@@ -115,7 +115,7 @@ private:
     InspectorAgentRegistry m_agents;
     InspectorFrontendChannel* m_inspectorFrontendChannel;
     RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
-    Ref<WTF::Stopwatch> m_executionStopwatch;
+    RefPtr<WTF::Stopwatch> m_executionStopwatch;
     bool m_includeNativeCallStackWithExceptions;
     bool m_isAutomaticInspection;
 
index 28c2af7..7c950e8 100644 (file)
@@ -58,7 +58,7 @@ bool ScriptCallFrame::isEqual(const ScriptCallFrame& o) const
 }
 
 #if ENABLE(INSPECTOR)
-Ref<Inspector::Protocol::Console::CallFrame> ScriptCallFrame::buildInspectorObject() const
+PassRefPtr<Inspector::Protocol::Console::CallFrame> ScriptCallFrame::buildInspectorObject() const
 {
     return Inspector::Protocol::Console::CallFrame::create()
         .setFunctionName(m_functionName)
index 017ddd0..6a9cd77 100644 (file)
@@ -54,7 +54,7 @@ public:
     bool isEqual(const ScriptCallFrame&) const;
 
 #if ENABLE(INSPECTOR)
-    Ref<Inspector::Protocol::Console::CallFrame> buildInspectorObject() const;
+    PassRefPtr<Inspector::Protocol::Console::CallFrame> buildInspectorObject() const;
 #endif
 
 private:
index aa452ad..6f81a58 100644 (file)
 
 namespace Inspector {
 
-Ref<ScriptCallStack> ScriptCallStack::create()
+PassRefPtr<ScriptCallStack> ScriptCallStack::create()
 {
-    return adoptRef(*new ScriptCallStack);
+    return adoptRef(new ScriptCallStack);
 }
 
-Ref<ScriptCallStack> ScriptCallStack::create(Vector<ScriptCallFrame>& frames)
+PassRefPtr<ScriptCallStack> ScriptCallStack::create(Vector<ScriptCallFrame>& frames)
 {
-    return adoptRef(*new ScriptCallStack(frames));
+    return adoptRef(new ScriptCallStack(frames));
 }
 
 ScriptCallStack::ScriptCallStack()
@@ -107,12 +107,12 @@ bool ScriptCallStack::isEqual(ScriptCallStack* o) const
 }
 
 #if ENABLE(INSPECTOR)
-Ref<Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>> ScriptCallStack::buildInspectorArray() const
+PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>> ScriptCallStack::buildInspectorArray() const
 {
-    auto frames = Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>::create();
+    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>> frames = Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>::create();
     for (size_t i = 0; i < m_frames.size(); i++)
         frames->addItem(m_frames.at(i).buildInspectorObject());
-    return WTF::move(frames);
+    return frames;
 }
 #endif
 
index 6db7de8..63e3ce1 100644 (file)
@@ -47,8 +47,8 @@ class JS_EXPORT_PRIVATE ScriptCallStack : public RefCounted<ScriptCallStack> {
 public:
     static const size_t maxCallStackSizeToCapture = 200;
     
-    static Ref<ScriptCallStack> create();
-    static Ref<ScriptCallStack> create(Vector<ScriptCallFrame>&);
+    static PassRefPtr<ScriptCallStack> create();
+    static PassRefPtr<ScriptCallStack> create(Vector<ScriptCallFrame>&);
 
     ~ScriptCallStack();
 
@@ -62,7 +62,7 @@ public:
     bool isEqual(ScriptCallStack*) const;
 
 #if ENABLE(INSPECTOR)
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>> buildInspectorArray() const;
+    PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Console::CallFrame>> buildInspectorArray() const;
 #endif
 
 private:
index 4f695a7..765af99 100644 (file)
@@ -72,7 +72,7 @@ void InspectorAgent::enable(ErrorString&)
     m_enabled = true;
 
     if (m_pendingInspectData.first)
-        inspect(m_pendingInspectData.first.copyRef(), m_pendingInspectData.second.copyRef());
+        inspect(m_pendingInspectData.first, m_pendingInspectData.second);
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_pendingExtraDomainsData)
@@ -99,7 +99,7 @@ void InspectorAgent::initialized(ErrorString&)
     m_environment.frontendInitialized();
 }
 
-void InspectorAgent::inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints)
+void InspectorAgent::inspect(PassRefPtr<Protocol::Runtime::RemoteObject> objectToInspect, PassRefPtr<InspectorObject> hints)
 {
     if (m_enabled && m_frontendDispatcher) {
         m_frontendDispatcher->inspect(objectToInspect, hints);
@@ -130,9 +130,9 @@ void InspectorAgent::activateExtraDomain(const String& domainName)
         return;
     }
 
-    Ref<Inspector::Protocol::Array<String>> domainNames = Inspector::Protocol::Array<String>::create();
+    RefPtr<Inspector::Protocol::Array<String>> domainNames = Inspector::Protocol::Array<String>::create();
     domainNames->addItem(domainName);
-    m_frontendDispatcher->activateExtraDomains(WTF::move(domainNames));
+    m_frontendDispatcher->activateExtraDomains(domainNames.release());
 }
 
 void InspectorAgent::activateExtraDomains(const Vector<String>& extraDomains)
index 730dce6..c90e242 100644 (file)
@@ -61,7 +61,7 @@ public:
     virtual void disable(ErrorString&) override;
     virtual void initialized(ErrorString&) override;
 
-    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints);
+    void inspect(PassRefPtr<Protocol::Runtime::RemoteObject> objectToInspect, PassRefPtr<InspectorObject> hints);
     void evaluateForTestInFrontend(const String& script);
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
index 03bd48a..47abdfd 100644 (file)
@@ -141,16 +141,16 @@ bool InspectorDebuggerAgent::isPaused()
 void InspectorDebuggerAgent::handleConsoleAssert(const String& message)
 {
     if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions) {
-        Ref<Inspector::Protocol::Debugger::AssertPauseReason> reason = Inspector::Protocol::Debugger::AssertPauseReason::create().release();
+        RefPtr<Inspector::Protocol::Debugger::AssertPauseReason> reason = Inspector::Protocol::Debugger::AssertPauseReason::create();
         if (!message.isNull())
             reason->setMessage(message);
         breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Assert, reason->openAccessors());
     }
 }
 
-static Ref<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
+static PassRefPtr<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
 {
-    Ref<InspectorObject> breakpointObject = InspectorObject::create();
+    RefPtr<InspectorObject> breakpointObject = InspectorObject::create();
     breakpointObject->setString(ASCIILiteral("url"), url);
     breakpointObject->setInteger(ASCIILiteral("lineNumber"), lineNumber);
     breakpointObject->setInteger(ASCIILiteral("columnNumber"), columnNumber);
@@ -239,7 +239,7 @@ bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorStr
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const RefPtr<InspectorObject>&& options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const RefPtr<InspectorObject>* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
 {
     locations = Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>::create();
     if (!optionalURL == !optionalURLRegex) {
@@ -261,9 +261,9 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int li
     bool autoContinue = false;
     RefPtr<InspectorArray> actions;
     if (options) {
-        options->getString(ASCIILiteral("condition"), condition);
-        options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
-        options->getArray(ASCIILiteral("actions"), actions);
+        (*options)->getString(ASCIILiteral("condition"), condition);
+        (*options)->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
+        actions = (*options)->getArray(ASCIILiteral("actions"));
     }
 
     BreakpointActions breakpointActions;
@@ -280,7 +280,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int li
 
         RefPtr<Inspector::Protocol::Debugger::Location> location = resolveBreakpoint(breakpointIdentifier, it->key, breakpoint);
         if (location)
-            locations->addItem(WTF::move(location));
+            locations->addItem(location);
     }
     *outBreakpointIdentifier = breakpointIdentifier;
 }
@@ -300,7 +300,7 @@ static bool parseLocation(ErrorString& errorString, InspectorObject& location, J
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const RefPtr<InspectorObject>&& location, const RefPtr<InspectorObject>&& options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
+void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const RefPtr<InspectorObject>& location, const RefPtr<InspectorObject>* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
 {
     JSC::SourceID sourceID;
     unsigned lineNumber;
@@ -312,9 +312,9 @@ void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const RefPt
     bool autoContinue = false;
     RefPtr<InspectorArray> actions;
     if (options) {
-        options->getString(ASCIILiteral("condition"), condition);
-        options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
-        options->getArray(ASCIILiteral("actions"), actions);
+        (*options)->getString(ASCIILiteral("condition"), condition);
+        (*options)->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
+        actions = (*options)->getArray(ASCIILiteral("actions"));
     }
 
     BreakpointActions breakpointActions;
@@ -350,7 +350,7 @@ void InspectorDebuggerAgent::removeBreakpoint(ErrorString&, const String& breakp
     }
 }
 
-void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const RefPtr<InspectorObject>&& location)
+void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const RefPtr<InspectorObject>& location)
 {
     if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
         scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
@@ -368,7 +368,7 @@ void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const
     resume(errorString);
 }
 
-RefPtr<Inspector::Protocol::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID sourceID, const ScriptBreakpoint& breakpoint)
+PassRefPtr<Inspector::Protocol::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID sourceID, const ScriptBreakpoint& breakpoint)
 {
     ScriptsMap::iterator scriptIterator = m_scripts.find(sourceID);
     if (scriptIterator == m_scripts.end())
@@ -388,12 +388,11 @@ RefPtr<Inspector::Protocol::Debugger::Location> InspectorDebuggerAgent::resolveB
         debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.set(breakpointIdentifier, Vector<JSC::BreakpointID>()).iterator;
     debugServerBreakpointIDsIterator->value.append(debugServerBreakpointID);
 
-    auto location = Inspector::Protocol::Debugger::Location::create()
+    RefPtr<Inspector::Protocol::Debugger::Location> location = Inspector::Protocol::Debugger::Location::create()
         .setScriptId(String::number(sourceID))
-        .setLineNumber(actualLineNumber)
-        .release();
+        .setLineNumber(actualLineNumber);
     location->setColumnNumber(actualColumnNumber);
-    return WTF::move(location);
+    return location;
 }
 
 void InspectorDebuggerAgent::searchInContent(ErrorString& error, const String& scriptIDStr, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
@@ -431,13 +430,13 @@ void InspectorDebuggerAgent::getFunctionDetails(ErrorString& errorString, const
     injectedScript.getFunctionDetails(errorString, functionId, &details);
 }
 
-void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr<InspectorObject> data)
 {
     if (m_javaScriptPauseScheduled)
         return;
 
     m_breakReason = breakReason;
-    m_breakAuxData = WTF::move(data);
+    m_breakAuxData = data;
     scriptDebugServer().setPauseOnNextStatement(true);
 }
 
@@ -545,14 +544,12 @@ void InspectorDebuggerAgent::setOverlayMessage(ErrorString&, const String*)
 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
 {
     if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions) {
-        auto reason = Inspector::Protocol::Debugger::CSPViolationPauseReason::create()
-            .setDirective(directiveText)
-            .release();
+        RefPtr<Inspector::Protocol::Debugger::CSPViolationPauseReason> reason = Inspector::Protocol::Debugger::CSPViolationPauseReason::create().setDirective(directiveText);
         breakProgram(InspectorDebuggerFrontendDispatcher::Reason::CSPViolation, reason->openAccessors());
     }
 }
 
-Ref<Inspector::Protocol::Array<Inspector::Protocol::Debugger::CallFrame>> InspectorDebuggerAgent::currentCallFrames()
+PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::CallFrame>> InspectorDebuggerAgent::currentCallFrames()
 {
     if (!m_pausedScriptState)
         return Inspector::Protocol::Array<Inspector::Protocol::Debugger::CallFrame>::create();
@@ -609,8 +606,7 @@ void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script
         breakpointObject->getString(ASCIILiteral("condition"), breakpoint.condition);
         breakpointObject->getBoolean(ASCIILiteral("autoContinue"), breakpoint.autoContinue);
         ErrorString errorString;
-        RefPtr<InspectorArray> actions;
-        breakpointObject->getArray(ASCIILiteral("actions"), actions);
+        RefPtr<InspectorArray> actions = breakpointObject->getArray(ASCIILiteral("actions"));
         if (!breakpointActionsFromProtocol(errorString, actions, &breakpoint.actions)) {
             ASSERT_NOT_REACHED();
             continue;
@@ -669,15 +665,14 @@ void InspectorDebuggerAgent::breakpointActionProbe(JSC::ExecState* scriptState,
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
     RefPtr<Protocol::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(action));
-    auto result = Protocol::Debugger::ProbeSample::create()
+    RefPtr<Protocol::Debugger::ProbeSample> result = Protocol::Debugger::ProbeSample::create()
         .setProbeId(action.identifier)
         .setBatchId(batchId)
         .setSampleId(sampleId)
         .setTimestamp(m_injectedScriptManager->inspectorEnvironment().executionStopwatch()->elapsedTime())
-        .setPayload(payload.release())
-        .release();
+        .setPayload(payload.release());
 
-    m_frontendDispatcher->didSampleProbe(WTF::move(result));
+    m_frontendDispatcher->didSampleProbe(result.release());
 }
 
 void InspectorDebuggerAgent::didContinue()
@@ -692,10 +687,10 @@ void InspectorDebuggerAgent::didContinue()
     m_frontendDispatcher->resumed();
 }
 
-void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr<InspectorObject> data)
 {
     m_breakReason = breakReason;
-    m_breakAuxData = WTF::move(data);
+    m_breakAuxData = data;
     scriptDebugServer().breakProgram();
 }
 
index 9a74cc5..0ae7331 100644 (file)
@@ -42,6 +42,7 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/StringHash.h>
 
@@ -73,10 +74,10 @@ public:
     virtual void enable(ErrorString&) override;
     virtual void disable(ErrorString&) override;
     virtual void setBreakpointsActive(ErrorString&, bool active) override;
-    virtual void setBreakpointByUrl(ErrorString&, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const RefPtr<Inspector::InspectorObject>&& options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) override;
-    virtual void setBreakpoint(ErrorString&, const RefPtr<Inspector::InspectorObject>&& location, const RefPtr<Inspector::InspectorObject>&& options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) override;
+    virtual void setBreakpointByUrl(ErrorString&, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const RefPtr<Inspector::InspectorObject>* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) override;
+    virtual void setBreakpoint(ErrorString&, const RefPtr<Inspector::InspectorObject>& location, const RefPtr<Inspector::InspectorObject>* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) override;
     virtual void removeBreakpoint(ErrorString&, const String& breakpointIdentifier) override;
-    virtual void continueToLocation(ErrorString&, const RefPtr<InspectorObject>&& location) override;
+    virtual void continueToLocation(ErrorString&, const RefPtr<InspectorObject>& location) override;
     virtual void searchInContent(ErrorString&, const String& scriptID, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) override;
     virtual void getScriptSource(ErrorString&, const String& scriptID, String* scriptSource) override;
     virtual void getFunctionDetails(ErrorString&, const String& functionId, RefPtr<Inspector::Protocol::Debugger::FunctionDetails>&) override;
@@ -93,9 +94,9 @@ public:
     
     void handleConsoleAssert(const String& message);
 
-    void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr<InspectorObject> data);
     void cancelPauseOnNextStatement();
-    void breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr<InspectorObject> data);
     void scriptExecutionBlockedByCSP(const String& directiveText);
 
     class Listener {
@@ -131,7 +132,7 @@ protected:
     void didClearGlobalObject();
 
 private:
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::Debugger::CallFrame>> currentCallFrames();
+    PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::CallFrame>> currentCallFrames();
 
     virtual void didParseSource(JSC::SourceID, const Script&) override final;
     virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) override final;
@@ -139,7 +140,7 @@ private:
     virtual void breakpointActionSound(int breakpointActionIdentifier) override;
     virtual void breakpointActionProbe(JSC::ExecState*, const ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, const Deprecated::ScriptValue& sample) override final;
 
-    RefPtr<Inspector::Protocol::Debugger::Location> resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID, const ScriptBreakpoint&);
+    PassRefPtr<Inspector::Protocol::Debugger::Location> resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID, const ScriptBreakpoint&);
     bool assertPaused(ErrorString&);
     void clearDebuggerBreakpointState();
     void clearInspectorBreakpointState();
index a3941d3..632def3 100644 (file)
@@ -80,12 +80,12 @@ static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(Scrip
     return presentState;
 }
 
-static Ref<Inspector::Protocol::Runtime::ErrorRange> buildErrorRangeObject(const JSTokenLocation& tokenLocation)
+static PassRefPtr<Inspector::Protocol::Runtime::ErrorRange> buildErrorRangeObject(const JSTokenLocation& tokenLocation)
 {
-    return Inspector::Protocol::Runtime::ErrorRange::create()
+    RefPtr<Inspector::Protocol::Runtime::ErrorRange> result = Inspector::Protocol::Runtime::ErrorRange::create()
         .setStartOffset(tokenLocation.startOffset)
-        .setEndOffset(tokenLocation.endOffset)
-        .release();
+        .setEndOffset(tokenLocation.endOffset);
+    return result.release();
 }
 
 void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Inspector::Protocol::Runtime::SyntaxErrorType* result, Inspector::Protocol::OptOutput<String>* message, RefPtr<Inspector::Protocol::Runtime::ErrorRange>& range)
@@ -137,7 +137,7 @@ void InspectorRuntimeAgent::evaluate(ErrorString& errorString, const String& exp
     }
 }
 
-void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>&& optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
+void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     if (injectedScript.hasNoValue()) {
@@ -147,7 +147,7 @@ void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const Strin
 
     String arguments;
     if (optionalArguments)
-        arguments = optionalArguments->toJSONString();
+        arguments = (*optionalArguments)->toJSONString();
 
     ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
     if (asBool(doNotPauseOnExceptionsAndMuteConsole))
@@ -197,7 +197,7 @@ void InspectorRuntimeAgent::run(ErrorString&)
 {
 }
 
-void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const RefPtr<Inspector::InspectorArray>&& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
+void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const RefPtr<Inspector::InspectorArray>& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
 {
     static const bool verbose = false;
     VM& vm = globalVM();
@@ -237,9 +237,8 @@ void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& er
         }
 
         bool isValid = typeLocation && typeSet && !typeSet->isEmpty();
-        auto description = Inspector::Protocol::Runtime::TypeDescription::create()
-            .setIsValid(isValid)
-            .release();
+        RefPtr<Inspector::Protocol::Runtime::TypeDescription> description = Inspector::Protocol::Runtime::TypeDescription::create()
+            .setIsValid(isValid);
 
         if (isValid) {
             description->setLeastCommonAncestor(typeSet->leastCommonAncestor());
@@ -248,7 +247,7 @@ void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& er
             description->setIsTruncated(typeSet->isOverflown());
         }
 
-        typeDescriptions->addItem(WTF::move(description));
+        typeDescriptions->addItem(description);
     }
 
     double end = currentTimeMS();
@@ -332,12 +331,11 @@ void InspectorRuntimeAgent::getBasicBlocks(ErrorString& errorString, const Strin
     const Vector<BasicBlockRange>& basicBlockRanges = vm.controlFlowProfiler()->getBasicBlocksForSourceID(sourceID, vm);
     basicBlocks = Inspector::Protocol::Array<Inspector::Protocol::Runtime::BasicBlock>::create();
     for (const BasicBlockRange& block : basicBlockRanges) {
-        Ref<Inspector::Protocol::Runtime::BasicBlock> location = Inspector::Protocol::Runtime::BasicBlock::create()
+        RefPtr<Inspector::Protocol::Runtime::BasicBlock> location = Inspector::Protocol::Runtime::BasicBlock::create()
             .setStartOffset(block.m_startOffset)
             .setEndOffset(block.m_endOffset)
-            .setHasExecuted(block.m_hasExecuted)
-            .release();
-        basicBlocks->addItem(WTF::move(location));
+            .setHasExecuted(block.m_hasExecuted);
+        basicBlocks->addItem(location);
     }
 }
 
index 2e028a1..e5d73e0 100644 (file)
@@ -63,12 +63,12 @@ public:
     virtual void disable(ErrorString&) override { m_enabled = false; }
     virtual void parse(ErrorString&, const String& expression, Inspector::Protocol::Runtime::SyntaxErrorType* result, Inspector::Protocol::OptOutput<String>* message, RefPtr<Inspector::Protocol::Runtime::ErrorRange>&) override final;
     virtual void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) override final;
-    virtual void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const RefPtr<Inspector::InspectorArray>&& optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) override final;
+    virtual void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const RefPtr<Inspector::InspectorArray>* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) override final;
     virtual void releaseObject(ErrorString&, const ErrorString& objectId) override final;
     virtual void getProperties(ErrorString&, const String& objectId, const bool* ownProperties, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) override final;
     virtual void releaseObjectGroup(ErrorString&, const String& objectGroup) override final;
     virtual void run(ErrorString&) override;
-    virtual void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const RefPtr<Inspector::InspectorArray>&& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
+    virtual void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const RefPtr<Inspector::InspectorArray>& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
     virtual void enableTypeProfiler(ErrorString&) override;
     virtual void disableTypeProfiler(ErrorString&) override;
     virtual void getBasicBlocks(ErrorString&, const String& in_sourceID, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::BasicBlock>>& out_basicBlocks) override;
index ba4910d..a83e2fa 100644 (file)
@@ -116,11 +116,12 @@ class CppGenerator:
         if isinstance(_type, EnumType):
             _type = _type.primitive_type  # Fall through to primitive.
 
+        sigil = '*' if parameter.is_optional else '&'
         # This handles the 'any' type and objects with defined properties.
         if isinstance(_type, ObjectType) or _type.qualified_name() is 'object':
-            return 'const RefPtr<Inspector::InspectorObject>&&'
+            return 'const RefPtr<Inspector::InspectorObject>' + sigil
         if isinstance(_type, ArrayType):
-            return 'const RefPtr<Inspector::InspectorArray>&&'
+            return 'const RefPtr<Inspector::InspectorArray>' + sigil
         if isinstance(_type, PrimitiveType):
             cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
             if parameter.is_optional:
@@ -143,7 +144,7 @@ class CppGenerator:
     @staticmethod
     def cpp_type_for_type_with_name(_type, type_name, is_optional):
         if isinstance(_type, (ArrayType, ObjectType)):
-            return 'RefPtr<%s>' % CppGenerator.cpp_protocol_type_for_type(_type)
+            return 'PassRefPtr<%s>' % CppGenerator.cpp_protocol_type_for_type(_type)
         if isinstance(_type, AliasedType):
             builder_type = CppGenerator.cpp_protocol_type_for_type(_type)
             if is_optional:
@@ -157,9 +158,9 @@ class CppGenerator:
         if isinstance(_type, PrimitiveType):
             cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
             if _type.qualified_name() in ['object']:
-                return 'RefPtr<Inspector::InspectorObject>'
+                return 'PassRefPtr<Inspector::InspectorObject>'
             elif _type.qualified_name() in ['any']:
-                return 'RefPtr<Inspector::InspectorValue>'
+                return 'PassRefPtr<Inspector::InspectorValue>'
             elif is_optional:
                 return 'const %s* const' % cpp_name
             elif _type.qualified_name() in ['string']:
@@ -211,7 +212,7 @@ class CppGenerator:
             _type = _type.primitive_type  # Fall through.
 
         if isinstance(_type, (ObjectType, ArrayType)):
-            return 'RefPtr<%s>&&' % CppGenerator.cpp_protocol_type_for_type(_type)
+            return 'PassRefPtr<%s>' % CppGenerator.cpp_protocol_type_for_type(_type)
         if isinstance(_type, PrimitiveType):
             cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
             if parameter.is_optional:
@@ -296,9 +297,5 @@ class CppGenerator:
         return not isinstance(_type, (ArrayType, ObjectType))
 
     @staticmethod
-    def should_use_references_for_type(_type):
-        return isinstance(_type, (ArrayType, ObjectType)) or (isinstance(_type, (PrimitiveType)) and _type.qualified_name() in ["any", "object"])
-
-    @staticmethod
     def should_pass_by_copy_for_return_type(_type):
         return isinstance(_type, (ArrayType, ObjectType)) or (isinstance(_type, (PrimitiveType)) and _type.qualified_name() == "object")
index 4f3c0c2..e048842 100755 (executable)
@@ -76,10 +76,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 """)
 
@@ -108,11 +108,11 @@ protected:
     BackendDispatcherHeaderDomainDispatcherDeclaration = (
     """${classAndExportMacro} Inspector${domainName}BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<Inspector${domainName}BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, Inspector${domainName}BackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<Inspector${domainName}BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, Inspector${domainName}BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 ${commandDeclarations}
 private:
-    Inspector${domainName}BackendDispatcher(Inspector::InspectorBackendDispatcher&, Inspector${domainName}BackendDispatcherHandler*);
+    Inspector${domainName}BackendDispatcher(Inspector::InspectorBackendDispatcher*, Inspector${domainName}BackendDispatcherHandler*);
     Inspector${domainName}BackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -125,13 +125,13 @@ private:
     BackendDispatcherHeaderAsyncCommandDeclaration = (
     """    ${classAndExportMacro} ${callbackName} : public Inspector::InspectorBackendDispatcher::CallbackBase {
     public:
-        ${callbackName}(Ref<Inspector::InspectorBackendDispatcher>&&, int id);
+        ${callbackName}(PassRefPtr<Inspector::InspectorBackendDispatcher>, int id);
         void sendSuccess(${outParameters});
     };
     virtual void ${commandName}(${inParameters}) = 0;""")
 
     BackendDispatcherImplementationSmallSwitch = (
-    """void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+    """void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<Inspector${domainName}BackendDispatcher> protect(*this);
 
@@ -141,7 +141,7 @@ ${dispatchCases}
 }""")
 
     BackendDispatcherImplementationLargeSwitch = (
-"""void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+"""void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<Inspector${domainName}BackendDispatcher> protect(*this);
 
@@ -166,16 +166,16 @@ ${dispatchCases}
         return;
     }
 
-    ((*this).*it->value)(callId, message.get());
+    ((*this).*it->value)(callId, *message.get());
 }""")
 
     BackendDispatcherImplementationDomainConstructor = (
-    """Ref<Inspector${domainName}BackendDispatcher> Inspector${domainName}BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
+    """PassRefPtr<Inspector${domainName}BackendDispatcher> Inspector${domainName}BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
 {
-    return adoptRef(*new Inspector${domainName}BackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new Inspector${domainName}BackendDispatcher(backendDispatcher, agent));
 }
 
-Inspector${domainName}BackendDispatcher::Inspector${domainName}BackendDispatcher(InspectorBackendDispatcher& backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
+Inspector${domainName}BackendDispatcher::Inspector${domainName}BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -186,25 +186,26 @@ Inspector${domainName}BackendDispatcher::Inspector${domainName}BackendDispatcher
 }""")
 
     BackendDispatcherImplementationPrepareCommandArguments = (
-"""    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
+"""    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
 ${inParameterDeclarations}
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method \'%s\' can't be processed", "${domainName}.${commandName}");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 """)
 
     BackendDispatcherImplementationAsyncCommand = (
-"""Inspector${domainName}BackendDispatcherHandler::${callbackName}::${callbackName}(Ref<InspectorBackendDispatcher>&& backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(WTF::move(backendDispatcher), id) { }
+"""Inspector${domainName}BackendDispatcherHandler::${callbackName}::${callbackName}(PassRefPtr<InspectorBackendDispatcher> backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
 
 void Inspector${domainName}BackendDispatcherHandler::${callbackName}::sendSuccess(${formalParameters})
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
 ${outParameterAssignments}
-    sendIfActive(WTF::move(jsonMessage), ErrorString());
+    sendIfActive(jsonMessage, ErrorString());
 }""")
 
     FrontendDispatcherDomainDispatcherDeclaration = (
@@ -227,23 +228,26 @@ private:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*${objectType}*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*${objectType}*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class ${objectType};
     public:""")
 
     ProtocolObjectBuilderDeclarationPostlude = (
 """
-        Ref<${objectType}> release()
+        operator RefPtr<${objectType}>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(${objectType}) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<${objectType}>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<${objectType}>*>(&result));
+        PassRefPtr<${objectType}> release()
+        {
+            return RefPtr<${objectType}>(*this).release();
         }
     };
 
@@ -254,10 +258,11 @@ ${constructorExample}
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
-    }""")
+    }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;""")
 
     ProtocolObjectRuntimeCast = (
-"""RefPtr<${objectType}> BindingTraits<${objectType}>::runtimeCast(RefPtr<Inspector::InspectorValue>&& value)
+"""PassRefPtr<${objectType}> BindingTraits<${objectType}>::runtimeCast(PassRefPtr<Inspector::InspectorValue> value)
 {
     RefPtr<Inspector::InspectorObject> result;
     bool castSucceeded = value->asObject(result);
index a241c53..1272c00 100755 (executable)
@@ -52,6 +52,7 @@ class CppBackendDispatcherHeaderGenerator(Generator):
         headers = [
             '"InspectorProtocolObjects.h"',
             '<inspector/InspectorBackendDispatcher.h>',
+            '<wtf/PassRefPtr.h>',
             '<wtf/text/WTFString.h>']
 
         typedefs = [('String', 'ErrorString')]
@@ -156,7 +157,7 @@ class CppBackendDispatcherHeaderGenerator(Generator):
         in_parameters = ['ErrorString&']
         for _parameter in command.call_parameters:
             in_parameters.append("%s in_%s" % (CppGenerator.cpp_type_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
-        in_parameters.append("Ref<%s>&& callback" % callbackName)
+        in_parameters.append("PassRefPtr<%s> callback" % callbackName)
 
         out_parameters = []
         for _parameter in command.return_parameters:
index 582de4b..84615dd 100755 (executable)
@@ -104,10 +104,10 @@ class CppBackendDispatcherImplementationGenerator(Generator):
     def _generate_small_dispatcher_switch_implementation_for_domain(self, domain):
         cases = []
         cases.append('    if (method == "%s")' % domain.commands[0].command_name)
-        cases.append('        %s(callId, message);' % domain.commands[0].command_name)
+        cases.append('        %s(callId, *message.get());' % domain.commands[0].command_name)
         for command in domain.commands[1:]:
             cases.append('    else if (method == "%s")' % command.command_name)
-            cases.append('        %s(callId, message);' % command.command_name)
+            cases.append('        %s(callId, *message.get());' % command.command_name)
 
         switch_args = {
             'domainName': domain.domain_name,
@@ -178,29 +178,22 @@ class CppBackendDispatcherImplementationGenerator(Generator):
                 out_success_argument = '&%s_valueFound' % parameter.parameter_name
                 in_parameter_declarations.append('    bool %s_valueFound = false;' % parameter.parameter_name)
 
-            parameter_expression = 'in_' + parameter.parameter_name
-            if CppGenerator.should_use_references_for_type(parameter.type):
-                parameter_expression = '%s.copyRef()' % parameter_expression
-            elif parameter.is_optional:
-                parameter_expression = '&%s' % parameter_expression
-
             param_args = {
                 'parameterType': CppGenerator.cpp_type_for_stack_in_parameter(parameter),
                 'parameterName': parameter.parameter_name,
-                'parameterExpression': parameter_expression,
                 'keyedGetMethod': CppGenerator.cpp_getter_method_for_type(parameter.type),
                 'successOutParam': out_success_argument
             }
 
-            in_parameter_declarations.append('    %(parameterType)s in_%(parameterName)s = InspectorBackendDispatcher::%(keyedGetMethod)s(paramsContainer.get(), ASCIILiteral("%(parameterName)s"), %(successOutParam)s, protocolErrors.get());' % param_args)
+            in_parameter_declarations.append('    %(parameterType)s in_%(parameterName)s = InspectorBackendDispatcher::%(keyedGetMethod)s(paramsContainerPtr, ASCIILiteral("%(parameterName)s"), %(successOutParam)s, protocolErrorsPtr);' % param_args)
 
             if parameter.is_optional:
-                optional_in_parameter_string = '%(parameterName)s_valueFound ? %(parameterExpression)s : nullptr' % param_args
+                optional_in_parameter_string = '%(parameterName)s_valueFound ? &in_%(parameterName)s : nullptr' % param_args
                 alternate_dispatcher_method_parameters.append(optional_in_parameter_string)
                 method_parameters.append(optional_in_parameter_string)
             else:
-                alternate_dispatcher_method_parameters.append(parameter_expression)
-                method_parameters.append(parameter_expression)
+                alternate_dispatcher_method_parameters.append('in_' + parameter.parameter_name)
+                method_parameters.append('in_' + parameter.parameter_name)
 
         if command.is_async:
             async_args = {
@@ -211,7 +204,7 @@ class CppBackendDispatcherImplementationGenerator(Generator):
             out_parameter_assignments.append('        callback->disable();')
             out_parameter_assignments.append('        m_backendDispatcher->reportProtocolError(&callId, Inspector::InspectorBackendDispatcher::ServerError, error);')
             out_parameter_assignments.append('        return;')
-            method_parameters.append('callback.copyRef()')
+            method_parameters.append('callback')
 
         else:
             for parameter in command.return_parameters:
@@ -268,9 +261,9 @@ class CppBackendDispatcherImplementationGenerator(Generator):
         lines.append('')
 
         lines.append('    ErrorString error;')
-        lines.append('    Ref<InspectorObject> result = InspectorObject::create();')
+        lines.append('    RefPtr<InspectorObject> result = InspectorObject::create();')
         if command.is_async:
-            lines.append('    Ref<Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s> callback = adoptRef(*new Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s(m_backendDispatcher.copyRef(), callId));' % command_args)
+            lines.append('    RefPtr<Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s> callback = adoptRef(new Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s(m_backendDispatcher,callId));' % command_args)
         if len(command.return_parameters) > 0:
             lines.extend(out_parameter_declarations)
         lines.append('    m_agent->%(commandName)s(%(invocationParameters)s);' % command_args)
@@ -289,6 +282,6 @@ class CppBackendDispatcherImplementationGenerator(Generator):
             lines.append('')
 
         if not command.is_async:
-            lines.append('    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);')
+            lines.append('    m_backendDispatcher->sendResponse(callId, result.release(), error);')
         lines.append('}')
         return "\n".join(lines)
index ff09ab3..ae04adf 100755 (executable)
@@ -53,6 +53,7 @@ class CppFrontendDispatcherHeaderGenerator(Generator):
             '"InspectorProtocolObjects.h"',
             '<inspector/InspectorFrontendChannel.h>',
             '<inspector/InspectorValues.h>',
+            '<wtf/PassRefPtr.h>',
             '<wtf/text/WTFString.h>']
 
         header_args = {
index 88f58f4..4270b3b 100755 (executable)
@@ -107,13 +107,13 @@ class CppFrontendDispatcherImplementationGenerator(Generator):
 
         lines.append('void Inspector%(domainName)sFrontendDispatcher::%(eventName)s(%(formalParameters)s)' % event_args)
         lines.append('{')
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%(domainName)s.%(eventName)s"));' % event_args)
 
         if len(parameter_assignments) > 0:
-            lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+            lines.append('    RefPtr<InspectorObject> paramsObject = InspectorObject::create();')
             lines.extend(parameter_assignments)
-            lines.append('    jsonMessage->setObject(ASCIILiteral("params"), paramsObject.copyRef());')
+            lines.append('    jsonMessage->setObject(ASCIILiteral("params"), paramsObject);')
 
         lines.append('')
         lines.append('    m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());')
index 9611650..d60c6ad 100755 (executable)
@@ -52,6 +52,7 @@ class CppProtocolTypesHeaderGenerator(Generator):
         headers = set([
             '<inspector/InspectorProtocolTypes.h>',
             '<wtf/Assertions.h>',
+            '<wtf/PassRefPtr.h>'
         ])
 
         export_macro = self.model().framework.setting('export_macro', None)
@@ -194,10 +195,9 @@ class CppProtocolTypesHeaderGenerator(Generator):
         lines.append(self._generate_builder_state_enum(type_declaration))
 
         constructor_example = []
-        constructor_example.append('     * Ref<%s> result = %s::create()' % (object_name, object_name))
+        constructor_example.append('     * RefPtr<%s> result = %s::create()' % (object_name, object_name))
         for member in required_members:
             constructor_example.append('     *     .set%s(...)' % ucfirst(member.member_name))
-        constructor_example.append('     *     .release()')
 
         builder_args = {
             'objectType': object_name,
@@ -302,8 +302,6 @@ class CppProtocolTypesHeaderGenerator(Generator):
         lines.append('    {')
         if isinstance(type_member.type, EnumType):
             lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::getEnumConstantValue(static_cast<int>(value)));' % setter_args)
-        elif CppGenerator.should_use_references_for_type(type_member.type):
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTF::move(value));' % setter_args)
         else:
             lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args)
         lines.append('    }')
@@ -335,7 +333,7 @@ class CppProtocolTypesHeaderGenerator(Generator):
         for argument in type_arguments:
             lines.append('template<> %s BindingTraits<%s> {' % (' '.join(struct_keywords), argument[0]))
             if argument[1]:
-                lines.append('static RefPtr<%s> runtimeCast(RefPtr<Inspector::InspectorValue>&& value);' % argument[0])
+                lines.append('static PassRefPtr<%s> runtimeCast(PassRefPtr<Inspector::InspectorValue> value);' % argument[0])
             lines.append('#if !ASSERT_DISABLED')
             lines.append('%s assertValueHasExpectedType(Inspector::InspectorValue*);' % ' '.join(function_keywords))
             lines.append('#endif // !ASSERT_DISABLED')
index 2c263b5..31ef494 100755 (executable)
@@ -122,7 +122,6 @@ class CppProtocolTypesImplementationGenerator(Generator):
         lines.append('#if !ASSERT_DISABLED')
         lines.append('void BindingTraits<%s>::assertValueHasExpectedType(Inspector::InspectorValue* value)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
         lines.append("""{
-    ASSERT_ARG(value, value);
     RefPtr<InspectorObject> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);""")
@@ -170,7 +169,6 @@ class CppProtocolTypesImplementationGenerator(Generator):
         lines.append('#if !ASSERT_DISABLED')
         lines.append('void %s(Inspector::InspectorValue* value)' % CppGenerator.cpp_assertion_method_for_type_member(enum_member, object_declaration))
         lines.append('{')
-        lines.append('    ASSERT_ARG(value, value);')
         lines.append('    String result;')
         lines.append('    bool castSucceeded = value->asString(result);')
         lines.append('    ASSERT(castSucceeded);')
index 091fa64..8ffae9b 100755 (executable)
@@ -111,7 +111,7 @@ class ObjCConfigurationImplementationGenerator(Generator):
             lines.append('    id successCallback = ^{')
 
         if command.return_parameters:
-            lines.append('        Ref<InspectorObject> resultObject = InspectorObject::create();')
+            lines.append('        RefPtr<InspectorObject> resultObject = InspectorObject::create();')
 
             required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
             for parameter in required_pointer_parameters:
index a3c4e1b..3b836fa 100755 (executable)
@@ -116,7 +116,7 @@ class ObjCFrontendDispatcherImplementationGenerator(Generator):
         if required_pointer_parameters or optional_pointer_parameters:
             lines.append('')
 
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%s.%s"));' % (domain.domain_name, event.event_name))
         if event.event_parameters:
             lines.extend(self._generate_event_out_parameters(domain, event))
@@ -136,7 +136,7 @@ class ObjCFrontendDispatcherImplementationGenerator(Generator):
 
     def _generate_event_out_parameters(self, domain, event):
         lines = []
-        lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+        lines.append('    RefPtr<InspectorObject> paramsObject = InspectorObject::create();')
         for parameter in event.event_parameters:
             keyed_set_method = CppGenerator.cpp_setter_method_for_type(parameter.type)
             var_name = parameter.parameter_name
index 473100b..5154fea 100755 (executable)
@@ -58,6 +58,7 @@ class ObjCProtocolTypesImplementationGenerator(Generator):
             '"%sEnumConversionHelpers.h"' % ObjCGenerator.OBJC_PREFIX,
             '<JavaScriptCore/InspectorValues.h>',
             '<wtf/Assertions.h>',
+            '<wtf/PassRefPtr.h>',
         ]
 
         header_args = {
index d8a79cd..9c4dac6 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -143,6 +143,7 @@ InspectorBackend.activateDomain("Database");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -171,32 +172,32 @@ public:
     virtual void executeSQLSyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
     class ExecuteSQLAsyncOptionalReturnValuesCallback : public Inspector::InspectorBackendDispatcher::CallbackBase {
     public:
-        ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<Inspector::InspectorBackendDispatcher>&&, int id);
-        void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, Inspector::Protocol::OptOutput<String>* printColor);
+        ExecuteSQLAsyncOptionalReturnValuesCallback(PassRefPtr<Inspector::InspectorBackendDispatcher>, int id);
+        void sendSuccess(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, Inspector::Protocol::OptOutput<String>* screenColor, Inspector::Protocol::OptOutput<String>* printColor);
     };
-    virtual void executeSQLAsyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncOptionalReturnValuesCallback>&& callback) = 0;
+    virtual void executeSQLAsyncOptionalReturnValues(ErrorString&, int in_databaseId, const String& in_query, PassRefPtr<ExecuteSQLAsyncOptionalReturnValuesCallback> callback) = 0;
     virtual void executeSQLSync(ErrorString&, int in_databaseId, const String& in_query, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
     class ExecuteSQLAsyncCallback : public Inspector::InspectorBackendDispatcher::CallbackBase {
     public:
-        ExecuteSQLAsyncCallback(Ref<Inspector::InspectorBackendDispatcher>&&, int id);
-        void sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, const String& printColor);
+        ExecuteSQLAsyncCallback(PassRefPtr<Inspector::InspectorBackendDispatcher>, int id);
+        void sendSuccess(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const String& screenColor, const String& printColor);
     };
-    virtual void executeSQLAsync(ErrorString&, int in_databaseId, const String& in_query, Ref<ExecuteSQLAsyncCallback>&& callback) = 0;
+    virtual void executeSQLAsync(ErrorString&, int in_databaseId, const String& in_query, PassRefPtr<ExecuteSQLAsyncCallback> callback) = 0;
 protected:
     virtual ~InspectorDatabaseBackendDispatcherHandler();
 };
 
 class InspectorDatabaseBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorDatabaseBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorDatabaseBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void executeSQLSyncOptionalReturnValues(long callId, const Inspector::InspectorObject& message);
     void executeSQLAsyncOptionalReturnValues(long callId, const Inspector::InspectorObject& message);
     void executeSQLSync(long callId, const Inspector::InspectorObject& message);
     void executeSQLAsync(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorDatabaseBackendDispatcherHandler*);
+    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
     InspectorDatabaseBackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -261,12 +262,12 @@ namespace Inspector {
 
 InspectorDatabaseBackendDispatcherHandler::~InspectorDatabaseBackendDispatcherHandler() { }
 
-Ref<InspectorDatabaseBackendDispatcher> InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+PassRefPtr<InspectorDatabaseBackendDispatcher> InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorDatabaseBackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorDatabaseBackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -276,32 +277,33 @@ InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(Inspector
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this);
 }
 
-void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorDatabaseBackendDispatcher> protect(*this);
 
     if (method == "executeSQLSyncOptionalReturnValues")
-        executeSQLSyncOptionalReturnValues(callId, message);
+        executeSQLSyncOptionalReturnValues(callId, *message.get());
     else if (method == "executeSQLAsyncOptionalReturnValues")
-        executeSQLAsyncOptionalReturnValues(callId, message);
+        executeSQLAsyncOptionalReturnValues(callId, *message.get());
     else if (method == "executeSQLSync")
-        executeSQLSync(callId, message);
+        executeSQLSync(callId, *message.get());
     else if (method == "executeSQLAsync")
-        executeSQLAsync(callId, message);
+        executeSQLAsync(callId, *message.get());
     else
         m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
 }
 
 void InspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
-    String in_query = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSyncOptionalReturnValues");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
@@ -313,7 +315,7 @@ void InspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     Inspector::Protocol::OptOutput<String> out_notes;
     Inspector::Protocol::OptOutput<double> out_timestamp;
@@ -345,14 +347,14 @@ void InspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long
         if (out_printColor.isAssigned())
             result->setString(ASCIILiteral("printColor"), out_printColor.getValue());
     }
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
-InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(Ref<InspectorBackendDispatcher>&& backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(WTF::move(backendDispatcher), id) { }
+InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(PassRefPtr<InspectorBackendDispatcher> backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
 
-void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, Inspector::Protocol::OptOutput<String>* screenColor, Inspector::Protocol::OptOutput<String>* printColor)
+void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, Inspector::Protocol::OptOutput<String>* notes, Inspector::Protocol::OptOutput<double>* timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* payload, Inspector::Protocol::OptOutput<int>* databaseId, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, Inspector::Protocol::OptOutput<String>* screenColor, Inspector::Protocol::OptOutput<String>* printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     if (columnNames)
         jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames);
     if (notes.isAssigned())
@@ -371,19 +373,20 @@ void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnVal
         jsonMessage->setString(ASCIILiteral("screenColor"), screenColor.getValue());
     if (printColor.isAssigned())
         jsonMessage->setString(ASCIILiteral("printColor"), printColor.getValue());
-    sendIfActive(WTF::move(jsonMessage), ErrorString());
+    sendIfActive(jsonMessage, ErrorString());
 }
 
 void InspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
-    String in_query = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsyncOptionalReturnValues");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
@@ -395,9 +398,9 @@ void InspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(lon
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
-    Ref<InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback> callback = adoptRef(*new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher.copyRef(), callId));
-    m_agent->executeSQLAsyncOptionalReturnValues(error, in_databaseId, in_query, callback.copyRef());
+    RefPtr<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback> callback = adoptRef(new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher,callId));
+    m_agent->executeSQLAsyncOptionalReturnValues(error, in_databaseId, in_query, callback);
 
     if (error.length()) {
         callback->disable();
@@ -408,14 +411,15 @@ void InspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(lon
 
 void InspectorDatabaseBackendDispatcher::executeSQLSync(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
-    String in_query = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLSync");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
@@ -427,7 +431,7 @@ void InspectorDatabaseBackendDispatcher::executeSQLSync(long callId, const Inspe
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     String out_notes;
     double out_timestamp;
@@ -450,14 +454,14 @@ void InspectorDatabaseBackendDispatcher::executeSQLSync(long callId, const Inspe
         result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getEnumConstantValue(out_screenColor));
         result->setString(ASCIILiteral("printColor"), Inspector::Protocol::getEnumConstantValue(out_printColor));
     }
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
-InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(Ref<InspectorBackendDispatcher>&& backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(WTF::move(backendDispatcher), id) { }
+InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(PassRefPtr<InspectorBackendDispatcher> backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
 
-void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(RefPtr<Inspector::Protocol::Array<String>>&& columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, RefPtr<Inspector::Protocol::Database::Error>&& sqlError, const String& screenColor, const String& printColor)
+void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const String& screenColor, const String& printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames);
     jsonMessage->setString(ASCIILiteral("notes"), notes);
     jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp);
@@ -467,19 +471,20 @@ void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuc
     jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError);
     jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getEnumConstantValue(screenColor));
     jsonMessage->setString(ASCIILiteral("printColor"), Inspector::Protocol::getEnumConstantValue(printColor));
-    sendIfActive(WTF::move(jsonMessage), ErrorString());
+    sendIfActive(jsonMessage, ErrorString());
 }
 
 void InspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
-    String in_query = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeSQLAsync");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
@@ -491,9 +496,9 @@ void InspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, const Insp
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
-    Ref<InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback> callback = adoptRef(*new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher.copyRef(), callId));
-    m_agent->executeSQLAsync(error, in_databaseId, in_query, callback.copyRef());
+    RefPtr<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback> callback = adoptRef(new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher,callId));
+    m_agent->executeSQLAsync(error, in_databaseId, in_query, callback);
 
     if (error.length()) {
         callback->disable();
@@ -547,6 +552,7 @@ void InspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, const Insp
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -644,6 +650,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -700,10 +707,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*Error*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*Error*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class Error;
     public:
@@ -722,27 +729,30 @@ public:
             return castState<CodeSet>();
         }
 
-        Ref<Error> release()
+        operator RefPtr<Error>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<Error>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<Error>*>(&result));
+        PassRefPtr<Error> release()
+        {
+            return RefPtr<Error>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<Error> result = Error::create()
+     * RefPtr<Error> result = Error::create()
      *     .setMessage(...)
-     *     .setCode(...)
-     *     .release();
+     *     .setCode(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Database
@@ -1055,7 +1065,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -1095,7 +1105,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -1135,7 +1145,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLSync(long callId, int in_
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, RWIProtocolDatabasePrimaryColors screenColor, RWIProtocolDatabaseExecuteSQLSyncPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1166,7 +1176,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, int in
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, RWIProtocolDatabasePrimaryColors screenColor, RWIProtocolDatabaseExecuteSQLAsyncPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1555,6 +1565,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 27f746d..7b5ef57 100644 (file)
@@ -41,18 +41,18 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
 class AlternateInspectorDatabaseBackendDispatcher : public AlternateInspectorBackendDispatcher {
 public:
     virtual ~AlternateInspectorDatabaseBackendDispatcher() { }
-    virtual void executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String* in_screenColor, const String* in_printColor) = 0;
-    virtual void executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String& in_screenColor, const String& in_printColor) = 0;
+    virtual void executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>* in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>* in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>* in_sqlError, const String* in_screenColor, const String* in_printColor) = 0;
+    virtual void executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>& in_sqlError, const String& in_screenColor, const String& in_printColor) = 0;
 };
 
 } // namespace Inspector
@@ -138,6 +138,7 @@ InspectorBackend.activateDomain("Database");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -163,21 +164,21 @@ public:
         Yellow = 5,
         Black = 6,
     }; // enum class PrintColor
-    virtual void executeAllOptionalParameters(ErrorString&, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String* in_screenColor, const String* in_printColor, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
-    virtual void executeNoOptionalParameters(ErrorString&, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String& in_screenColor, const String& in_printColor, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
+    virtual void executeAllOptionalParameters(ErrorString&, const RefPtr<Inspector::InspectorArray>* in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>* in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>* in_sqlError, const String* in_screenColor, const String* in_printColor, RefPtr<Inspector::Protocol::Array<String>>& opt_out_columnNames, Inspector::Protocol::OptOutput<String>* opt_out_notes, Inspector::Protocol::OptOutput<double>* opt_out_timestamp, Inspector::Protocol::OptOutput<Inspector::InspectorObject>* opt_out_values, Inspector::Protocol::OptOutput<Inspector::InspectorValue>* opt_out_payload, Inspector::Protocol::OptOutput<int>* opt_out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& opt_out_sqlError, Inspector::Protocol::Database::PrimaryColors* opt_out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
+    virtual void executeNoOptionalParameters(ErrorString&, const RefPtr<Inspector::InspectorArray>& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>& in_sqlError, const String& in_screenColor, const String& in_printColor, RefPtr<Inspector::Protocol::Array<String>>& out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr<Inspector::Protocol::Database::Error>& out_sqlError, Inspector::Protocol::Database::PrimaryColors* out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
 protected:
     virtual ~InspectorDatabaseBackendDispatcherHandler();
 };
 
 class InspectorDatabaseBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorDatabaseBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorDatabaseBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void executeAllOptionalParameters(long callId, const Inspector::InspectorObject& message);
     void executeNoOptionalParameters(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorDatabaseBackendDispatcherHandler*);
+    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
     InspectorDatabaseBackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -242,12 +243,12 @@ namespace Inspector {
 
 InspectorDatabaseBackendDispatcherHandler::~InspectorDatabaseBackendDispatcherHandler() { }
 
-Ref<InspectorDatabaseBackendDispatcher> InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+PassRefPtr<InspectorDatabaseBackendDispatcher> InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorDatabaseBackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorDatabaseBackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -257,56 +258,57 @@ InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(Inspector
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Database"), this);
 }
 
-void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorDatabaseBackendDispatcher> protect(*this);
 
     if (method == "executeAllOptionalParameters")
-        executeAllOptionalParameters(callId, message);
+        executeAllOptionalParameters(callId, *message.get());
     else if (method == "executeNoOptionalParameters")
-        executeNoOptionalParameters(callId, message);
+        executeNoOptionalParameters(callId, *message.get());
     else
         m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\'', "Database", '.', method, "' was not found"));
 }
 
 void InspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
     bool columnNames_valueFound = false;
-    RefPtr<Inspector::InspectorArray> in_columnNames = InspectorBackendDispatcher::getArray(paramsContainer.get(), ASCIILiteral("columnNames"), &columnNames_valueFound, protocolErrors.get());
+    RefPtr<Inspector::InspectorArray> in_columnNames = InspectorBackendDispatcher::getArray(paramsContainerPtr, ASCIILiteral("columnNames"), &columnNames_valueFound, protocolErrorsPtr);
     bool notes_valueFound = false;
-    String in_notes = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("notes"), &notes_valueFound, protocolErrors.get());
+    String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("notes"), &notes_valueFound, protocolErrorsPtr);
     bool timestamp_valueFound = false;
-    Inspector::Protocol::OptOutput<double> in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainer.get(), ASCIILiteral("timestamp"), &timestamp_valueFound, protocolErrors.get());
+    Inspector::Protocol::OptOutput<double> in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainerPtr, ASCIILiteral("timestamp"), &timestamp_valueFound, protocolErrorsPtr);
     bool values_valueFound = false;
-    RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainer.get(), ASCIILiteral("values"), &values_valueFound, protocolErrors.get());
+    RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("values"), &values_valueFound, protocolErrorsPtr);
     bool payload_valueFound = false;
-    RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getValue(paramsContainer.get(), ASCIILiteral("payload"), &payload_valueFound, protocolErrors.get());
+    RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getValue(paramsContainerPtr, ASCIILiteral("payload"), &payload_valueFound, protocolErrorsPtr);
     bool databaseId_valueFound = false;
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), &databaseId_valueFound, protocolErrors.get());
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), &databaseId_valueFound, protocolErrorsPtr);
     bool sqlError_valueFound = false;
-    RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainer.get(), ASCIILiteral("sqlError"), &sqlError_valueFound, protocolErrors.get());
+    RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("sqlError"), &sqlError_valueFound, protocolErrorsPtr);
     bool screenColor_valueFound = false;
-    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("screenColor"), &screenColor_valueFound, protocolErrors.get());
+    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("screenColor"), &screenColor_valueFound, protocolErrorsPtr);
     bool printColor_valueFound = false;
-    String in_printColor = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("printColor"), &printColor_valueFound, protocolErrors.get());
+    String in_printColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("printColor"), &printColor_valueFound, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeAllOptionalParameters");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
-        m_alternateDispatcher->executeAllOptionalParameters(callId, columnNames_valueFound ? in_columnNames.copyRef() : nullptr, notes_valueFound ? &in_notes : nullptr, timestamp_valueFound ? &in_timestamp : nullptr, values_valueFound ? in_values.copyRef() : nullptr, payload_valueFound ? in_payload.copyRef() : nullptr, databaseId_valueFound ? &in_databaseId : nullptr, sqlError_valueFound ? in_sqlError.copyRef() : nullptr, screenColor_valueFound ? &in_screenColor : nullptr, printColor_valueFound ? &in_printColor : nullptr);
+        m_alternateDispatcher->executeAllOptionalParameters(callId, columnNames_valueFound ? &in_columnNames : nullptr, notes_valueFound ? &in_notes : nullptr, timestamp_valueFound ? &in_timestamp : nullptr, values_valueFound ? &in_values : nullptr, payload_valueFound ? &in_payload : nullptr, databaseId_valueFound ? &in_databaseId : nullptr, sqlError_valueFound ? &in_sqlError : nullptr, screenColor_valueFound ? &in_screenColor : nullptr, printColor_valueFound ? &in_printColor : nullptr);
         return;
     }
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     Inspector::Protocol::OptOutput<String> out_notes;
     Inspector::Protocol::OptOutput<double> out_timestamp;
@@ -316,7 +318,7 @@ void InspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callI
     RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
     Inspector::Protocol::Database::PrimaryColors out_screenColor;
     InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
-    m_agent->executeAllOptionalParameters(error, columnNames_valueFound ? in_columnNames.copyRef() : nullptr, notes_valueFound ? &in_notes : nullptr, timestamp_valueFound ? &in_timestamp : nullptr, values_valueFound ? in_values.copyRef() : nullptr, payload_valueFound ? in_payload.copyRef() : nullptr, databaseId_valueFound ? &in_databaseId : nullptr, sqlError_valueFound ? in_sqlError.copyRef() : nullptr, screenColor_valueFound ? &in_screenColor : nullptr, printColor_valueFound ? &in_printColor : nullptr, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, &out_printColor);
+    m_agent->executeAllOptionalParameters(error, columnNames_valueFound ? &in_columnNames : nullptr, notes_valueFound ? &in_notes : nullptr, timestamp_valueFound ? &in_timestamp : nullptr, values_valueFound ? &in_values : nullptr, payload_valueFound ? &in_payload : nullptr, databaseId_valueFound ? &in_databaseId : nullptr, sqlError_valueFound ? &in_sqlError : nullptr, screenColor_valueFound ? &in_screenColor : nullptr, printColor_valueFound ? &in_printColor : nullptr, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, &out_printColor);
 
     if (!error.length()) {
         if (out_columnNames)
@@ -338,38 +340,39 @@ void InspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callI
         if (out_printColor.isAssigned())
             result->setString(ASCIILiteral("printColor"), out_printColor.getValue());
     }
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId, const InspectorObject& message)
 {
-    auto protocolErrors = Inspector::Protocol::Array<String>::create();
-    RefPtr<InspectorObject> paramsContainer;
-    message.getObject(ASCIILiteral("params"), paramsContainer);
-    RefPtr<Inspector::InspectorArray> in_columnNames = InspectorBackendDispatcher::getArray(paramsContainer.get(), ASCIILiteral("columnNames"), nullptr, protocolErrors.get());
-    String in_notes = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("notes"), nullptr, protocolErrors.get());
-    double in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainer.get(), ASCIILiteral("timestamp"), nullptr, protocolErrors.get());
-    RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainer.get(), ASCIILiteral("values"), nullptr, protocolErrors.get());
-    RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getValue(paramsContainer.get(), ASCIILiteral("payload"), nullptr, protocolErrors.get());
-    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainer.get(), ASCIILiteral("databaseId"), nullptr, protocolErrors.get());
-    RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainer.get(), ASCIILiteral("sqlError"), nullptr, protocolErrors.get());
-    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("screenColor"), nullptr, protocolErrors.get());
-    String in_printColor = InspectorBackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("printColor"), nullptr, protocolErrors.get());
+    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral("params"));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    RefPtr<Inspector::InspectorArray> in_columnNames = InspectorBackendDispatcher::getArray(paramsContainerPtr, ASCIILiteral("columnNames"), nullptr, protocolErrorsPtr);
+    String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("notes"), nullptr, protocolErrorsPtr);
+    double in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainerPtr, ASCIILiteral("timestamp"), nullptr, protocolErrorsPtr);
+    RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("values"), nullptr, protocolErrorsPtr);
+    RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getValue(paramsContainerPtr, ASCIILiteral("payload"), nullptr, protocolErrorsPtr);
+    int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);
+    RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("sqlError"), nullptr, protocolErrorsPtr);
+    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("screenColor"), nullptr, protocolErrorsPtr);
+    String in_printColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("printColor"), nullptr, protocolErrorsPtr);
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", "Database.executeNoOptionalParameters");
-        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, WTF::move(protocolErrors));
+        m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
         return;
     }
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
-        m_alternateDispatcher->executeNoOptionalParameters(callId, in_columnNames.copyRef(), in_notes, in_timestamp, in_values.copyRef(), in_payload.copyRef(), in_databaseId, in_sqlError.copyRef(), in_screenColor, in_printColor);
+        m_alternateDispatcher->executeNoOptionalParameters(callId, in_columnNames, in_notes, in_timestamp, in_values, in_payload, in_databaseId, in_sqlError, in_screenColor, in_printColor);
         return;
     }
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     RefPtr<Inspector::Protocol::Array<String>> out_columnNames;
     String out_notes;
     double out_timestamp;
@@ -379,7 +382,7 @@ void InspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId
     RefPtr<Inspector::Protocol::Database::Error> out_sqlError;
     Inspector::Protocol::Database::PrimaryColors out_screenColor;
     InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
-    m_agent->executeNoOptionalParameters(error, in_columnNames.copyRef(), in_notes, in_timestamp, in_values.copyRef(), in_payload.copyRef(), in_databaseId, in_sqlError.copyRef(), in_screenColor, in_printColor, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, &out_printColor);
+    m_agent->executeNoOptionalParameters(error, in_columnNames, in_notes, in_timestamp, in_values, in_payload, in_databaseId, in_sqlError, in_screenColor, in_printColor, out_columnNames, &out_notes, &out_timestamp, out_values, &out_payload, &out_databaseId, out_sqlError, &out_screenColor, &out_printColor);
 
     if (!error.length()) {
         result->setArray(ASCIILiteral("columnNames"), out_columnNames);
@@ -392,7 +395,7 @@ void InspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId
         result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getEnumConstantValue(out_screenColor));
         result->setString(ASCIILiteral("printColor"), Inspector::Protocol::getEnumConstantValue(out_printColor));
     }
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 } // namespace Inspector
@@ -440,6 +443,7 @@ void InspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -537,6 +541,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -593,10 +598,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*Error*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*Error*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class Error;
     public:
@@ -615,27 +620,30 @@ public:
             return castState<CodeSet>();
         }
 
-        Ref<Error> release()
+        operator RefPtr<Error>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<Error>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<Error>*>(&result));
+        PassRefPtr<Error> release()
+        {
+            return RefPtr<Error>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<Error> result = Error::create()
+     * RefPtr<Error> result = Error::create()
      *     .setMessage(...)
-     *     .setCode(...)
-     *     .release();
+     *     .setCode(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Database
@@ -759,8 +767,8 @@ namespace Inspector {
 class ObjCInspectorDatabaseBackendDispatcher final : public AlternateInspectorDatabaseBackendDispatcher {
 public:
     ObjCInspectorDatabaseBackendDispatcher(id<RWIProtocolDatabaseDomainHandler> handler) { m_delegate = handler; }
-    virtual void executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String* in_screenColor, const String* in_printColor) override;
-    virtual void executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String& in_screenColor, const String& in_printColor) override;
+    virtual void executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>* in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>* in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>* in_sqlError, const String* in_screenColor, const String* in_printColor) override;
+    virtual void executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>& in_sqlError, const String& in_screenColor, const String& in_printColor) override;
 private:
     RetainPtr<id<RWIProtocolDatabaseDomainHandler>> m_delegate;
 };
@@ -939,14 +947,14 @@ __attribute__((visibility ("default")))
 
 namespace Inspector {
 
-void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String* in_screenColor, const String* in_printColor)
+void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>* in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr<Inspector::InspectorObject>* in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr<Inspector::InspectorObject>* in_sqlError, const String* in_screenColor, const String* in_printColor)
 {
     id errorCallback = ^(NSString *error) {
         backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ **columnNames, NSString **notes, double *timestamp, RWIProtocolJSONObject **values, RWIProtocolJSONObject **payload, int *databaseId, RWIProtocolDatabaseError **sqlError, RWIProtocolDatabasePrimaryColors *screenColor, RWIProtocolDatabaseExecuteAllOptionalParametersPrintColor *printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(values, @"values");
@@ -1004,14 +1012,14 @@ void ObjCInspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long c
     [m_delegate executeAllOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:(in_columnNames ? &o_in_columnNames : nil) notes:(in_notes ? &o_in_notes : nil) timestamp:(in_timestamp ? &o_in_timestamp : nil) values:(in_values ? &o_in_values : nil) payload:(in_payload ? &o_in_payload : nil) databaseId:(in_databaseId ? &o_in_databaseId : nil) sqlError:(in_sqlError ? &o_in_sqlError : nil) screenColor:(in_screenColor ? &o_in_screenColor : nil) printColor:(in_printColor ? &o_in_printColor : nil)];
 }
 
-void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>&& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>&& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>&& in_sqlError, const String& in_screenColor, const String& in_printColor)
+void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId, const RefPtr<Inspector::InspectorArray>& in_columnNames, const String& in_notes, double in_timestamp, const RefPtr<Inspector::InspectorObject>& in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr<Inspector::InspectorObject>& in_sqlError, const String& in_screenColor, const String& in_printColor)
 {
     id errorCallback = ^(NSString *error) {
         backendDispatcher()->sendResponse(callId, InspectorObject::create(), error);
     };
 
     id successCallback = ^(NSArray/*<NSString>*/ *columnNames, NSString *notes, double timestamp, RWIProtocolJSONObject *values, RWIProtocolJSONObject *payload, int databaseId, RWIProtocolDatabaseError *sqlError, RWIProtocolDatabasePrimaryColors screenColor, RWIProtocolDatabaseExecuteNoOptionalParametersPrintColor printColor) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(columnNames, @"columnNames");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(notes, @"notes");
         THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(values, @"values");
@@ -1405,6 +1413,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 2f903ef..3822fa9 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -156,6 +156,7 @@ InspectorBackend.activateDomain("Network3");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -189,12 +190,12 @@ protected:
 
 class InspectorNetwork1BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorNetwork1BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorNetwork1BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void loadResource1(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorNetwork1BackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorNetwork1BackendDispatcherHandler*);
+    InspectorNetwork1BackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
     InspectorNetwork1BackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -206,8 +207,8 @@ private:
 
 class InspectorNetwork3BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorNetwork3BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork3BackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorNetwork3BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork3BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void loadResource1(long callId, const Inspector::InspectorObject& message);
     void loadResource2(long callId, const Inspector::InspectorObject& message);
@@ -217,7 +218,7 @@ private:
     void loadResource6(long callId, const Inspector::InspectorObject& message);
     void loadResource7(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorNetwork3BackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorNetwork3BackendDispatcherHandler*);
+    InspectorNetwork3BackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorNetwork3BackendDispatcherHandler*);
     InspectorNetwork3BackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -283,12 +284,12 @@ namespace Inspector {
 InspectorNetwork1BackendDispatcherHandler::~InspectorNetwork1BackendDispatcherHandler() { }
 InspectorNetwork3BackendDispatcherHandler::~InspectorNetwork3BackendDispatcherHandler() { }
 
-Ref<InspectorNetwork1BackendDispatcher> InspectorNetwork1BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+PassRefPtr<InspectorNetwork1BackendDispatcher> InspectorNetwork1BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorNetwork1BackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorNetwork1BackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -298,12 +299,12 @@ InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(Inspector
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network1"), this);
 }
 
-void InspectorNetwork1BackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorNetwork1BackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorNetwork1BackendDispatcher> protect(*this);
 
     if (method == "loadResource1")
-        loadResource1(callId, message);
+        loadResource1(callId, *message.get());
     else
         m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found"));
 }
@@ -318,18 +319,18 @@ void InspectorNetwork1BackendDispatcher::loadResource1(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource1(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
-Ref<InspectorNetwork3BackendDispatcher> InspectorNetwork3BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
+PassRefPtr<InspectorNetwork3BackendDispatcher> InspectorNetwork3BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorNetwork3BackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorNetwork3BackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorNetwork3BackendDispatcher::InspectorNetwork3BackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
+InspectorNetwork3BackendDispatcher::InspectorNetwork3BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -339,7 +340,7 @@ InspectorNetwork3BackendDispatcher::InspectorNetwork3BackendDispatcher(Inspector
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network3"), this);
 }
 
-void InspectorNetwork3BackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorNetwork3BackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorNetwork3BackendDispatcher> protect(*this);
 
@@ -370,7 +371,7 @@ void InspectorNetwork3BackendDispatcher::dispatch(long callId, const String& met
         return;
     }
 
-    ((*this).*it->value)(callId, message.get());
+    ((*this).*it->value)(callId, *message.get());
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource1(long callId, const InspectorObject&)
@@ -383,10 +384,10 @@ void InspectorNetwork3BackendDispatcher::loadResource1(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource1(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource2(long callId, const InspectorObject&)
@@ -399,10 +400,10 @@ void InspectorNetwork3BackendDispatcher::loadResource2(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource2(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource3(long callId, const InspectorObject&)
@@ -415,10 +416,10 @@ void InspectorNetwork3BackendDispatcher::loadResource3(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource3(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource4(long callId, const InspectorObject&)
@@ -431,10 +432,10 @@ void InspectorNetwork3BackendDispatcher::loadResource4(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource4(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource5(long callId, const InspectorObject&)
@@ -447,10 +448,10 @@ void InspectorNetwork3BackendDispatcher::loadResource5(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource5(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource6(long callId, const InspectorObject&)
@@ -463,10 +464,10 @@ void InspectorNetwork3BackendDispatcher::loadResource6(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource6(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 void InspectorNetwork3BackendDispatcher::loadResource7(long callId, const InspectorObject&)
@@ -479,10 +480,10 @@ void InspectorNetwork3BackendDispatcher::loadResource7(long callId, const Inspec
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource7(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 } // namespace Inspector
@@ -530,6 +531,7 @@ void InspectorNetwork3BackendDispatcher::loadResource7(long callId, const Inspec
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -627,6 +629,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -1289,6 +1292,7 @@ using namespace Inspector;
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 40185a9..8dc9c1f 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -144,6 +144,7 @@ InspectorBackend.activateDomain("EventDomain");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -170,12 +171,12 @@ protected:
 
 class InspectorCommandDomainBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorCommandDomainBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorCommandDomainBackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorCommandDomainBackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorCommandDomainBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void commandWithEnumReturnValue(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorCommandDomainBackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorCommandDomainBackendDispatcherHandler*);
+    InspectorCommandDomainBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorCommandDomainBackendDispatcherHandler*);
     InspectorCommandDomainBackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -240,12 +241,12 @@ namespace Inspector {
 
 InspectorCommandDomainBackendDispatcherHandler::~InspectorCommandDomainBackendDispatcherHandler() { }
 
-Ref<InspectorCommandDomainBackendDispatcher> InspectorCommandDomainBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorCommandDomainBackendDispatcherHandler* agent)
+PassRefPtr<InspectorCommandDomainBackendDispatcher> InspectorCommandDomainBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorCommandDomainBackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorCommandDomainBackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorCommandDomainBackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorCommandDomainBackendDispatcher::InspectorCommandDomainBackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorCommandDomainBackendDispatcherHandler* agent)
+InspectorCommandDomainBackendDispatcher::InspectorCommandDomainBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorCommandDomainBackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -255,12 +256,12 @@ InspectorCommandDomainBackendDispatcher::InspectorCommandDomainBackendDispatcher
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("CommandDomain"), this);
 }
 
-void InspectorCommandDomainBackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorCommandDomainBackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorCommandDomainBackendDispatcher> protect(*this);
 
     if (method == "commandWithEnumReturnValue")
-        commandWithEnumReturnValue(callId, message);
+        commandWithEnumReturnValue(callId, *message.get());
     else
         m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\'', "CommandDomain", '.', method, "' was not found"));
 }
@@ -275,14 +276,14 @@ void InspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(long ca
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     InspectorCommandDomainBackendDispatcherHandler::ReturnValue out_returnValue;
     m_agent->commandWithEnumReturnValue(error, &out_returnValue);
 
     if (!error.length())
         result->setString(ASCIILiteral("returnValue"), Inspector::Protocol::getEnumConstantValue(out_returnValue));
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 
 } // namespace Inspector
@@ -330,6 +331,7 @@ void InspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(long ca
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -399,11 +401,11 @@ namespace Inspector {
 
 void InspectorEventDomainFrontendDispatcher::eventWithEnumParameter(Parameter parameter)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     paramsObject->setString(ASCIILiteral("parameter"), Inspector::Protocol::getEnumConstantValue(parameter));
-    jsonMessage->setObject(ASCIILiteral("params"), paramsObject.copyRef());
+    jsonMessage->setObject(ASCIILiteral("params"), paramsObject);
 
     m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
 }
@@ -452,6 +454,7 @@ void InspectorEventDomainFrontendDispatcher::eventWithEnumParameter(Parameter pa
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -810,7 +813,7 @@ void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(lon
     };
 
     id successCallback = ^(RWIProtocolCommandDomainCommandWithEnumReturnValueReturnValue returnValue) {
-        Ref<InspectorObject> resultObject = InspectorObject::create();
+        RefPtr<InspectorObject> resultObject = InspectorObject::create();
         resultObject->setString(ASCIILiteral("returnValue"), toProtocolString(returnValue));
         backendDispatcher()->sendResponse(callId, resultObject.release(), String());
     };
@@ -1018,9 +1021,9 @@ using namespace Inspector;
     if (!frontendChannel)
         return;
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     paramsObject->setString(ASCIILiteral("parameter"), toProtocolString(parameter));
     jsonMessage->setObject(ASCIILiteral("params"), paramsObject);
     frontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
@@ -1142,6 +1145,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index cafe46c..d92ec52 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -133,6 +133,7 @@ InspectorBackend.activateDomain("Database");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -241,6 +242,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -250,8 +252,8 @@ namespace Inspector {
 class InspectorDatabaseFrontendDispatcher {
 public:
     InspectorDatabaseFrontendDispatcher(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
-    void didExecuteOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, const String* const printColor);
-    void didExecuteNoOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, const String& printColor);
+    void didExecuteOptionalParameters(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, PassRefPtr<Inspector::InspectorObject> values, PassRefPtr<Inspector::InspectorValue> payload, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, const String* const printColor);
+    void didExecuteNoOptionalParameters(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, PassRefPtr<Inspector::InspectorObject> values, PassRefPtr<Inspector::InspectorValue> payload, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, const String& printColor);
 private:
     InspectorFrontendChannel* m_inspectorFrontendChannel;
 };
@@ -303,11 +305,11 @@ private:
 
 namespace Inspector {
 
-void InspectorDatabaseFrontendDispatcher::didExecuteOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, const String* const printColor)
+void InspectorDatabaseFrontendDispatcher::didExecuteOptionalParameters(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String* const notes, const double* const timestamp, PassRefPtr<Inspector::InspectorObject> values, PassRefPtr<Inspector::InspectorValue> payload, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors* const screenColor, const String* const printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     if (columnNames)
         paramsObject->setArray(ASCIILiteral("columnNames"), columnNames);
     if (notes)
@@ -324,16 +326,16 @@ void InspectorDatabaseFrontendDispatcher::didExecuteOptionalParameters(RefPtr<In
         paramsObject->setString(ASCIILiteral("screenColor"), *screenColor);
     if (printColor)
         paramsObject->setString(ASCIILiteral("printColor"), *printColor);
-    jsonMessage->setObject(ASCIILiteral("params"), paramsObject.copyRef());
+    jsonMessage->setObject(ASCIILiteral("params"), paramsObject);
 
     m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
 }
 
-void InspectorDatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, RefPtr<Inspector::InspectorObject> values, RefPtr<Inspector::InspectorValue> payload, RefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, const String& printColor)
+void InspectorDatabaseFrontendDispatcher::didExecuteNoOptionalParameters(PassRefPtr<Inspector::Protocol::Array<String>> columnNames, const String& notes, double timestamp, PassRefPtr<Inspector::InspectorObject> values, PassRefPtr<Inspector::InspectorValue> payload, PassRefPtr<Inspector::Protocol::Database::Error> sqlError, const Inspector::Protocol::Database::PrimaryColors& screenColor, const String& printColor)
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     paramsObject->setArray(ASCIILiteral("columnNames"), columnNames);
     paramsObject->setString(ASCIILiteral("notes"), notes);
     paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp);
@@ -342,7 +344,7 @@ void InspectorDatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<
     paramsObject->setObject(ASCIILiteral("sqlError"), sqlError);
     paramsObject->setString(ASCIILiteral("screenColor"), screenColor);
     paramsObject->setString(ASCIILiteral("printColor"), printColor);
-    jsonMessage->setObject(ASCIILiteral("params"), paramsObject.copyRef());
+    jsonMessage->setObject(ASCIILiteral("params"), paramsObject);
 
     m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
 }
@@ -391,6 +393,7 @@ void InspectorDatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -442,10 +445,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*Error*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*Error*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class Error;
     public:
@@ -464,27 +467,30 @@ public:
             return castState<CodeSet>();
         }
 
-        Ref<Error> release()
+        operator RefPtr<Error>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<Error>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<Error>*>(&result));
+        PassRefPtr<Error> release()
+        {
+            return RefPtr<Error>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<Error> result = Error::create()
+     * RefPtr<Error> result = Error::create()
      *     .setMessage(...)
-     *     .setCode(...)
-     *     .release();
+     *     .setCode(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Database
@@ -882,9 +888,9 @@ using namespace Inspector;
     THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(screenColor, @"screenColor");
     THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(printColor, @"printColor");
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     if (columnNames)
         paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray((*columnNames)));
     if (notes)
@@ -919,9 +925,9 @@ using namespace Inspector;
     THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(screenColor, @"screenColor");
     THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(printColor, @"printColor");
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Database.didExecuteNoOptionalParameters"));
-    Ref<InspectorObject> paramsObject = InspectorObject::create();
+    RefPtr<InspectorObject> paramsObject = InspectorObject::create();
     paramsObject->setArray(ASCIILiteral("columnNames"), inspectorStringArray(columnNames));
     paramsObject->setString(ASCIILiteral("notes"), notes);
     paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp);
@@ -1035,6 +1041,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 3c5b614..f7b449d 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -142,6 +142,7 @@ InspectorBackend.activateDomain("Network3");
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -166,12 +167,12 @@ protected:
 #if PLATFORM(WEB_COMMANDS)
 class InspectorNetwork1BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
 public:
-    static Ref<InspectorNetwork1BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
-    virtual void dispatch(long callId, const String& method, Ref<Inspector::InspectorObject>&& message) override;
+    static PassRefPtr<InspectorNetwork1BackendDispatcher> create(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) override;
 private:
     void loadResource(long callId, const Inspector::InspectorObject& message);
 private:
-    InspectorNetwork1BackendDispatcher(Inspector::InspectorBackendDispatcher&, InspectorNetwork1BackendDispatcherHandler*);
+    InspectorNetwork1BackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
     InspectorNetwork1BackendDispatcherHandler* m_agent;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
@@ -240,12 +241,12 @@ InspectorNetwork1BackendDispatcherHandler::~InspectorNetwork1BackendDispatcherHa
 #endif // PLATFORM(WEB_COMMANDS)
 
 #if PLATFORM(WEB_COMMANDS)
-Ref<InspectorNetwork1BackendDispatcher> InspectorNetwork1BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+PassRefPtr<InspectorNetwork1BackendDispatcher> InspectorNetwork1BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
 {
-    return adoptRef(*new InspectorNetwork1BackendDispatcher(*backendDispatcher, agent));
+    return adoptRef(new InspectorNetwork1BackendDispatcher(backendDispatcher, agent));
 }
 
-InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(InspectorBackendDispatcher& backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
     : InspectorSupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -255,12 +256,12 @@ InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(Inspector
     m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("Network1"), this);
 }
 
-void InspectorNetwork1BackendDispatcher::dispatch(long callId, const String& method, Ref<InspectorObject>&& message)
+void InspectorNetwork1BackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
 {
     Ref<InspectorNetwork1BackendDispatcher> protect(*this);
 
     if (method == "loadResource")
-        loadResource(callId, message);
+        loadResource(callId, *message.get());
     else
         m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\'', "Network1", '.', method, "' was not found"));
 }
@@ -275,10 +276,10 @@ void InspectorNetwork1BackendDispatcher::loadResource(long callId, const Inspect
 #endif
 
     ErrorString error;
-    Ref<InspectorObject> result = InspectorObject::create();
+    RefPtr<InspectorObject> result = InspectorObject::create();
     m_agent->loadResource(error);
 
-    m_backendDispatcher->sendResponse(callId, WTF::move(result), error);
+    m_backendDispatcher->sendResponse(callId, result.release(), error);
 }
 #endif // PLATFORM(WEB_COMMANDS)
 
@@ -327,6 +328,7 @@ void InspectorNetwork1BackendDispatcher::loadResource(long callId, const Inspect
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -393,7 +395,7 @@ namespace Inspector {
 #if PLATFORM(WEB_EVENTS)
 void InspectorNetwork3FrontendDispatcher::resourceLoaded()
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded"));
 
     m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
@@ -444,6 +446,7 @@ void InspectorNetwork3FrontendDispatcher::resourceLoaded()
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -490,10 +493,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*NetworkError*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*NetworkError*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class NetworkError;
     public:
@@ -512,27 +515,30 @@ public:
             return castState<CodeSet>();
         }
 
-        Ref<NetworkError> release()
+        operator RefPtr<NetworkError>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(NetworkError) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<NetworkError>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<NetworkError>*>(&result));
+        PassRefPtr<NetworkError> release()
+        {
+            return RefPtr<NetworkError>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<NetworkError> result = NetworkError::create()
+     * RefPtr<NetworkError> result = NetworkError::create()
      *     .setMessage(...)
-     *     .setCode(...)
-     *     .release();
+     *     .setCode(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Network2
@@ -984,7 +990,7 @@ using namespace Inspector;
     if (!frontendChannel)
         return;
 
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
     jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("Network3.resourceLoaded"));
     frontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
 }
@@ -1092,6 +1098,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 34d2676..2dcf133 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -127,6 +127,7 @@ private:
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -235,6 +236,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -332,6 +334,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -814,6 +817,7 @@ using namespace Inspector;
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index df393f1..93993a3 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -127,6 +127,7 @@ private:
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -235,6 +236,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -332,6 +334,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -381,10 +384,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*KeyPath*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*KeyPath*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class KeyPath;
     public:
@@ -396,35 +399,38 @@ public:
             return castState<TypeSet>();
         }
 
-        Ref<KeyPath> release()
+        operator RefPtr<KeyPath>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(KeyPath) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<KeyPath>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<KeyPath>*>(&result));
+        PassRefPtr<KeyPath> release()
+        {
+            return RefPtr<KeyPath>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<KeyPath> result = KeyPath::create()
-     *     .setType(...)
-     *     .release();
+     * RefPtr<KeyPath> result = KeyPath::create()
+     *     .setType(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 
     void setString(const String& value)
     {
         InspectorObjectBase::setString(ASCIILiteral("string"), value);
     }
 
-    void setArray(RefPtr<Inspector::Protocol::Array<String>> value)
+    void setArray(PassRefPtr<Inspector::Protocol::Array<String>> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("array"), WTF::move(value));
+        InspectorObjectBase::setArray(ASCIILiteral("array"), value);
     }
 };
 
@@ -914,6 +920,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index f669543..204a2b8 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -127,6 +127,7 @@ private:
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -235,6 +236,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -332,6 +334,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -800,6 +803,7 @@ using namespace Inspector;
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 7f1e6a4..36546c2 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -130,6 +130,7 @@ InspectorBackend.registerEnum("Debugger.Reason", {Died: "Died", Fainted: "Fainte
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -238,6 +239,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -335,6 +337,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -861,6 +864,7 @@ typedef NS_ENUM(NSInteger, RWIProtocolDebuggerReason) {
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 58ca406..da75646 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -131,6 +131,7 @@ InspectorBackend.registerEnum("Runtime.TwoLeggedAnimals", {Ducks: "Ducks", Hens:
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -239,6 +240,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -336,6 +338,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -899,6 +902,7 @@ typedef NS_ENUM(NSInteger, RWIProtocolRuntimeTwoLeggedAnimals) {
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 91d75c3..cc42fd2 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -127,6 +127,7 @@ private:
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -235,6 +236,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -332,6 +334,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -384,10 +387,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*Error*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*Error*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class Error;
     public:
@@ -406,27 +409,30 @@ public:
             return castState<CodeSet>();
         }
 
-        Ref<Error> release()
+        operator RefPtr<Error>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<Error>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<Error>*>(&result));
+        PassRefPtr<Error> release()
+        {
+            return RefPtr<Error>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<Error> result = Error::create()
+     * RefPtr<Error> result = Error::create()
      *     .setMessage(...)
-     *     .setCode(...)
-     *     .release();
+     *     .setCode(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 class OptionalParameterBundle : public Inspector::InspectorObjectBase {
@@ -446,37 +452,40 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*OptionalParameterBundle*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*OptionalParameterBundle*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class OptionalParameterBundle;
     public:
 
-        Ref<OptionalParameterBundle> release()
+        operator RefPtr<OptionalParameterBundle>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(OptionalParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<OptionalParameterBundle>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<OptionalParameterBundle>*>(&result));
+        PassRefPtr<OptionalParameterBundle> release()
+        {
+            return RefPtr<OptionalParameterBundle>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<OptionalParameterBundle> result = OptionalParameterBundle::create()
-     *     .release();
+     * RefPtr<OptionalParameterBundle> result = OptionalParameterBundle::create();
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 
-    void setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value)
+    void setColumnNames(PassRefPtr<Inspector::Protocol::Array<String>> value)
     {
-        InspectorObjectBase::setArray(ASCIILiteral("columnNames"), WTF::move(value));
+        InspectorObjectBase::setArray(ASCIILiteral("columnNames"), value);
     }
 
     void setNotes(const String& value)
@@ -489,19 +498,19 @@ public:
         InspectorObjectBase::setDouble(ASCIILiteral("timestamp"), value);
     }
 
-    void setValues(RefPtr<Inspector::InspectorObject> value)
+    void setValues(PassRefPtr<Inspector::InspectorObject> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("values"), WTF::move(value));
+        InspectorObjectBase::setObject(ASCIILiteral("values"), value);
     }
 
-    void setPayload(RefPtr<Inspector::InspectorValue> value)
+    void setPayload(PassRefPtr<Inspector::InspectorValue> value)
     {
-        InspectorObjectBase::setValue(ASCIILiteral("payload"), WTF::move(value));
+        InspectorObjectBase::setValue(ASCIILiteral("payload"), value);
     }
 
-    void setError(RefPtr<Inspector::Protocol::Database::Error> value)
+    void setError(PassRefPtr<Inspector::Protocol::Database::Error> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("error"), WTF::move(value));
+        InspectorObjectBase::setObject(ASCIILiteral("error"), value);
     }
 };
 
@@ -528,15 +537,15 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*ParameterBundle*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*ParameterBundle*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class ParameterBundle;
     public:
 
-        Builder<STATE | ColumnNamesSet>& setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value)
+        Builder<STATE | ColumnNamesSet>& setColumnNames(PassRefPtr<Inspector::Protocol::Array<String>> value)
         {
             COMPILE_ASSERT(!(STATE & ColumnNamesSet), property_columnNames_already_set);
             m_result->setArray(ASCIILiteral("columnNames"), value);
@@ -557,52 +566,55 @@ public:
             return castState<TimestampSet>();
         }
 
-        Builder<STATE | ValuesSet>& setValues(RefPtr<Inspector::InspectorObject> value)
+        Builder<STATE | ValuesSet>& setValues(PassRefPtr<Inspector::InspectorObject> value)
         {
             COMPILE_ASSERT(!(STATE & ValuesSet), property_values_already_set);
             m_result->setObject(ASCIILiteral("values"), value);
             return castState<ValuesSet>();
         }
 
-        Builder<STATE | PayloadSet>& setPayload(RefPtr<Inspector::InspectorValue> value)
+        Builder<STATE | PayloadSet>& setPayload(PassRefPtr<Inspector::InspectorValue> value)
         {
             COMPILE_ASSERT(!(STATE & PayloadSet), property_payload_already_set);
             m_result->setValue(ASCIILiteral("payload"), value);
             return castState<PayloadSet>();
         }
 
-        Builder<STATE | ErrorSet>& setError(RefPtr<Inspector::Protocol::Database::Error> value)
+        Builder<STATE | ErrorSet>& setError(PassRefPtr<Inspector::Protocol::Database::Error> value)
         {
             COMPILE_ASSERT(!(STATE & ErrorSet), property_error_already_set);
             m_result->setObject(ASCIILiteral("error"), value);
             return castState<ErrorSet>();
         }
 
-        Ref<ParameterBundle> release()
+        operator RefPtr<ParameterBundle>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<ParameterBundle>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<ParameterBundle>*>(&result));
+        PassRefPtr<ParameterBundle> release()
+        {
+            return RefPtr<ParameterBundle>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<ParameterBundle> result = ParameterBundle::create()
+     * RefPtr<ParameterBundle> result = ParameterBundle::create()
      *     .setColumnNames(...)
      *     .setNotes(...)
      *     .setTimestamp(...)
      *     .setValues(...)
      *     .setPayload(...)
-     *     .setError(...)
-     *     .release();
+     *     .setError(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 /* Conflicted names may cause generated getters/setters to clash with built-in InspectorObject methods. */
@@ -628,10 +640,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*ObjectWithPropertyNameConflicts*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*ObjectWithPropertyNameConflicts*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class ObjectWithPropertyNameConflicts;
     public:
@@ -671,30 +683,33 @@ public:
             return castState<ObjectSet>();
         }
 
-        Ref<ObjectWithPropertyNameConflicts> release()
+        operator RefPtr<ObjectWithPropertyNameConflicts>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(ObjectWithPropertyNameConflicts) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<ObjectWithPropertyNameConflicts>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<ObjectWithPropertyNameConflicts>*>(&result));
+        PassRefPtr<ObjectWithPropertyNameConflicts> release()
+        {
+            return RefPtr<ObjectWithPropertyNameConflicts>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<ObjectWithPropertyNameConflicts> result = ObjectWithPropertyNameConflicts::create()
+     * RefPtr<ObjectWithPropertyNameConflicts> result = ObjectWithPropertyNameConflicts::create()
      *     .setInteger(...)
      *     .setArray(...)
      *     .setString(...)
      *     .setValue(...)
-     *     .setObject(...)
-     *     .release();
+     *     .setObject(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Database
@@ -723,15 +738,15 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*ParameterBundle*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*ParameterBundle*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class ParameterBundle;
     public:
 
-        Builder<STATE | ColumnNamesSet>& setColumnNames(RefPtr<Inspector::Protocol::Array<String>> value)
+        Builder<STATE | ColumnNamesSet>& setColumnNames(PassRefPtr<Inspector::Protocol::Array<String>> value)
         {
             COMPILE_ASSERT(!(STATE & ColumnNamesSet), property_columnNames_already_set);
             m_result->setArray(ASCIILiteral("columnNames"), value);
@@ -752,52 +767,55 @@ public:
             return castState<TimestampSet>();
         }
 
-        Builder<STATE | ValuesSet>& setValues(RefPtr<Inspector::InspectorObject> value)
+        Builder<STATE | ValuesSet>& setValues(PassRefPtr<Inspector::InspectorObject> value)
         {
             COMPILE_ASSERT(!(STATE & ValuesSet), property_values_already_set);
             m_result->setObject(ASCIILiteral("values"), value);
             return castState<ValuesSet>();
         }
 
-        Builder<STATE | PayloadSet>& setPayload(RefPtr<Inspector::InspectorValue> value)
+        Builder<STATE | PayloadSet>& setPayload(PassRefPtr<Inspector::InspectorValue> value)
         {
             COMPILE_ASSERT(!(STATE & PayloadSet), property_payload_already_set);
             m_result->setValue(ASCIILiteral("payload"), value);
             return castState<PayloadSet>();
         }
 
-        Builder<STATE | ErrorSet>& setError(RefPtr<Inspector::Protocol::Database::Error> value)
+        Builder<STATE | ErrorSet>& setError(PassRefPtr<Inspector::Protocol::Database::Error> value)
         {
             COMPILE_ASSERT(!(STATE & ErrorSet), property_error_already_set);
             m_result->setObject(ASCIILiteral("error"), value);
             return castState<ErrorSet>();
         }
 
-        Ref<ParameterBundle> release()
+        operator RefPtr<ParameterBundle>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<ParameterBundle>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<ParameterBundle>*>(&result));
+        PassRefPtr<ParameterBundle> release()
+        {
+            return RefPtr<ParameterBundle>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<ParameterBundle> result = ParameterBundle::create()
+     * RefPtr<ParameterBundle> result = ParameterBundle::create()
      *     .setColumnNames(...)
      *     .setNotes(...)
      *     .setTimestamp(...)
      *     .setValues(...)
      *     .setPayload(...)
-     *     .setError(...)
-     *     .release();
+     *     .setError(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 } // Test
@@ -1313,6 +1331,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index a54c951..76d01ed 100644 (file)
@@ -41,10 +41,10 @@ namespace Inspector {
 
 class AlternateInspectorBackendDispatcher {
 public:
-    void setBackendDispatcher(Ref<InspectorBackendDispatcher>&& dispatcher) { m_backendDispatcher = WTF::move(dispatcher); }
-    const InspectorBackendDispatcher& backendDispatcher() const { return m_backendDispatcher.get(); }
+    void setBackendDispatcher(PassRefPtr<InspectorBackendDispatcher> dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
 private:
-    Ref<InspectorBackendDispatcher> m_backendDispatcher;
+    RefPtr<InspectorBackendDispatcher> m_backendDispatcher;
 };
 
 
@@ -131,6 +131,7 @@ InspectorBackend.registerEnum("Test.CastedAnimals", {Ducks: "Ducks", Hens: "Hens
 
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -239,6 +240,7 @@ namespace Inspector {
 #include "InspectorProtocolObjects.h"
 #include <inspector/InspectorFrontendChannel.h>
 #include <inspector/InspectorValues.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -336,6 +338,7 @@ namespace Inspector {
 
 #include <inspector/InspectorProtocolTypes.h>
 #include <wtf/Assertions.h>
+#include <wtf/PassRefPtr.h>
 
 namespace Inspector {
 
@@ -393,10 +396,10 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*TypeNeedingCast*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*TypeNeedingCast*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class TypeNeedingCast;
     public:
@@ -429,37 +432,40 @@ public:
             return castState<IdSet>();
         }
 
-        Builder<STATE | TreeSet>& setTree(RefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
+        Builder<STATE | TreeSet>& setTree(PassRefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
         {
             COMPILE_ASSERT(!(STATE & TreeSet), property_tree_already_set);
             m_result->setObject(ASCIILiteral("tree"), value);
             return castState<TreeSet>();
         }
 
-        Ref<TypeNeedingCast> release()
+        operator RefPtr<TypeNeedingCast>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(TypeNeedingCast) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<TypeNeedingCast>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<TypeNeedingCast>*>(&result));
+        PassRefPtr<TypeNeedingCast> release()
+        {
+            return RefPtr<TypeNeedingCast>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<TypeNeedingCast> result = TypeNeedingCast::create()
+     * RefPtr<TypeNeedingCast> result = TypeNeedingCast::create()
      *     .setString(...)
      *     .setNumber(...)
      *     .setAnimals(...)
      *     .setId(...)
-     *     .setTree(...)
-     *     .release();
+     *     .setTree(...);
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 };
 
 /*  */
@@ -493,37 +499,40 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*RecursiveObject1*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*RecursiveObject1*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class RecursiveObject1;
     public:
 
-        Ref<RecursiveObject1> release()
+        operator RefPtr<RecursiveObject1>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(RecursiveObject1) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<RecursiveObject1>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<RecursiveObject1>*>(&result));
+        PassRefPtr<RecursiveObject1> release()
+        {
+            return RefPtr<RecursiveObject1>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<RecursiveObject1> result = RecursiveObject1::create()
-     *     .release();
+     * RefPtr<RecursiveObject1> result = RecursiveObject1::create();
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 
-    void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject2> value)
+    void setObj(PassRefPtr<Inspector::Protocol::Test::RecursiveObject2> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("obj"), WTF::move(value));
+        InspectorObjectBase::setObject(ASCIILiteral("obj"), value);
     }
 };
 
@@ -544,37 +553,40 @@ public:
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*RecursiveObject2*/Inspector::InspectorObject>&& object)
-            : m_result(WTF::move(object))
+        Builder(PassRefPtr</*RecursiveObject2*/Inspector::InspectorObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
         }
         friend class RecursiveObject2;
     public:
 
-        Ref<RecursiveObject2> release()
+        operator RefPtr<RecursiveObject2>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
             COMPILE_ASSERT(sizeof(RecursiveObject2) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast<RefPtr<RecursiveObject2>*>(&m_result);
+        }
 
-            Ref<Inspector::InspectorObject> result = m_result.releaseNonNull();
-            return WTF::move(*reinterpret_cast<Ref<RecursiveObject2>*>(&result));
+        PassRefPtr<RecursiveObject2> release()
+        {
+            return RefPtr<RecursiveObject2>(*this).release();
         }
     };
 
     /*
      * Synthetic constructor:
-     * Ref<RecursiveObject2> result = RecursiveObject2::create()
-     *     .release();
+     * RefPtr<RecursiveObject2> result = RecursiveObject2::create();
      */
     static Builder<NoFieldsSet> create()
     {
         return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
     }
+    typedef Inspector::Protocol::StructItemTraits ItemTraits;
 
-    void setObj(RefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
+    void setObj(PassRefPtr<Inspector::Protocol::Test::RecursiveObject1> value)
     {
-        InspectorObjectBase::setObject(ASCIILiteral("obj"), WTF::move(value));
+        InspectorObjectBase::setObject(ASCIILiteral("obj"), value);
     }
 };
 
@@ -586,7 +598,7 @@ static void assertValueHasExpectedType(Inspector::InspectorValue*);
 #endif // !ASSERT_DISABLED
 };
 template<> struct BindingTraits<Inspector::Protocol::Test::TypeNeedingCast> {
-static RefPtr<Inspector::Protocol::Test::TypeNeedingCast> runtimeCast(RefPtr<Inspector::InspectorValue>&& value);
+static PassRefPtr<Inspector::Protocol::Test::TypeNeedingCast> runtimeCast(PassRefPtr<Inspector::InspectorValue> value);
 #if !ASSERT_DISABLED
 static void assertValueHasExpectedType(Inspector::InspectorValue*);
 #endif // !ASSERT_DISABLED
@@ -672,7 +684,6 @@ String getEnumConstantValue(int code) {
 #if !ASSERT_DISABLED
 void BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpectedType(Inspector::InspectorValue* value)
 {
-    ASSERT_ARG(value, value);
     String result;
     bool castSucceeded = value->asString(result);
     ASSERT(castSucceeded);
@@ -683,7 +694,6 @@ void BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpe
 #if !ASSERT_DISABLED
 void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasExpectedType(Inspector::InspectorValue* value)
 {
-    ASSERT_ARG(value, value);
     RefPtr<InspectorObject> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
@@ -719,7 +729,7 @@ void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasEx
 }
 #endif // !ASSERT_DISABLED
 
-RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::runtimeCast(RefPtr<Inspector::InspectorValue>&& value)
+PassRefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::runtimeCast(PassRefPtr<Inspector::InspectorValue> value)
 {
     RefPtr<Inspector::InspectorObject> result;
     bool castSucceeded = value->asObject(result);
@@ -735,7 +745,6 @@ RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Prot
 #if !ASSERT_DISABLED
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(Inspector::InspectorValue* value)
 {
-    ASSERT_ARG(value, value);
     RefPtr<InspectorObject> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
@@ -756,7 +765,6 @@ void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasE
 #if !ASSERT_DISABLED
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(Inspector::InspectorValue* value)
 {
-    ASSERT_ARG(value, value);
     RefPtr<InspectorObject> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
@@ -1248,6 +1256,7 @@ __attribute__((visibility ("default")))
 #import "RWIProtocolEnumConversionHelpers.h"
 #import <JavaScriptCore/InspectorValues.h>
 #import <wtf/Assertions.h>
+#import <wtf/PassRefPtr.h>
 
 using namespace Inspector;
 
index 727eba1..c71dbc6 100644 (file)
@@ -37,22 +37,22 @@ using namespace Inspector;
 
 namespace JSC {
 
-RefPtr<InspectorObject> EncodedValue::asObject()
+PassRefPtr<InspectorObject> EncodedValue::asObject()
 {
     RefPtr<InspectorObject> result;
     bool castSucceeded = m_value->asObject(result);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
-    return result;
+    return result.release();
 }
 
-RefPtr<InspectorArray> EncodedValue::asArray()
+PassRefPtr<InspectorArray> EncodedValue::asArray()
 {
     RefPtr<InspectorArray> result;
     bool castSucceeded = m_value->asArray(result);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
-    return result;
+    return result.release();
 }
 
 EncodedValue EncodingTraits<Vector<char>>::encodeValue(const Vector<char>& buffer)
@@ -175,23 +175,23 @@ template<> String EncodedValue::convertTo<String>()
 template<>
 void EncodedValue::put<EncodedValue>(const String& key, const typename EncodingTraits<EncodedValue>::DecodedType& value)
 {
-    asObject()->setValue(key, value.m_value.copyRef());
+    asObject()->setValue(key, value.m_value);
 }
 
 template<>
 void EncodedValue::append<EncodedValue>(const typename EncodingTraits<EncodedValue>::DecodedType& value)
 {
-    asArray()->pushValue(value.m_value.copyRef());
+    asArray()->pushValue(value.m_value);
 }
 
 template<>
 bool EncodedValue::get<EncodedValue>(const String& key, typename EncodingTraits<EncodedValue>::DecodedType& decodedValue)
 {
-    RefPtr<Inspector::InspectorValue> value;
-    if (!asObject()->getValue(key, value))
+    RefPtr<Inspector::InspectorValue> inspectorValue(asObject()->get(key));
+    if (!inspectorValue)
         return false;
 
-    decodedValue = EncodedValue(WTF::move(value));
+    decodedValue = EncodedValue(inspectorValue);
     return true;
 }
 
index 8659b4f..c0010e8 100644 (file)
@@ -41,7 +41,7 @@ template<typename T> struct EncodingTraits;
 
 class EncodedValue final {
 public:
-    explicit EncodedValue(RefPtr<Inspector::InspectorValue>&& value)
+    explicit EncodedValue(PassRefPtr<Inspector::InspectorValue> value)
         : m_value(value) { }
 
     EncodedValue()
@@ -78,8 +78,8 @@ public:
 
     template<typename T> T convertTo();
 
-    JS_EXPORT_PRIVATE RefPtr<Inspector::InspectorObject> asObject();
-    JS_EXPORT_PRIVATE RefPtr<Inspector::InspectorArray> asArray();
+    JS_EXPORT_PRIVATE PassRefPtr<Inspector::InspectorObject> asObject();
+    JS_EXPORT_PRIVATE PassRefPtr<Inspector::InspectorArray> asArray();
 
 private:
     RefPtr<Inspector::InspectorValue> m_value;
index 65f549a..df9b967 100644 (file)
@@ -341,13 +341,13 @@ class Type:
         if self.mode == TypeModes.SCALAR:
             return self.type_name(qualified)
         elif self.mode == TypeModes.SHARED:
-            return "RefPtr<%s>" % self.type_name(qualified)
+            return "PassRefPtr<%s>" % self.type_name(qualified)
         else:
             return "const %s&" % self.type_name(qualified)
 
     def argument_type(self, qualified=False):
         if self.mode == TypeModes.SHARED:
-            return "RefPtr<%s>&&" % self.type_name(qualified)
+            return "PassRefPtr<%s>" % self.type_name(qualified)
         else:
             return self.storage_type()
 
@@ -939,7 +939,7 @@ class Generator:
 
     def generate_member_move_expression(self, _member):
         _type = self._model.get_type_for_member(_member)
-        if _type.mode in [TypeModes.OWNED, TypeModes.SHARED]:
+        if _type.mode == TypeModes.OWNED:
             return "WTF::move(%s)" % _member.memberName
         else:
             return _member.memberName
index b766368..c1b9f11 100644 (file)
@@ -141,7 +141,7 @@ void ConsoleClient::printConsoleMessage(MessageSource source, MessageType type,
     WTFLogAlways("%s", builder.toString().utf8().data());
 }
 
-void ConsoleClient::printConsoleMessageWithArguments(MessageSource source, MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& prpArguments)
+void ConsoleClient::printConsoleMessageWithArguments(MessageSource source, MessageType type, MessageLevel level, JSC::ExecState* exec, PassRefPtr<ScriptArguments> prpArguments)
 {
     RefPtr<ScriptArguments> arguments = prpArguments;
 
@@ -186,7 +186,7 @@ void ConsoleClient::printConsoleMessageWithArguments(MessageSource source, Messa
     }
 }
 
-void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& prpArguments, ArgumentRequirement argumentRequirement)
+void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, PassRefPtr<ScriptArguments> prpArguments, ArgumentRequirement argumentRequirement)
 {
     RefPtr<ScriptArguments> arguments = prpArguments;
     if (argumentRequirement == ArgumentRequired && !arguments->argumentCount())
@@ -195,57 +195,57 @@ void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLev
     messageWithTypeAndLevel(type, level, exec, arguments.release());
 }
 
-void ConsoleClient::logWithLevel(ExecState* exec, RefPtr<ScriptArguments>&& arguments, MessageLevel level)
+void ConsoleClient::logWithLevel(ExecState* exec, PassRefPtr<ScriptArguments> arguments, MessageLevel level)
 {
-    internalMessageWithTypeAndLevel(MessageType::Log, level, exec, WTF::move(arguments), ArgumentRequired);
+    internalMessageWithTypeAndLevel(MessageType::Log, level, exec, arguments, ArgumentRequired);
 }
 
-void ConsoleClient::clear(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::clear(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::Clear, MessageLevel::Log, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::Clear, MessageLevel::Log, exec, arguments, ArgumentNotRequired);
 }
 
-void ConsoleClient::dir(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::dir(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::Dir, MessageLevel::Log, exec, WTF::move(arguments), ArgumentRequired);
+    internalMessageWithTypeAndLevel(MessageType::Dir, MessageLevel::Log, exec, arguments, ArgumentRequired);
 }
 
-void ConsoleClient::dirXML(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::dirXML(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::DirXML, MessageLevel::Log, exec, WTF::move(arguments), ArgumentRequired);
+    internalMessageWithTypeAndLevel(MessageType::DirXML, MessageLevel::Log, exec, arguments, ArgumentRequired);
 }
 
-void ConsoleClient::table(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::table(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::Table, MessageLevel::Log, exec, WTF::move(arguments), ArgumentRequired);
+    internalMessageWithTypeAndLevel(MessageType::Table, MessageLevel::Log, exec, arguments, ArgumentRequired);
 }
 
-void ConsoleClient::trace(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::trace(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::Trace, MessageLevel::Log, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::Trace, MessageLevel::Log, exec, arguments, ArgumentNotRequired);
 }
 
-void ConsoleClient::assertCondition(ExecState* exec, RefPtr<ScriptArguments>&& arguments, bool condition)
+void ConsoleClient::assertCondition(ExecState* exec, PassRefPtr<ScriptArguments> arguments, bool condition)
 {
     if (condition)
         return;
 
-    internalMessageWithTypeAndLevel(MessageType::Assert, MessageLevel::Error, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::Assert, MessageLevel::Error, exec, arguments, ArgumentNotRequired);
 }
 
-void ConsoleClient::group(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::group(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::StartGroup, MessageLevel::Log, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::StartGroup, MessageLevel::Log, exec, arguments, ArgumentNotRequired);
 }
 
-void ConsoleClient::groupCollapsed(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::groupCollapsed(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::StartGroupCollapsed, MessageLevel::Log, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::StartGroupCollapsed, MessageLevel::Log, exec, arguments, ArgumentNotRequired);
 }
 
-void ConsoleClient::groupEnd(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::groupEnd(ExecState* exec, PassRefPtr<ScriptArguments> arguments)
 {
-    internalMessageWithTypeAndLevel(MessageType::EndGroup, MessageLevel::Log, exec, WTF::move(arguments), ArgumentNotRequired);
+    internalMessageWithTypeAndLevel(MessageType::EndGroup, MessageLevel::Log, exec, arguments, ArgumentNotRequired);
 }
 
 } // namespace JSC
index a16b85b..8f4f193 100644 (file)
@@ -42,30 +42,30 @@ public:
     virtual ~ConsoleClient() { }
 
     JS_EXPORT_PRIVATE static void printConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned lineNumber, unsigned columnNumber);
-    JS_EXPORT_PRIVATE static void printConsoleMessageWithArguments(MessageSource, MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+    JS_EXPORT_PRIVATE static void printConsoleMessageWithArguments(MessageSource, MessageType, MessageLevel, JSC::ExecState*, PassRefPtr<Inspector::ScriptArguments>);
 
-    void logWithLevel(ExecState*, RefPtr<Inspector::ScriptArguments>&&, MessageLevel);
-    void clear(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void dir(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void dirXML(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void table(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void trace(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void assertCondition(ExecState*, RefPtr<Inspector::ScriptArguments>&&, bool condition);
-    void group(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void groupCollapsed(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void groupEnd(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+    void logWithLevel(ExecState*, PassRefPtr<Inspector::ScriptArguments>, MessageLevel);
+    void clear(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void dir(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void dirXML(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void table(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void trace(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void assertCondition(ExecState*, PassRefPtr<Inspector::ScriptArguments>, bool condition);
+    void group(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void groupCollapsed(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
+    void groupEnd(ExecState*, PassRefPtr<Inspector::ScriptArguments>);
 
-    virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
-    virtual void count(ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
+    virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, PassRefPtr<Inspector::ScriptArguments>) = 0;
+    virtual void count(ExecState*, PassRefPtr<Inspector::ScriptArguments>) = 0;
     virtual void profile(ExecState*, const String& title) = 0;
     virtual void profileEnd(ExecState*, const String& title) = 0;
     virtual void time(ExecState*, const String& title) = 0;
     virtual void timeEnd(ExecState*, const String& title) = 0;
-    virtual void timeStamp(ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
+    virtual void timeStamp(ExecState*, PassRefPtr<Inspector::ScriptArguments>) = 0;
 
 private:
     enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired };
-    void internalMessageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&, ArgumentRequirement);
+    void internalMessageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, PassRefPtr<Inspector::ScriptArguments>, ArgumentRequirement);
 };
 
 } // namespace JSC
index 2a552f8..310f64d 100644 (file)
@@ -237,17 +237,17 @@ String TypeSet::leastCommonAncestor() const
 }
 
 #if ENABLE(INSPECTOR)
-Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>> TypeSet::allStructureRepresentations() const
+PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>> TypeSet::allStructureRepresentations() const
 {
-    auto description = Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>::create();
+    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>> description = Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>::create();
 
     for (size_t i = 0; i < m_structureHistory.size(); i++)
         description->addItem(m_structureHistory.at(i)->inspectorRepresentation());
 
-    return WTF::move(description);
+    return description.release();
 }
 
-Ref<Inspector::Protocol::Runtime::TypeSet> TypeSet::inspectorTypeSet() const
+PassRefPtr<Inspector::Protocol::Runtime::TypeSet> TypeSet::inspectorTypeSet() const
 {
     return Inspector::Protocol::Runtime::TypeSet::create()
         .setIsFunction((m_seenTypes & TypeFunction) != TypeNothing)
@@ -511,11 +511,11 @@ String StructureShape::toJSONString() const
 }
 
 #if ENABLE(INSPECTOR)
-Ref<Inspector::Protocol::Runtime::StructureDescription> StructureShape::inspectorRepresentation()
+PassRefPtr<Inspector::Protocol::Runtime::StructureDescription> StructureShape::inspectorRepresentation()
 {
-    auto base = Inspector::Protocol::Runtime::StructureDescription::create().release();
-    Ref<Inspector::Protocol::Runtime::StructureDescription> currentObject = base.copyRef();
-    RefPtr<StructureShape> currentShape(this);
+    RefPtr<Inspector::Protocol::Runtime::StructureDescription> base = Inspector::Protocol::Runtime::StructureDescription::create();
+    RefPtr<Inspector::Protocol::Runtime::StructureDescription> currentObject = base;
+    RefPtr<StructureShape> currentShape = this;
 
     while (currentShape) {
         auto fields = Inspector::Protocol::Array<String>::create();
@@ -525,21 +525,21 @@ Ref<Inspector::Protocol::Runtime::StructureDescription> StructureShape::inspecto
         for (auto field : currentShape->m_optionalFields)
             optionalFields->addItem(field.get());
 
-        currentObject->setFields(&fields.get());
-        currentObject->setOptionalFields(&optionalFields.get());
+        currentObject->setFields(fields);
+        currentObject->setOptionalFields(optionalFields);
         currentObject->setConstructorName(currentShape->m_constructorName);
         currentObject->setIsImprecise(currentShape->m_isInDictionaryMode);
 
         if (currentShape->m_proto) {
-            auto nextObject = Inspector::Protocol::Runtime::StructureDescription::create().release();
-            currentObject->setPrototypeStructure(&nextObject.get());
-            currentObject = WTF::move(nextObject);
+            RefPtr<Inspector::Protocol::Runtime::StructureDescription> nextObject = Inspector::Protocol::Runtime::StructureDescription::create();
+            currentObject->setPrototypeStructure(nextObject);
+            currentObject = nextObject;
         }
 
         currentShape = currentShape->m_proto;
     }
 
-    return WTF::move(base);
+    return base.release();
 }
 #endif
 
index 1ca3918..b2c8107 100644 (file)
@@ -72,7 +72,7 @@ public:
     void addProperty(RefPtr<StringImpl>);
     String stringRepresentation();
     String toJSONString() const;
-    Ref<Inspector::Protocol::Runtime::StructureDescription> inspectorRepresentation();
+    PassRefPtr<Inspector::Protocol::Runtime::StructureDescription> inspectorRepresentation();
     void setConstructorName(String name) { m_constructorName = (name.isEmpty() ? "Object" : name); }
     String constructorName() { return m_constructorName; }
     void setProto(PassRefPtr<StructureShape> shape) { m_proto = shape; }
@@ -102,11 +102,11 @@ public:
     void invalidateCache();
     String dumpTypes() const;
     String displayName() const;
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>> allStructureRepresentations() const;
+    PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescription>> allStructureRepresentations() const;
     String toJSONString() const;
     bool isOverflown() const { return m_isOverflown; }
     String leastCommonAncestor() const;
-    Ref<Inspector::Protocol::Runtime::TypeSet> inspectorTypeSet() const;
+    PassRefPtr<Inspector::Protocol::Runtime::TypeSet> inspectorTypeSet() const;
     bool isEmpty() const { return m_seenTypes == TypeNothing; }
     bool doesTypeConformTo(uint32_t test) const;
     uint32_t seenTypes() const { return m_seenTypes; }
index 2bc2993..964fe98 100644 (file)
@@ -1,3 +1,18 @@
+2015-01-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r178039.
+        https://bugs.webkit.org/show_bug.cgi?id=140187
+
+        Breaks ObjC Inspector Protocol (Requested by JoePeck on
+        #webkit).
+
+        Reverted changeset:
+
+        "Web Inspector: purge PassRefPtr from Inspector code and use
+        Ref for typed and untyped protocol objects"
+        https://bugs.webkit.org/show_bug.cgi?id=140053
+        http://trac.webkit.org/changeset/178039
+
 2015-01-06  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
index 9cba9a1..4213911 100644 (file)
@@ -33,9 +33,9 @@ namespace WTF {
 
 class Stopwatch : public RefCounted<Stopwatch> {
 public:
-    static Ref<Stopwatch> create()
+    static PassRefPtr<Stopwatch> create()
     {
-        return adoptRef(*new Stopwatch());
+        return adoptRef(new Stopwatch());
     }
 
     void reset();
index caa8516..0cad320 100644 (file)
@@ -1,3 +1,17 @@
+2015-01-07  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r178039.
+        https://bugs.webkit.org/show_bug.cgi?id=140187
+
+        Breaks ObjC Inspector Protocol (Requested by JoePeck on
+        #webkit).
+
+        Reverted changeset:
+
+        "Web Inspector: purge PassRefPtr from Inspector code and use
+        Ref for typed and untyped protocol objects"
+        https://bugs.webkit.org/show_bug.cgi?id=140053
+        http://trac.webkit.org/changeset/178039
 
 2015-01-06  Brian J. Burg  <burg@cs.washington.edu>
 
index 50ef009..b9d5912 100644 (file)
@@ -307,7 +307,7 @@ PassRefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* conte
 
     RefPtr<DatabaseContext> databaseContext = databaseContextFor(context);
     databaseContext->setHasOpenDatabases();
-    InspectorInstrumentation::didOpenDatabase(context, database.copyRef(), context->securityOrigin()->host(), name, expectedVersion);
+    InspectorInstrumentation::didOpenDatabase(context, database, context->securityOrigin()->host(), name, expectedVersion);
 
     if (backend->isNew() && creationCallback.get()) {
         LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
index 2553e7a..6b45e9b 100644 (file)
@@ -2614,9 +2614,9 @@ EventTarget* Document::errorEventTarget()
     return m_domWindow.get();
 }
 
-void Document::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&& callStack)
+void Document::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<Inspector::ScriptCallStack> callStack)
 {
-    addMessage(MessageSource::JS, MessageLevel::Error, errorMessage, sourceURL, lineNumber, columnNumber, WTF::move(callStack));
+    addMessage(MessageSource::JS, MessageLevel::Error, errorMessage, sourceURL, lineNumber, columnNumber, callStack);
 }
 
 void Document::setURL(const URL& url)
@@ -4975,7 +4975,7 @@ void Document::addConsoleMessage(MessageSource source, MessageLevel level, const
         page->console().addMessage(source, level, message, requestIdentifier, this);
 }
 
-void Document::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&& callStack, JSC::ExecState* state, unsigned long requestIdentifier)
+void Document::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<Inspector::ScriptCallStack> callStack, JSC::ExecState* state, unsigned long requestIdentifier)
 {
     if (!isContextThread()) {
         postTask(AddConsoleMessageTask(source, level, StringCapture(message)));
@@ -4983,7 +4983,7 @@ void Document::addMessage(MessageSource source, MessageLevel level, const String
     }
 
     if (Page* page = this->page())
-        page->console().addMessage(source, level, message, sourceURL, lineNumber, columnNumber, WTF::move(callStack), state, requestIdentifier);
+        page->console().addMessage(source, level, message, sourceURL, lineNumber, columnNumber, callStack, state, requestIdentifier);
 }
 
 SecurityOrigin* Document::topOrigin() const
index f1b7d3f..9836ea9 100644 (file)
@@ -1179,7 +1179,7 @@ public:
     void sendWillRevealEdgeEventsIfNeeded(const IntPoint& oldPosition, const IntPoint& newPosition, const IntRect& visibleRect, const IntSize& contentsSize, Element* target = nullptr);
 
     virtual EventTarget* errorEventTarget() override final;
-    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) override final;
+    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<Inspector::ScriptCallStack>) override final;
 
     void initDNSPrefetch();
 
@@ -1317,7 +1317,7 @@ private:
     virtual void refScriptExecutionContext() override final { ref(); }
     virtual void derefScriptExecutionContext() override final { deref(); }
 
-    virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = 0, unsigned long requestIdentifier = 0) override final;
+    virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<Inspector::ScriptCallStack>, JSC::ExecState* = 0, unsigned long requestIdentifier = 0) override final;
 
     virtual double minimumTimerInterval() const override final;
 
index 1a0637f..b2db591 100644 (file)
@@ -350,25 +350,25 @@ bool ScriptExecutionContext::sanitizeScriptError(String& errorMessage, int& line
     return true;
 }
 
-void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, RefPtr<ScriptCallStack>&& callStack, CachedScript* cachedScript)
+void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack, CachedScript* cachedScript)
 {
     if (m_inDispatchErrorEvent) {
         if (!m_pendingExceptions)
             m_pendingExceptions = std::make_unique<Vector<std::unique_ptr<PendingException>>>();
-        m_pendingExceptions->append(std::make_unique<PendingException>(errorMessage, lineNumber, columnNumber, sourceURL, callStack.copyRef()));
+        m_pendingExceptions->append(std::make_unique<PendingException>(errorMessage, lineNumber, columnNumber, sourceURL, callStack));
         return;
     }
 
     // First report the original exception and only then all the nested ones.
     if (!dispatchErrorEvent(errorMessage, lineNumber, columnNumber, sourceURL, cachedScript))
-        logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack.copyRef());
+        logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack);
 
     if (!m_pendingExceptions)
         return;
 
     std::unique_ptr<Vector<std::unique_ptr<PendingException>>> pendingExceptions = WTF::move(m_pendingExceptions);
     for (auto& exception : *pendingExceptions)
-        logExceptionToConsole(exception->m_errorMessage, exception->m_sourceURL, exception->m_lineNumber, exception->m_columnNumber, exception->m_callStack.copyRef());
+        logExceptionToConsole(exception->m_errorMessage, exception->m_sourceURL, exception->m_lineNumber, exception->m_columnNumber, exception->m_callStack);
 }
 
 void ScriptExecutionContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier)
index d9bebbe..2b43ca7 100644 (file)
@@ -76,7 +76,7 @@ public:
     virtual void disableEval(const String& errorMessage) = 0;
 
     bool sanitizeScriptError(String& errorMessage, int& lineNumber, int& columnNumber, String& sourceURL, CachedScript* = nullptr);
-    void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, RefPtr<Inspector::ScriptCallStack>&&, CachedScript* = nullptr);
+    void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<Inspector::ScriptCallStack>, CachedScript* = nullptr);
 
     void addConsoleMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
     virtual void addConsoleMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0) = 0;
@@ -198,9 +198,9 @@ protected:
     bool hasPendingActivity() const;
 
 private:
-    virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) = 0;
+    virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<Inspector::ScriptCallStack>, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) = 0;
     virtual EventTarget* errorEventTarget() = 0;
-    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) = 0;
+    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<Inspector::ScriptCallStack>) = 0;
     bool dispatchErrorEvent(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, CachedScript*);
 
     virtual void refScriptExecutionContext() = 0;
index 04dd043..a32fa08 100644 (file)
@@ -82,12 +82,12 @@ PassRefPtr<FormData> XSSAuditorDelegate::generateViolationReport(const XSSInfo&
             httpBody = formData->flattenToString();
     }
 
-    Ref<InspectorObject> reportDetails = InspectorObject::create();
+    RefPtr<InspectorObject> reportDetails = InspectorObject::create();
     reportDetails->setString("request-url", xssInfo.m_originalURL);
     reportDetails->setString("request-body", httpBody);
 
-    Ref<InspectorObject> reportObject = InspectorObject::create();
-    reportObject->setObject("xss-report", WTF::move(reportDetails));
+    RefPtr<InspectorObject> reportObject = InspectorObject::create();
+    reportObject->setObject("xss-report", reportDetails.release());
 
     return FormData::create(reportObject->toJSONString().utf8().data());
 }
index b464da3..b13d9c1 100644 (file)
@@ -92,7 +92,7 @@ void CommandLineAPIHost::disconnect()
 #endif
 }
 
-void CommandLineAPIHost::inspectImpl(RefPtr<InspectorValue>&& object, RefPtr<InspectorValue>&& hints)
+void CommandLineAPIHost::inspectImpl(PassRefPtr<InspectorValue> object, PassRefPtr<InspectorValue> hints)
 {
     if (!m_inspectorAgent)
         return;
@@ -101,8 +101,8 @@ void CommandLineAPIHost::inspectImpl(RefPtr<InspectorValue>&& object, RefPtr<Ins
     if (!hints->asObject(hintsObject))
         return;
 
-    auto remoteObject = BindingTraits<Inspector::Protocol::Runtime::RemoteObject>::runtimeCast(WTF::move(object));
-    m_inspectorAgent->inspect(WTF::move(remoteObject), WTF::move(hintsObject));
+    RefPtr<Inspector::Protocol::Runtime::RemoteObject> remoteObject = BindingTraits<Inspector::Protocol::Runtime::RemoteObject>::runtimeCast(object);
+    m_inspectorAgent->inspect(remoteObject.release(), hintsObject.release());
 }
 
 void CommandLineAPIHost::getEventListenersImpl(Node* node, Vector<EventListenerInfo>& listenersArray)
index 31e6c62..b03f196 100644 (file)
@@ -95,7 +95,7 @@ public:
     void addInspectedObject(std::unique_ptr<InspectableObject>);
     void clearInspectedObjects();
     InspectableObject* inspectedObject(unsigned index);
-    void inspectImpl(RefPtr<Inspector::InspectorValue>&& objectToInspect, RefPtr<Inspector::InspectorValue>&& hints);
+    void inspectImpl(PassRefPtr<Inspector::InspectorValue> objectToInspect, PassRefPtr<Inspector::InspectorValue> hints);
 
     void getEventListenersImpl(Node*, Vector<EventListenerInfo>& listenersArray);
 
index 47d83b9..94d4c78 100644 (file)
@@ -108,12 +108,11 @@ void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString&, RefPtr
         ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
         String manifestURL = info.m_manifest.string();
         if (!manifestURL.isEmpty()) {
-            Ref<Inspector::Protocol::ApplicationCache::FrameWithManifest> value = Inspector::Protocol::ApplicationCache::FrameWithManifest::create()
+            RefPtr<Inspector::Protocol::ApplicationCache::FrameWithManifest> value = Inspector::Protocol::ApplicationCache::FrameWithManifest::create()
                 .setFrameId(m_pageAgent->frameId(frame))
                 .setManifestURL(manifestURL)
-                .setStatus(static_cast<int>(host->status()))
-                .release();
-            result->addItem(WTF::move(value));
+                .setStatus(static_cast<int>(host->status()));
+            result->addItem(value);
         }
     }
 }
@@ -152,7 +151,7 @@ void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString& er
     applicationCache = buildObjectForApplicationCache(resources, info);
 }
 
-Ref<Inspector::Protocol::ApplicationCache::ApplicationCache> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
+PassRefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
 {
     return Inspector::Protocol::ApplicationCache::ApplicationCache::create()
         .setManifestURL(applicationCacheInfo.m_manifest.string())
@@ -163,17 +162,17 @@ Ref<Inspector::Protocol::ApplicationCache::ApplicationCache> InspectorApplicatio
         .release();
 }
 
-Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources)
+PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources)
 {
-    auto resources = Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>::create();
+    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> resources = Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>::create();
 
     for (const auto& resourceInfo : applicationCacheResources)
         resources->addItem(buildObjectForApplicationCacheResource(resourceInfo));
 
-    return WTF::move(resources);
+    return resources;
 }
 
-Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
+PassRefPtr<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
 {
     StringBuilder types;
 
@@ -192,11 +191,11 @@ Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> InspectorAp
     if (resourceInfo.m_isExplicit)
         types.appendLiteral("Explicit ");
 
-    return Inspector::Protocol::ApplicationCache::ApplicationCacheResource::create()
+    RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> value = Inspector::Protocol::ApplicationCache::ApplicationCacheResource::create()
         .setUrl(resourceInfo.m_resource.string())
         .setSize(static_cast<int>(resourceInfo.m_size))
-        .setType(types.toString())
-        .release();
+        .setType(types.toString());
+    return value;
 }
 
 } // namespace WebCore
index c7129d6..bc6febb 100644 (file)
@@ -67,9 +67,9 @@ public:
     virtual void getApplicationCacheForFrame(ErrorString&, const String& frameId, RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache>&) override;
 
 private:
-    Ref<Inspector::Protocol::ApplicationCache::ApplicationCache> buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
-    Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
+    PassRefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache> buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);
+    PassRefPtr<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
+    PassRefPtr<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
 
     DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, String frameId);
 
index f421b46..65f5dc4 100644 (file)
@@ -612,42 +612,40 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString& errorString, int no
 
     // Pseudo elements.
     if (!includePseudo || *includePseudo) {
-        auto pseudoElements = Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>::create();
+        RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>> pseudoElements = Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>::create();
         for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
             auto matchedRules = styleResolver.pseudoStyleRulesForElement(element, pseudoId, StyleResolver::AllCSSRules);
             if (!matchedRules.isEmpty()) {
-                auto matches = Inspector::Protocol::CSS::PseudoIdMatches::create()
+                RefPtr<Inspector::Protocol::CSS::PseudoIdMatches> matches = Inspector::Protocol::CSS::PseudoIdMatches::create()
                     .setPseudoId(static_cast<int>(pseudoId))
-                    .setMatches(buildArrayForMatchedRuleList(matchedRules, styleResolver, element))
-                    .release();
-                pseudoElements->addItem(WTF::move(matches));
+                    .setMatches(buildArrayForMatchedRuleList(matchedRules, styleResolver, element));
+                pseudoElements->addItem(matches.release());
             }
         }
 
-        pseudoIdMatches = WTF::move(pseudoElements);
+        pseudoIdMatches = pseudoElements.release();
     }
 
     // Inherited styles.
     if (!includeInherited || *includeInherited) {
-        auto entries = Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>::create();
+        RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>> entries = Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>::create();
         Element* parentElement = element->parentElement();
         while (parentElement) {
             StyleResolver& parentStyleResolver = parentElement->document().ensureStyleResolver();
             auto parentMatchedRules = parentStyleResolver.styleRulesForElement(parentElement, StyleResolver::AllCSSRules);
-            auto entry = Inspector::Protocol::CSS::InheritedStyleEntry::create()
-                .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules, styleResolver, parentElement))
-                .release();
+            RefPtr<Inspector::Protocol::CSS::InheritedStyleEntry> entry = Inspector::Protocol::CSS::InheritedStyleEntry::create()
+                .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules, styleResolver, parentElement));
             if (parentElement->style() && parentElement->style()->length()) {
                 InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyleSheet(parentElement);
                 if (styleSheet)
                     entry->setInlineStyle(styleSheet->buildObjectForStyle(styleSheet->styleForId(InspectorCSSId(styleSheet->id(), 0))));
             }
 
-            entries->addItem(WTF::move(entry));
+            entries->addItem(entry.release());
             parentElement = parentElement->parentElement();
         }
 
-        inheritedEntries = WTF::move(entries);
+        inheritedEntries = entries.release();
     }
 }
 
@@ -673,7 +671,7 @@ void InspectorCSSAgent::getComputedStyleForNode(ErrorString& errorString, int no
         return;
 
     RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(element, true);
-    Ref<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyleInfo, nullptr);
+    RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyleInfo, nullptr);
     style = inspectorStyle->buildArrayForComputedStyle();
 }
 
@@ -720,9 +718,9 @@ void InspectorCSSAgent::setStyleSheetText(ErrorString& errorString, const String
     errorString = InspectorDOMAgent::toErrorString(ec);
 }
 
-void InspectorCSSAgent::setStyleText(ErrorString& errorString, const RefPtr<InspectorObject>&& fullStyleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
+void InspectorCSSAgent::setStyleText(ErrorString& errorString, const RefPtr<InspectorObject>& fullStyleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
 {
-    InspectorCSSId compoundId(fullStyleId.copyRef());
+    InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
 
     InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
@@ -736,9 +734,9 @@ void InspectorCSSAgent::setStyleText(ErrorString& errorString, const RefPtr<Insp
     errorString = InspectorDOMAgent::toErrorString(ec);
 }
 
-void InspectorCSSAgent::setPropertyText(ErrorString& errorString, const RefPtr<InspectorObject>&& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
+void InspectorCSSAgent::setPropertyText(ErrorString& errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, const String& text, bool overwrite, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
 {
-    InspectorCSSId compoundId(fullStyleId.copyRef());
+    InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
 
     InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
@@ -752,9 +750,9 @@ void InspectorCSSAgent::setPropertyText(ErrorString& errorString, const RefPtr<I
     errorString = InspectorDOMAgent::toErrorString(ec);
 }
 
-void InspectorCSSAgent::toggleProperty(ErrorString& errorString, const RefPtr<InspectorObject>&& fullStyleId, int propertyIndex, bool disable, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
+void InspectorCSSAgent::toggleProperty(ErrorString& errorString, const RefPtr<InspectorObject>& fullStyleId, int propertyIndex, bool disable, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
 {
-    InspectorCSSId compoundId(fullStyleId.copyRef());
+    InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
 
     InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
@@ -768,9 +766,9 @@ void InspectorCSSAgent::toggleProperty(ErrorString& errorString, const RefPtr<In
     errorString = InspectorDOMAgent::toErrorString(ec);
 }
 
-void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const RefPtr<InspectorObject>&& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
+void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const RefPtr<InspectorObject>& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
 {
-