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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: +DISALLOW_COPY_AND_ASSIGN for win build fix Created 3 years, 11 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/webgl/WebGLTimerQueryEXT.h" 5 #include "modules/webgl/WebGLTimerQueryEXT.h"
6 6
7 #include "core/dom/TaskRunnerHelper.h" 7 #include "core/dom/TaskRunnerHelper.h"
8 #include "gpu/command_buffer/client/gles2_interface.h" 8 #include "gpu/command_buffer/client/gles2_interface.h"
9 #include "modules/webgl/WebGLRenderingContextBase.h" 9 #include "modules/webgl/WebGLRenderingContextBase.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 WebGLTimerQueryEXT* WebGLTimerQueryEXT::create(WebGLRenderingContextBase* ctx) { 14 WebGLTimerQueryEXT* WebGLTimerQueryEXT::create(WebGLRenderingContextBase* ctx) {
15 return new WebGLTimerQueryEXT(ctx); 15 return new WebGLTimerQueryEXT(ctx);
16 } 16 }
17 17
18 WebGLTimerQueryEXT::WebGLTimerQueryEXT(WebGLRenderingContextBase* ctx) 18 WebGLTimerQueryEXT::WebGLTimerQueryEXT(WebGLRenderingContextBase* ctx)
19 : WebGLContextObject(ctx), 19 : WebGLContextObject(ctx),
20 m_target(0), 20 m_target(0),
21 m_queryId(0), 21 m_queryId(0),
22 m_canUpdateAvailability(false), 22 m_canUpdateAvailability(false),
23 m_queryResultAvailable(false), 23 m_queryResultAvailable(false),
24 m_queryResult(0), 24 m_queryResult(0),
25 m_taskRunner(TaskRunnerHelper::get(TaskType::Unthrottled, 25 m_taskRunner(TaskRunnerHelper::get(TaskType::Unthrottled,
26 &ctx->canvas()->document()) 26 &ctx->canvas()->document())) {
27 ->clone()) {
28 context()->contextGL()->GenQueriesEXT(1, &m_queryId); 27 context()->contextGL()->GenQueriesEXT(1, &m_queryId);
29 } 28 }
30 29
31 WebGLTimerQueryEXT::~WebGLTimerQueryEXT() { 30 WebGLTimerQueryEXT::~WebGLTimerQueryEXT() {
32 runDestructor(); 31 runDestructor();
33 } 32 }
34 33
35 void WebGLTimerQueryEXT::resetCachedResult() { 34 void WebGLTimerQueryEXT::resetCachedResult() {
36 m_canUpdateAvailability = false; 35 m_canUpdateAvailability = false;
37 m_queryResultAvailable = false; 36 m_queryResultAvailable = false;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 m_taskHandle = m_taskRunner->postCancellableTask( 94 m_taskHandle = m_taskRunner->postCancellableTask(
96 BLINK_FROM_HERE, WTF::bind(&WebGLTimerQueryEXT::allowAvailabilityUpdate, 95 BLINK_FROM_HERE, WTF::bind(&WebGLTimerQueryEXT::allowAvailabilityUpdate,
97 wrapWeakPersistent(this))); 96 wrapWeakPersistent(this)));
98 } 97 }
99 98
100 void WebGLTimerQueryEXT::allowAvailabilityUpdate() { 99 void WebGLTimerQueryEXT::allowAvailabilityUpdate() {
101 m_canUpdateAvailability = true; 100 m_canUpdateAvailability = true;
102 } 101 }
103 102
104 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h ('k') | third_party/WebKit/Source/platform/Timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698