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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TemporaryChange -> AutoReset Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/compositorworker/CompositorWorkerGlobalScope.h" 5 #include "modules/compositorworker/CompositorWorkerGlobalScope.h"
6 6
7 #include "bindings/core/v8/SerializedScriptValue.h" 7 #include "bindings/core/v8/SerializedScriptValue.h"
8 #include "core/workers/InProcessWorkerObjectProxy.h" 8 #include "core/workers/InProcessWorkerObjectProxy.h"
9 #include "core/workers/WorkerThreadStartupData.h" 9 #include "core/workers/WorkerThreadStartupData.h"
10 #include "modules/EventTargetModules.h" 10 #include "modules/EventTargetModules.h"
11 #include "modules/compositorworker/CompositorWorkerThread.h" 11 #include "modules/compositorworker/CompositorWorkerThread.h"
12 #include "wtf/AutoReset.h"
12 #include <memory> 13 #include <memory>
13 14
14 namespace blink { 15 namespace blink {
15 16
16 CompositorWorkerGlobalScope* CompositorWorkerGlobalScope::create(CompositorWorke rThread* thread, std::unique_ptr<WorkerThreadStartupData> startupData, double ti meOrigin) 17 CompositorWorkerGlobalScope* CompositorWorkerGlobalScope::create(CompositorWorke rThread* thread, std::unique_ptr<WorkerThreadStartupData> startupData, double ti meOrigin)
17 { 18 {
18 // Note: startupData is finalized on return. After the relevant parts has be en 19 // Note: startupData is finalized on return. After the relevant parts has be en
19 // passed along to the created 'context'. 20 // passed along to the created 'context'.
20 CompositorWorkerGlobalScope* context = new CompositorWorkerGlobalScope(start upData->m_scriptURL, startupData->m_userAgent, thread, timeOrigin, std::move(sta rtupData->m_starterOriginPrivilegeData), startupData->m_workerClients.release()) ; 21 CompositorWorkerGlobalScope* context = new CompositorWorkerGlobalScope(start upData->m_scriptURL, startupData->m_userAgent, thread, timeOrigin, std::move(sta rtupData->m_starterOriginPrivilegeData), startupData->m_workerClients.release()) ;
21 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders); 22 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return m_callbackCollection.registerCallback(callback); 66 return m_callbackCollection.registerCallback(callback);
66 } 67 }
67 68
68 void CompositorWorkerGlobalScope::cancelAnimationFrame(int id) 69 void CompositorWorkerGlobalScope::cancelAnimationFrame(int id)
69 { 70 {
70 m_callbackCollection.cancelCallback(id); 71 m_callbackCollection.cancelCallback(id);
71 } 72 }
72 73
73 bool CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResT imeMs) 74 bool CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResT imeMs)
74 { 75 {
75 TemporaryChange<bool> temporaryChange(m_executingAnimationFrameCallbacks, tr ue); 76 AutoReset<bool> temporaryChange(&m_executingAnimationFrameCallbacks, true);
76 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); 77 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs);
77 return !m_callbackCollection.isEmpty(); 78 return !m_callbackCollection.isEmpty();
78 } 79 }
79 80
80 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const 81 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const
81 { 82 {
82 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread()); 83 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread());
83 } 84 }
84 85
85 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698