Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 1745423002: DevTools: migrate protocol values from RefPtr to OwnPtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/InspectorOverlay.cpp
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp
index 01f2fb5b7624f26ebe389bc77370b400040ee56e..3d380b7ea02502132f9a1c66750dd305fb60c99a 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -400,9 +400,9 @@ void InspectorOverlay::rebuildOverlayPage()
m_layoutEditor->rebuild();
}
-static PassRefPtr<protocol::DictionaryValue> buildObjectForSize(const IntSize& size)
+static PassOwnPtr<protocol::DictionaryValue> buildObjectForSize(const IntSize& size)
{
- RefPtr<protocol::DictionaryValue> result = protocol::DictionaryValue::create();
+ OwnPtr<protocol::DictionaryValue> result = protocol::DictionaryValue::create();
result->setNumber("width", size.width());
result->setNumber("height", size.height());
return result.release();
@@ -425,7 +425,7 @@ void InspectorOverlay::drawNodeHighlight()
for (unsigned i = 0; i < elements->length(); ++i) {
Element* element = elements->item(i);
InspectorHighlight highlight(element, m_nodeHighlightConfig, false);
- RefPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
+ OwnPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
evaluateInOverlay("drawHighlight", highlightJSON.release());
}
}
@@ -435,7 +435,7 @@ void InspectorOverlay::drawNodeHighlight()
if (m_eventTargetNode)
highlight.appendEventTargetQuads(m_eventTargetNode.get(), m_nodeHighlightConfig);
- RefPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
+ OwnPtr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
evaluateInOverlay("drawHighlight", highlightJSON.release());
}
@@ -532,7 +532,7 @@ LocalFrame* InspectorOverlay::overlayMainFrame()
void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset)
{
- RefPtr<protocol::DictionaryValue> resetData = protocol::DictionaryValue::create();
+ OwnPtr<protocol::DictionaryValue> resetData = protocol::DictionaryValue::create();
resetData->setNumber("deviceScaleFactor", m_webViewImpl->page()->deviceScaleFactor());
resetData->setNumber("pageScaleFactor", m_webViewImpl->page()->pageScaleFactor());
resetData->setObject("viewportSize", buildObjectForSize(viewportSize));
@@ -545,16 +545,16 @@ void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& docume
void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
{
ScriptForbiddenScope::AllowUserAgentScript allowScript;
- RefPtr<protocol::ListValue> command = protocol::ListValue::create();
+ OwnPtr<protocol::ListValue> command = protocol::ListValue::create();
command->pushValue(protocol::StringValue::create(method));
command->pushValue(protocol::StringValue::create(argument));
toLocalFrame(overlayPage()->mainFrame())->script().executeScriptInMainWorld("dispatch(" + command->toJSONString() + ")", ScriptController::ExecuteScriptWhenScriptsDisabled);
}
-void InspectorOverlay::evaluateInOverlay(const String& method, PassRefPtr<protocol::Value> argument)
+void InspectorOverlay::evaluateInOverlay(const String& method, PassOwnPtr<protocol::Value> argument)
{
ScriptForbiddenScope::AllowUserAgentScript allowScript;
- RefPtr<protocol::ListValue> command = protocol::ListValue::create();
+ OwnPtr<protocol::ListValue> command = protocol::ListValue::create();
command->pushValue(protocol::StringValue::create(method));
command->pushValue(argument);
toLocalFrame(overlayPage()->mainFrame())->script().executeScriptInMainWorld("dispatch(" + command->toJSONString() + ")", ScriptController::ExecuteScriptWhenScriptsDisabled);
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | third_party/WebKit/Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698