| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "bindings/v8/custom/V8PromiseCustom.h" | 32 #include "bindings/v8/custom/V8PromiseCustom.h" |
| 33 | 33 |
| 34 #include <v8.h> |
| 34 #include "V8Promise.h" | 35 #include "V8Promise.h" |
| 35 #include "bindings/v8/ScopedPersistent.h" | 36 #include "bindings/v8/ScopedPersistent.h" |
| 36 #include "bindings/v8/ScriptFunctionCall.h" | 37 #include "bindings/v8/ScriptFunctionCall.h" |
| 37 #include "bindings/v8/ScriptState.h" | 38 #include "bindings/v8/ScriptState.h" |
| 38 #include "bindings/v8/V8Binding.h" | 39 #include "bindings/v8/V8Binding.h" |
| 39 #include "bindings/v8/V8HiddenPropertyName.h" | 40 #include "bindings/v8/V8HiddenPropertyName.h" |
| 40 #include "bindings/v8/V8PerIsolateData.h" | 41 #include "bindings/v8/V8PerIsolateData.h" |
| 41 #include "bindings/v8/V8ScriptRunner.h" | 42 #include "bindings/v8/V8ScriptRunner.h" |
| 42 #include "bindings/v8/WrapperTypeInfo.h" | 43 #include "bindings/v8/WrapperTypeInfo.h" |
| 43 #include "core/dom/Document.h" | 44 #include "core/dom/Document.h" |
| 44 #include "core/page/DOMWindow.h" | 45 #include "core/page/DOMWindow.h" |
| 45 #include "core/platform/Task.h" | |
| 46 #include "core/workers/WorkerGlobalScope.h" | 46 #include "core/workers/WorkerGlobalScope.h" |
| 47 #include "platform/Task.h" |
| 47 #include "wtf/Deque.h" | 48 #include "wtf/Deque.h" |
| 48 #include "wtf/Functional.h" | 49 #include "wtf/Functional.h" |
| 49 #include "wtf/Noncopyable.h" | 50 #include "wtf/Noncopyable.h" |
| 50 #include "wtf/PassOwnPtr.h" | 51 #include "wtf/PassOwnPtr.h" |
| 51 #include <v8.h> | |
| 52 | 52 |
| 53 namespace WebCore { | 53 namespace WebCore { |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 v8::Local<v8::ObjectTemplate> cachedObjectTemplate(void* privateTemplateUniqueKe
y, int internalFieldCount, v8::Isolate* isolate) | 57 v8::Local<v8::ObjectTemplate> cachedObjectTemplate(void* privateTemplateUniqueKe
y, int internalFieldCount, v8::Isolate* isolate) |
| 58 { | 58 { |
| 59 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 59 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 60 WrapperWorldType currentWorldType = worldType(isolate); | 60 WrapperWorldType currentWorldType = worldType(isolate); |
| 61 v8::Handle<v8::FunctionTemplate> functionDescriptor = data->privateTemplateI
fExists(currentWorldType, privateTemplateUniqueKey); | 61 v8::Handle<v8::FunctionTemplate> functionDescriptor = data->privateTemplateI
fExists(currentWorldType, privateTemplateUniqueKey); |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 } | 813 } |
| 814 | 814 |
| 815 void V8PromiseCustom::callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8:
:Function> handler, v8::Handle<v8::Value> argument, v8::Isolate* isolate) | 815 void V8PromiseCustom::callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8:
:Function> handler, v8::Handle<v8::Value> argument, v8::Isolate* isolate) |
| 816 { | 816 { |
| 817 ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext()
; | 817 ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext()
; |
| 818 ASSERT(scriptExecutionContext && scriptExecutionContext->isContextThread()); | 818 ASSERT(scriptExecutionContext && scriptExecutionContext->isContextThread()); |
| 819 scriptExecutionContext->postTask(adoptPtr(new CallHandlerTask(promise, handl
er, argument, isolate))); | 819 scriptExecutionContext->postTask(adoptPtr(new CallHandlerTask(promise, handl
er, argument, isolate))); |
| 820 } | 820 } |
| 821 | 821 |
| 822 } // namespace WebCore | 822 } // namespace WebCore |
| OLD | NEW |