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

Unified Diff: Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp

Issue 297513008: Decrease call sites of ScriptState::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « Source/bindings/v8/V8CustomElementLifecycleCallbacks.h ('k') | Source/bindings/v8/V8MutationCallback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
diff --git a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
index 1a7142285a4335be01861b2d1db6f2c925ca58ad..8fa68ecf2754581e353e99971b7247fd379817a3 100644
--- a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
+++ b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
@@ -50,9 +50,9 @@ namespace WebCore {
V(detached, Detached) \
V(attributeChanged, AttributeChanged)
-PassRefPtr<V8CustomElementLifecycleCallbacks> V8CustomElementLifecycleCallbacks::create(ExecutionContext* executionContext, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> attached, v8::Handle<v8::Function> detached, v8::Handle<v8::Function> attributeChanged)
+PassRefPtr<V8CustomElementLifecycleCallbacks> V8CustomElementLifecycleCallbacks::create(ScriptState* scriptState, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> attached, v8::Handle<v8::Function> detached, v8::Handle<v8::Function> attributeChanged)
{
- v8::Isolate* isolate = toIsolate(executionContext);
+ v8::Isolate* isolate = scriptState->isolate();
// A given object can only be used as a Custom Element prototype
// once; see customElementIsInterfacePrototypeObject
#define SET_HIDDEN_VALUE(Value, Name) \
@@ -63,7 +63,7 @@ PassRefPtr<V8CustomElementLifecycleCallbacks> V8CustomElementLifecycleCallbacks:
CALLBACK_LIST(SET_HIDDEN_VALUE)
#undef SET_HIDDEN_VALUE
- return adoptRef(new V8CustomElementLifecycleCallbacks(executionContext, prototype, created, attached, detached, attributeChanged));
+ return adoptRef(new V8CustomElementLifecycleCallbacks(scriptState, prototype, created, attached, detached, attributeChanged));
}
static CustomElementLifecycleCallbacks::CallbackType flagSet(v8::Handle<v8::Function> attached, v8::Handle<v8::Function> detached, v8::Handle<v8::Function> attributeChanged)
@@ -89,16 +89,16 @@ static void weakCallback(const v8::WeakCallbackData<T, ScopedPersistent<T> >& da
data.GetParameter()->clear();
}
-V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ExecutionContext* executionContext, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> attached, v8::Handle<v8::Function> detached, v8::Handle<v8::Function> attributeChanged)
+V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ScriptState* scriptState, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> attached, v8::Handle<v8::Function> detached, v8::Handle<v8::Function> attributeChanged)
: CustomElementLifecycleCallbacks(flagSet(attached, detached, attributeChanged))
- , ContextLifecycleObserver(executionContext)
+ , ContextLifecycleObserver(scriptState->executionContext())
, m_owner(0)
- , m_scriptState(ScriptState::current(toIsolate(executionContext)))
- , m_prototype(m_scriptState->isolate(), prototype)
- , m_created(m_scriptState->isolate(), created)
- , m_attached(m_scriptState->isolate(), attached)
- , m_detached(m_scriptState->isolate(), detached)
- , m_attributeChanged(m_scriptState->isolate(), attributeChanged)
+ , m_scriptState(scriptState)
+ , m_prototype(scriptState->isolate(), prototype)
+ , m_created(scriptState->isolate(), created)
+ , m_attached(scriptState->isolate(), attached)
+ , m_detached(scriptState->isolate(), detached)
+ , m_attributeChanged(scriptState->isolate(), attributeChanged)
{
m_prototype.setWeak(&m_prototype, weakCallback<v8::Object>);
« no previous file with comments | « Source/bindings/v8/V8CustomElementLifecycleCallbacks.h ('k') | Source/bindings/v8/V8MutationCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698