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

Side by Side Diff: Source/core/workers/WorkerRunLoop.cpp

Issue 209853010: [ABANDONED] Enable V8 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: done? Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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
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 "core/workers/WorkerRunLoop.h" 32 #include "core/workers/WorkerRunLoop.h"
33 33
34 #include "bindings/v8/V8RecursionScope.h"
34 #include "core/inspector/InspectorInstrumentation.h" 35 #include "core/inspector/InspectorInstrumentation.h"
35 #include "core/workers/WorkerGlobalScope.h" 36 #include "core/workers/WorkerGlobalScope.h"
36 #include "core/workers/WorkerThread.h" 37 #include "core/workers/WorkerThread.h"
37 #include "heap/ThreadState.h" 38 #include "heap/ThreadState.h"
38 #include "platform/PlatformThreadData.h" 39 #include "platform/PlatformThreadData.h"
39 #include "platform/SharedTimer.h" 40 #include "platform/SharedTimer.h"
40 #include "platform/ThreadTimers.h" 41 #include "platform/ThreadTimers.h"
41 #include "wtf/CurrentTime.h" 42 #include "wtf/CurrentTime.h"
42 43
43 namespace WebCore { 44 namespace WebCore {
44 45
45 class WorkerRunLoopTask : public blink::WebThread::Task { 46 class WorkerRunLoopTask : public blink::WebThread::Task {
46 WTF_MAKE_NONCOPYABLE(WorkerRunLoopTask); WTF_MAKE_FAST_ALLOCATED; 47 WTF_MAKE_NONCOPYABLE(WorkerRunLoopTask); WTF_MAKE_FAST_ALLOCATED;
47 public: 48 public:
48 static PassOwnPtr<WorkerRunLoopTask> create(const WorkerRunLoop& runLoop, Pa ssOwnPtr<ExecutionContextTask> task) 49 static PassOwnPtr<WorkerRunLoopTask> create(const WorkerRunLoop& runLoop, Pa ssOwnPtr<ExecutionContextTask> task)
49 { 50 {
50 return adoptPtr(new WorkerRunLoopTask(runLoop, task)); 51 return adoptPtr(new WorkerRunLoopTask(runLoop, task));
51 } 52 }
52 53
53 virtual ~WorkerRunLoopTask() { } 54 virtual ~WorkerRunLoopTask() { }
54 55
55 virtual void run() OVERRIDE 56 virtual void run() OVERRIDE
56 { 57 {
57 WorkerGlobalScope* workerGlobalScope = m_runLoop.context(); 58 WorkerGlobalScope* workerGlobalScope = m_runLoop.context();
58 if ((!workerGlobalScope->isClosing() && !m_runLoop.terminated()) || m_ta sk->isCleanupTask()) 59 if ((!workerGlobalScope->isClosing() && !m_runLoop.terminated()) || m_ta sk->isCleanupTask()) {
60 V8RecursionScope recursionScope(workerGlobalScope);
adamk 2014/03/28 17:55:05 This seems like the wrong place to put this, V8Rec
59 m_task->performTask(workerGlobalScope); 61 m_task->performTask(workerGlobalScope);
62 }
60 } 63 }
61 64
62 private: 65 private:
63 WorkerRunLoopTask(const WorkerRunLoop& runLoop, PassOwnPtr<ExecutionContextT ask> task) 66 WorkerRunLoopTask(const WorkerRunLoop& runLoop, PassOwnPtr<ExecutionContextT ask> task)
64 : m_runLoop(runLoop) 67 : m_runLoop(runLoop)
65 , m_task(task) 68 , m_task(task)
66 { 69 {
67 } 70 }
68 71
69 const WorkerRunLoop& m_runLoop; 72 const WorkerRunLoop& m_runLoop;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 273
271 bool WorkerRunLoop::postDebuggerTask(PassOwnPtr<ExecutionContextTask> task) 274 bool WorkerRunLoop::postDebuggerTask(PassOwnPtr<ExecutionContextTask> task)
272 { 275 {
273 bool posted = m_debuggerMessageQueue.append(WorkerRunLoopTask::create(*this, task)); 276 bool posted = m_debuggerMessageQueue.append(WorkerRunLoopTask::create(*this, task));
274 if (posted) 277 if (posted)
275 postTask(TickleDebuggerQueueTask::create(this)); 278 postTask(TickleDebuggerQueueTask::create(this));
276 return posted; 279 return posted;
277 } 280 }
278 281
279 } // namespace WebCore 282 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698