OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 template <typename T> | 84 template <typename T> |
85 static void weakCallback(v8::Isolate*, v8::Persistent<T>*, ScopedPersistent<T>*
handle) | 85 static void weakCallback(v8::Isolate*, v8::Persistent<T>*, ScopedPersistent<T>*
handle) |
86 { | 86 { |
87 handle->clear(); | 87 handle->clear(); |
88 } | 88 } |
89 | 89 |
90 V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ScriptExecu
tionContext* scriptExecutionContext, v8::Handle<v8::Object> prototype, v8::Handl
e<v8::Function> created, v8::Handle<v8::Function> enteredView, v8::Handle<v8::Fu
nction> leftView, v8::Handle<v8::Function> attributeChanged) | 90 V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ScriptExecu
tionContext* scriptExecutionContext, v8::Handle<v8::Object> prototype, v8::Handl
e<v8::Function> created, v8::Handle<v8::Function> enteredView, v8::Handle<v8::Fu
nction> leftView, v8::Handle<v8::Function> attributeChanged) |
91 : CustomElementLifecycleCallbacks(flagSet(enteredView, leftView, attributeCh
anged)) | 91 : CustomElementLifecycleCallbacks(flagSet(enteredView, leftView, attributeCh
anged)) |
92 , ActiveDOMCallback(scriptExecutionContext) | 92 , ActiveDOMCallback(scriptExecutionContext) |
93 , m_world(DOMWrapperWorld::current()) | 93 , m_world(DOMWrapperWorld::current()) |
94 , m_prototype(prototype) | 94 , m_prototype(isolateForScriptExecutionContext(scriptExecutionContext), prot
otype) |
95 , m_created(created) | 95 , m_created(isolateForScriptExecutionContext(scriptExecutionContext), create
d) |
96 , m_enteredView(enteredView) | 96 , m_enteredView(isolateForScriptExecutionContext(scriptExecutionContext), en
teredView) |
97 , m_leftView(leftView) | 97 , m_leftView(isolateForScriptExecutionContext(scriptExecutionContext), leftV
iew) |
98 , m_attributeChanged(attributeChanged) | 98 , m_attributeChanged(isolateForScriptExecutionContext(scriptExecutionContext
), attributeChanged) |
99 , m_owner(0) | 99 , m_owner(0) |
100 { | 100 { |
101 m_prototype.makeWeak(&m_prototype, weakCallback<v8::Object>); | 101 m_prototype.makeWeak(&m_prototype, weakCallback<v8::Object>); |
102 | 102 |
103 #define MAKE_WEAK(Var, _) \ | 103 #define MAKE_WEAK(Var, _) \ |
104 if (!m_##Var.isEmpty()) \ | 104 if (!m_##Var.isEmpty()) \ |
105 m_##Var.makeWeak(&m_##Var, weakCallback<v8::Function>); | 105 m_##Var.makeWeak(&m_##Var, weakCallback<v8::Function>); |
106 | 106 |
107 CALLBACK_LIST(MAKE_WEAK) | 107 CALLBACK_LIST(MAKE_WEAK) |
108 #undef MAKE_WEAK | 108 #undef MAKE_WEAK |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 v8::Handle<v8::Object> receiver = toV8(element, context->Global(), isolate).
As<v8::Object>(); | 247 v8::Handle<v8::Object> receiver = toV8(element, context->Global(), isolate).
As<v8::Object>(); |
248 ASSERT(!receiver.IsEmpty()); | 248 ASSERT(!receiver.IsEmpty()); |
249 | 249 |
250 v8::TryCatch exceptionCatcher; | 250 v8::TryCatch exceptionCatcher; |
251 exceptionCatcher.SetVerbose(true); | 251 exceptionCatcher.SetVerbose(true); |
252 ScriptController::callFunctionWithInstrumentation(scriptExecutionContext(),
callback, receiver, 0, 0, isolate); | 252 ScriptController::callFunctionWithInstrumentation(scriptExecutionContext(),
callback, receiver, 0, 0, isolate); |
253 } | 253 } |
254 | 254 |
255 } // namespace WebCore | 255 } // namespace WebCore |
OLD | NEW |