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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 632 } |
633 v8SetReturnValue(args, promise); | 633 v8SetReturnValue(args, promise); |
634 } | 634 } |
635 | 635 |
636 // | 636 // |
637 // -- V8PromiseCustom -- | 637 // -- V8PromiseCustom -- |
638 v8::Local<v8::Object> V8PromiseCustom::createPromise(v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 638 v8::Local<v8::Object> V8PromiseCustom::createPromise(v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
639 { | 639 { |
640 v8::Local<v8::ObjectTemplate> internalTemplate = internalObjectTemplate(isol
ate); | 640 v8::Local<v8::ObjectTemplate> internalTemplate = internalObjectTemplate(isol
ate); |
641 v8::Local<v8::Object> internal = internalTemplate->NewInstance(); | 641 v8::Local<v8::Object> internal = internalTemplate->NewInstance(); |
642 v8::Local<v8::Object> promise = V8DOMWrapper::createWrapper(creationContext,
&V8Promise::info, 0, isolate); | 642 v8::Local<v8::Object> promise = V8DOMWrapper::createWrapper(creationContext,
&V8Promise::wrapperTypeInfo, 0, isolate); |
643 | 643 |
644 clearDerived(internal); | 644 clearDerived(internal); |
645 setState(internal, Pending, v8::Undefined(isolate), isolate); | 645 setState(internal, Pending, v8::Undefined(isolate), isolate); |
646 | 646 |
647 promise->SetInternalField(v8DOMWrapperObjectIndex, internal); | 647 promise->SetInternalField(v8DOMWrapperObjectIndex, internal); |
648 return promise; | 648 return promise; |
649 } | 649 } |
650 | 650 |
651 v8::Local<v8::Object> V8PromiseCustom::getInternal(v8::Handle<v8::Object> promis
e) | 651 v8::Local<v8::Object> V8PromiseCustom::getInternal(v8::Handle<v8::Object> promis
e) |
652 { | 652 { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 } | 814 } |
815 | 815 |
816 void V8PromiseCustom::callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8:
:Function> handler, v8::Handle<v8::Value> argument, v8::Isolate* isolate) | 816 void V8PromiseCustom::callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8:
:Function> handler, v8::Handle<v8::Value> argument, v8::Isolate* isolate) |
817 { | 817 { |
818 ExecutionContext* executionContext = getExecutionContext(); | 818 ExecutionContext* executionContext = getExecutionContext(); |
819 ASSERT(executionContext && executionContext->isContextThread()); | 819 ASSERT(executionContext && executionContext->isContextThread()); |
820 executionContext->postTask(adoptPtr(new CallHandlerTask(promise, handler, ar
gument, isolate))); | 820 executionContext->postTask(adoptPtr(new CallHandlerTask(promise, handler, ar
gument, isolate))); |
821 } | 821 } |
822 | 822 |
823 } // namespace WebCore | 823 } // namespace WebCore |
OLD | NEW |