OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 visitor->TraceWrappers(m_callback.Cast<v8::Value>()); | 38 visitor->TraceWrappers(m_callback.Cast<v8::Value>()); |
39 } | 39 } |
40 | 40 |
41 bool VoidCallbackFunctionModules::call(ScriptWrappable* scriptWrappable) { | 41 bool VoidCallbackFunctionModules::call(ScriptWrappable* scriptWrappable) { |
42 if (m_callback.IsEmpty()) | 42 if (m_callback.IsEmpty()) |
43 return false; | 43 return false; |
44 | 44 |
45 if (!m_scriptState->ContextIsValid()) | 45 if (!m_scriptState->ContextIsValid()) |
46 return false; | 46 return false; |
47 | 47 |
48 ExecutionContext* context = m_scriptState->GetExecutionContext(); | 48 ExecutionContext* context = ExecutionContext::From(m_scriptState.Get()); |
49 DCHECK(context); | 49 DCHECK(context); |
50 if (context->IsContextSuspended() || context->IsContextDestroyed()) | 50 if (context->IsContextSuspended() || context->IsContextDestroyed()) |
51 return false; | 51 return false; |
52 | 52 |
53 // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. | 53 // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. |
54 // crbug.com/653769 | 54 // crbug.com/653769 |
55 DummyExceptionStateForTesting exceptionState; | 55 DummyExceptionStateForTesting exceptionState; |
56 ScriptState::Scope scope(m_scriptState.Get()); | 56 ScriptState::Scope scope(m_scriptState.Get()); |
57 v8::Isolate* isolate = m_scriptState->GetIsolate(); | 57 v8::Isolate* isolate = m_scriptState->GetIsolate(); |
58 | 58 |
(...skipping 20 matching lines...) Expand all Loading... |
79 } | 79 } |
80 | 80 |
81 VoidCallbackFunctionModules* NativeValueTraits<VoidCallbackFunctionModules>::Nat
iveValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& excep
tionState) { | 81 VoidCallbackFunctionModules* NativeValueTraits<VoidCallbackFunctionModules>::Nat
iveValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& excep
tionState) { |
82 VoidCallbackFunctionModules* nativeValue = VoidCallbackFunctionModules::Create
(ScriptState::Current(isolate), value); | 82 VoidCallbackFunctionModules* nativeValue = VoidCallbackFunctionModules::Create
(ScriptState::Current(isolate), value); |
83 if (!nativeValue) | 83 if (!nativeValue) |
84 exceptionState.ThrowTypeError("Unable to convert value to VoidCallbackFuncti
onModules."); | 84 exceptionState.ThrowTypeError("Unable to convert value to VoidCallbackFuncti
onModules."); |
85 return nativeValue; | 85 return nativeValue; |
86 } | 86 } |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
OLD | NEW |