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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp

Issue 1636223002: DevTools: remove ScriptState/Value from the InjectedScript APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 11 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/core/inspector/InspectorConsoleAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
index 7e72022e58528498aa272e343de10939844c4147..298908e68f015ee608d095611eab96140544a069 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
@@ -196,12 +196,13 @@ void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
jsonObj->setNetworkRequestId(IdentifiersFactory::requestId(consoleMessage->requestIdentifier()));
RefPtrWillBeRawPtr<ScriptArguments> arguments = consoleMessage->scriptArguments();
if (arguments && arguments->argumentCount()) {
- InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(arguments->scriptState());
+ ScriptState::Scope scope(arguments->scriptState());
+ InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(arguments->scriptState()->context());
if (injectedScript) {
RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::RemoteObject> > jsonArgs = TypeBuilder::Array<TypeBuilder::Runtime::RemoteObject>::create();
if (consoleMessage->type() == TableMessageType && generatePreview && arguments->argumentCount()) {
- ScriptValue table = arguments->argumentAt(0);
- ScriptValue columns = arguments->argumentCount() > 1 ? arguments->argumentAt(1) : ScriptValue();
+ v8::Local<v8::Value> table = arguments->argumentAt(0).v8Value();
+ v8::Local<v8::Value> columns = arguments->argumentCount() > 1 ? arguments->argumentAt(1).v8Value() : v8::Local<v8::Value>();
RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript->wrapTable(table, columns);
if (!inspectorValue) {
ASSERT_NOT_REACHED();
@@ -210,7 +211,7 @@ void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
jsonArgs->addItem(inspectorValue);
} else {
for (unsigned i = 0; i < arguments->argumentCount(); ++i) {
- RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript->wrapObject(arguments->argumentAt(i), "console", generatePreview);
+ RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript->wrapObject(arguments->argumentAt(i).v8Value(), "console", generatePreview);
if (!inspectorValue) {
ASSERT_NOT_REACHED();
return;

Powered by Google App Engine
This is Rietveld 408576698