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

Side by Side Diff: third_party/WebKit/Source/core/workers/ThreadedMessagingProxyBase.cpp

Issue 2727733002: Implement AudioWorkletProcessor interface (Closed)
Patch Set: Addressing feedback from rtoy@ Created 3 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "core/workers/ThreadedMessagingProxyBase.h" 5 #include "core/workers/ThreadedMessagingProxyBase.h"
6 6
7 #include "bindings/core/v8/SourceLocation.h" 7 #include "bindings/core/v8/SourceLocation.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/Deprecation.h" 9 #include "core/frame/Deprecation.h"
10 #include "core/loader/DocumentLoader.h" 10 #include "core/loader/DocumentLoader.h"
(...skipping 27 matching lines...) Expand all
38 if (m_loaderProxy) 38 if (m_loaderProxy)
39 m_loaderProxy->detachProvider(this); 39 m_loaderProxy->detachProvider(this);
40 s_liveMessagingProxyCount--; 40 s_liveMessagingProxyCount--;
41 } 41 }
42 42
43 int ThreadedMessagingProxyBase::proxyCount() { 43 int ThreadedMessagingProxyBase::proxyCount() {
44 DCHECK(isMainThread()); 44 DCHECK(isMainThread());
45 return s_liveMessagingProxyCount; 45 return s_liveMessagingProxyCount;
46 } 46 }
47 47
48 void ThreadedMessagingProxyBase::setWorkerThreadForTest(
49 std::unique_ptr<WorkerThread> workerThread) {
50 m_workerThread = std::move(workerThread);
51 }
52
48 void ThreadedMessagingProxyBase::initializeWorkerThread( 53 void ThreadedMessagingProxyBase::initializeWorkerThread(
49 std::unique_ptr<WorkerThreadStartupData> startupData) { 54 std::unique_ptr<WorkerThreadStartupData> startupData) {
50 DCHECK(isParentContextThread()); 55 DCHECK(isParentContextThread());
51 56
52 Document* document = toDocument(getExecutionContext()); 57 Document* document = toDocument(getExecutionContext());
53 double originTime = 58 double originTime =
54 document->loader() ? document->loader()->timing().referenceMonotonicTime() 59 document->loader() ? document->loader()->timing().referenceMonotonicTime()
55 : monotonicallyIncreasingTime(); 60 : monotonicallyIncreasingTime();
56 61
57 m_loaderProxy = WorkerLoaderProxy::create(this); 62 m_loaderProxy = WorkerLoaderProxy::create(this);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 175 }
171 176
172 bool ThreadedMessagingProxyBase::isParentContextThread() const { 177 bool ThreadedMessagingProxyBase::isParentContextThread() const {
173 // TODO(nhiroki): Nested worker is not supported yet, so the parent context 178 // TODO(nhiroki): Nested worker is not supported yet, so the parent context
174 // thread should be equal to the main thread (http://crbug.com/31666). 179 // thread should be equal to the main thread (http://crbug.com/31666).
175 DCHECK(m_executionContext->isDocument()); 180 DCHECK(m_executionContext->isDocument());
176 return isMainThread(); 181 return isMainThread();
177 } 182 }
178 183
179 } // namespace blink 184 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698