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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptState.h

Issue 2199643003: binding: Uses the current context if attribute/method is static. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptState.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
index 96dc103cacbff36d8343f785d34e79b5e104c4d6..0274349640b06804d8e616d5b90f8eb6e233fe28 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
@@ -52,17 +52,26 @@ public:
static PassRefPtr<ScriptState> create(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>);
virtual ~ScriptState();
- static ScriptState* current(v8::Isolate* isolate)
+ static ScriptState* current(v8::Isolate* isolate) // DEPRECATED
{
return from(isolate->GetCurrentContext());
}
- static ScriptState* forHolderObject(const v8::FunctionCallbackInfo<v8::Value>& info)
+ static ScriptState* forFunctionObject(const v8::FunctionCallbackInfo<v8::Value>& info)
+ {
+ // We're assuming that the current context is not yet changed since
+ // the callback function has got called back.
+ // TODO(yukishiino): Once info.GetFunctionContext() gets implemented,
+ // we should use it instead.
+ return from(info.GetIsolate()->GetCurrentContext());
+ }
+
+ static ScriptState* forReceiverObject(const v8::FunctionCallbackInfo<v8::Value>& info)
{
return from(info.Holder()->CreationContext());
}
- static ScriptState* forHolderObject(const v8::PropertyCallbackInfo<v8::Value>& info)
+ static ScriptState* forReceiverObject(const v8::PropertyCallbackInfo<v8::Value>& info)
{
return from(info.Holder()->CreationContext());
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698