OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "platform/heap/SafePoint.h" | 44 #include "platform/heap/SafePoint.h" |
45 #include "platform/heap/ThreadState.h" | 45 #include "platform/heap/ThreadState.h" |
46 #include "platform/weborigin/KURL.h" | 46 #include "platform/weborigin/KURL.h" |
47 #include "public/platform/Platform.h" | 47 #include "public/platform/Platform.h" |
48 #include "public/platform/WebThread.h" | 48 #include "public/platform/WebThread.h" |
49 #include "public/platform/WebWaitableEvent.h" | 49 #include "public/platform/WebWaitableEvent.h" |
50 #include "wtf/Noncopyable.h" | 50 #include "wtf/Noncopyable.h" |
51 #include "wtf/WeakPtr.h" | 51 #include "wtf/WeakPtr.h" |
52 #include "wtf/text/WTFString.h" | 52 #include "wtf/text/WTFString.h" |
53 | 53 |
54 #include <utility> | |
55 | |
56 namespace blink { | 54 namespace blink { |
57 | 55 |
58 namespace { | 56 namespace { |
59 const int64_t kShortIdleHandlerDelayMs = 1000; | 57 const int64_t kShortIdleHandlerDelayMs = 1000; |
60 const int64_t kLongIdleHandlerDelayMs = 10*1000; | 58 const int64_t kLongIdleHandlerDelayMs = 10*1000; |
61 | 59 |
62 class MicrotaskRunner : public WebThread::TaskObserver { | 60 class MicrotaskRunner : public WebThread::TaskObserver { |
63 public: | 61 public: |
64 explicit MicrotaskRunner(WorkerThread* workerThread) | 62 explicit MicrotaskRunner(WorkerThread* workerThread) |
65 : m_workerThread(workerThread) | 63 : m_workerThread(workerThread) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 ASSERT(context->isWorkerGlobalScope()); | 248 ASSERT(context->isWorkerGlobalScope()); |
251 m_thread->runDebuggerTask(WorkerThread::DontWaitForMessage); | 249 m_thread->runDebuggerTask(WorkerThread::DontWaitForMessage); |
252 } | 250 } |
253 | 251 |
254 private: | 252 private: |
255 explicit RunDebuggerQueueTask(WorkerThread* thread) : m_thread(thread) { } | 253 explicit RunDebuggerQueueTask(WorkerThread* thread) : m_thread(thread) { } |
256 | 254 |
257 WorkerThread* m_thread; | 255 WorkerThread* m_thread; |
258 }; | 256 }; |
259 | 257 |
260 WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, Work
erReportingProxy& workerReportingProxy, PassOwnPtrWillBeRawPtr<WorkerThreadStart
upData> startupData) | 258 WorkerThread::WorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, Work
erReportingProxy& workerReportingProxy, PassOwnPtr<WorkerThreadStartupData> star
tupData) |
261 : m_terminated(false) | 259 : m_terminated(false) |
262 , m_workerLoaderProxy(workerLoaderProxy) | 260 , m_workerLoaderProxy(workerLoaderProxy) |
263 , m_workerReportingProxy(workerReportingProxy) | 261 , m_workerReportingProxy(workerReportingProxy) |
264 , m_startupData(startupData) | 262 , m_startupData(startupData) |
265 , m_isolate(nullptr) | 263 , m_isolate(nullptr) |
266 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent()
)) | 264 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent()
)) |
267 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven
t())) | 265 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven
t())) |
268 { | 266 { |
269 MutexLocker lock(threadSetMutex()); | 267 MutexLocker lock(threadSetMutex()); |
270 workerThreads().add(this); | 268 workerThreads().add(this); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 609 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
612 } | 610 } |
613 | 611 |
614 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) | 612 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) |
615 { | 613 { |
616 MutexLocker locker(m_workerInspectorControllerMutex); | 614 MutexLocker locker(m_workerInspectorControllerMutex); |
617 m_workerInspectorController = workerInspectorController; | 615 m_workerInspectorController = workerInspectorController; |
618 } | 616 } |
619 | 617 |
620 } // namespace blink | 618 } // namespace blink |
OLD | NEW |