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

Side by Side Diff: android_webview/browser/deferred_gpu_command_service.cc

Issue 634583004: Remove implicit conversions from scoped_refptr to T* in android_webview/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "android_webview/browser/deferred_gpu_command_service.h" 5 #include "android_webview/browser/deferred_gpu_command_service.h"
6 6
7 #include "android_webview/browser/gl_view_renderer_manager.h" 7 #include "android_webview/browser/gl_view_renderer_manager.h"
8 #include "android_webview/browser/shared_renderer_state.h" 8 #include "android_webview/browser/shared_renderer_state.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // static 24 // static
25 bool ScopedAllowGL::IsAllowed() { 25 bool ScopedAllowGL::IsAllowed() {
26 return allow_gl.Get().Get(); 26 return allow_gl.Get().Get();
27 } 27 }
28 28
29 ScopedAllowGL::ScopedAllowGL() { 29 ScopedAllowGL::ScopedAllowGL() {
30 DCHECK(!allow_gl.Get().Get()); 30 DCHECK(!allow_gl.Get().Get());
31 allow_gl.Get().Set(true); 31 allow_gl.Get().Set(true);
32 32
33 if (g_service.Get()) 33 if (g_service.Get().get())
34 g_service.Get()->RunTasks(); 34 g_service.Get()->RunTasks();
35 } 35 }
36 36
37 ScopedAllowGL::~ScopedAllowGL() { 37 ScopedAllowGL::~ScopedAllowGL() {
38 allow_gl.Get().Set(false); 38 allow_gl.Get().Set(false);
39 39
40 DeferredGpuCommandService* service = g_service.Get(); 40 DeferredGpuCommandService* service = g_service.Get().get();
41 if (service) { 41 if (service) {
42 service->RunTasks(); 42 service->RunTasks();
43 if (service->IdleQueueSize()) { 43 if (service->IdleQueueSize()) {
44 service->RequestProcessGL(); 44 service->RequestProcessGL();
45 } 45 }
46 } 46 }
47 } 47 }
48 48
49 // static 49 // static
50 void DeferredGpuCommandService::SetInstance() { 50 void DeferredGpuCommandService::SetInstance() {
51 if (!g_service.Get()) { 51 if (!g_service.Get().get()) {
52 g_service.Get() = new DeferredGpuCommandService; 52 g_service.Get() = new DeferredGpuCommandService;
53 content::SynchronousCompositor::SetGpuService(g_service.Get()); 53 content::SynchronousCompositor::SetGpuService(g_service.Get());
54 } 54 }
55 } 55 }
56 56
57 // static 57 // static
58 DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() { 58 DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() {
59 DCHECK(g_service.Get().get()); 59 DCHECK(g_service.Get().get());
60 return g_service.Get().get(); 60 return g_service.Get().get();
61 } 61 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void DeferredGpuCommandService::AddRef() const { 176 void DeferredGpuCommandService::AddRef() const {
177 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); 177 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef();
178 } 178 }
179 179
180 void DeferredGpuCommandService::Release() const { 180 void DeferredGpuCommandService::Release() const {
181 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); 181 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release();
182 } 182 }
183 183
184 } // namespace android_webview 184 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | android_webview/browser/hardware_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698