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

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 565833002: Refactoring the weak_ptr_factory order in src/content/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
6 6
7 #include "third_party/khronos/GLES2/gl2.h" 7 #include "third_party/khronos/GLES2/gl2.h"
8 #ifndef GL_GLEXT_PROTOTYPES 8 #ifndef GL_GLEXT_PROTOTYPES
9 #define GL_GLEXT_PROTOTYPES 1 9 #define GL_GLEXT_PROTOTYPES 1
10 #endif 10 #endif
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const SharedMemoryLimits& limits, 89 const SharedMemoryLimits& limits,
90 WebGraphicsContext3DCommandBufferImpl* share_context) 90 WebGraphicsContext3DCommandBufferImpl* share_context)
91 : lose_context_when_out_of_memory_(lose_context_when_out_of_memory), 91 : lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
92 attributes_(attributes), 92 attributes_(attributes),
93 visible_(false), 93 visible_(false),
94 host_(host), 94 host_(host),
95 surface_id_(surface_id), 95 surface_id_(surface_id),
96 active_url_(active_url), 96 active_url_(active_url),
97 gpu_preference_(attributes.preferDiscreteGPU ? gfx::PreferDiscreteGpu 97 gpu_preference_(attributes.preferDiscreteGPU ? gfx::PreferDiscreteGpu
98 : gfx::PreferIntegratedGpu), 98 : gfx::PreferIntegratedGpu),
99 weak_ptr_factory_(this), 99 mem_limits_(limits),
100 mem_limits_(limits) { 100 weak_ptr_factory_(this) {
101 if (share_context) { 101 if (share_context) {
102 DCHECK(!attributes_.shareResources); 102 DCHECK(!attributes_.shareResources);
103 share_group_ = share_context->share_group_; 103 share_group_ = share_context->share_group_;
104 } else { 104 } else {
105 share_group_ = attributes_.shareResources 105 share_group_ = attributes_.shareResources
106 ? GetDefaultShareGroupForHost(host) 106 ? GetDefaultShareGroupForHost(host)
107 : scoped_refptr<WebGraphicsContext3DCommandBufferImpl::ShareGroup>( 107 : scoped_refptr<WebGraphicsContext3DCommandBufferImpl::ShareGroup>(
108 new ShareGroup()); 108 new ShareGroup());
109 } 109 }
110 } 110 }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 share_group_->RemoveAllContexts(); 395 share_group_->RemoveAllContexts();
396 396
397 DCHECK(host_.get()); 397 DCHECK(host_.get());
398 { 398 {
399 base::AutoLock lock(g_default_share_groups_lock.Get()); 399 base::AutoLock lock(g_default_share_groups_lock.Get());
400 g_default_share_groups.Get().erase(host_.get()); 400 g_default_share_groups.Get().erase(host_.get());
401 } 401 }
402 } 402 }
403 403
404 } // namespace content 404 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | content/common/gpu/gpu_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698