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

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

Issue 1419313003: Track the script state a listener was created in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/InjectedScriptNative.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InjectedScriptNative.cpp b/third_party/WebKit/Source/core/inspector/InjectedScriptNative.cpp
index d094aac1e1cb7265d1e4effbf477d7426b369763..63cb5d9fbf8856568177e4c6a66960ae705a932f 100644
--- a/third_party/WebKit/Source/core/inspector/InjectedScriptNative.cpp
+++ b/third_party/WebKit/Source/core/inspector/InjectedScriptNative.cpp
@@ -6,6 +6,7 @@
#include "core/inspector/InjectedScriptNative.h"
+#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "platform/JSONValues.h"
#include "wtf/Vector.h"
@@ -26,14 +27,14 @@ void InjectedScriptNative::setOnInjectedScriptHost(v8::Local<v8::Object> injecte
{
v8::HandleScope handleScope(m_isolate);
v8::Local<v8::External> external = v8::External::New(m_isolate, this);
- V8HiddenValue::setHiddenValue(m_isolate, injectedScriptHost, V8HiddenValue::injectedScriptNative(m_isolate), external);
+ V8HiddenValue::setHiddenValue(ScriptState::current(m_isolate), injectedScriptHost, V8HiddenValue::injectedScriptNative(m_isolate), external);
}
InjectedScriptNative* InjectedScriptNative::fromInjectedScriptHost(v8::Local<v8::Object> injectedScriptObject)
{
v8::Isolate* isolate = injectedScriptObject->GetIsolate();
v8::HandleScope handleScope(isolate);
- v8::Local<v8::Value> value = V8HiddenValue::getHiddenValue(isolate, injectedScriptObject, V8HiddenValue::injectedScriptNative(isolate));
+ v8::Local<v8::Value> value = V8HiddenValue::getHiddenValue(ScriptState::current(isolate), injectedScriptObject, V8HiddenValue::injectedScriptNative(isolate));
ASSERT(!value.IsEmpty());
v8::Local<v8::External> external = value.As<v8::External>();
void* ptr = external->Value();
« no previous file with comments | « third_party/WebKit/Source/core/events/MessageEvent.cpp ('k') | third_party/WebKit/Source/core/inspector/v8/InspectorWrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698