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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl.cc

Issue 2793803002: Remove ScopedAllowCrossThreadRefCountAccess from GpuDataManagerImpl (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser/gpu/gpu_data_manager_impl.h" 5 #include "content/browser/gpu/gpu_data_manager_impl.h"
6 6
7 #include "content/browser/gpu/gpu_data_manager_impl_private.h" 7 #include "content/browser/gpu/gpu_data_manager_impl_private.h"
8 #include "gpu/ipc/common/memory_stats.h" 8 #include "gpu/ipc/common/memory_stats.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 gpu::GPUInfo gpu_info; 56 gpu::GPUInfo gpu_info;
57 57
58 base::AutoLock auto_lock(lock_); 58 base::AutoLock auto_lock(lock_);
59 private_->InitializeForTesting(kData, gpu_info); 59 private_->InitializeForTesting(kData, gpu_info);
60 } 60 }
61 61
62 void GpuDataManagerImpl::InitializeForTesting( 62 void GpuDataManagerImpl::InitializeForTesting(
63 const gpu::GpuControlListData& gpu_blacklist_data, 63 const gpu::GpuControlListData& gpu_blacklist_data,
64 const gpu::GPUInfo& gpu_info) { 64 const gpu::GPUInfo& gpu_info) {
65 base::AutoLock auto_lock(lock_); 65 base::AutoLock auto_lock(lock_);
66 // Relax the cross-thread access restriction to non-thread-safe RefCount.
67 // See the comment in Initialize().
68 base::ScopedAllowCrossThreadRefCountAccess
69 allow_cross_thread_ref_count_access;
70 private_->InitializeForTesting(gpu_blacklist_data, gpu_info); 66 private_->InitializeForTesting(gpu_blacklist_data, gpu_info);
71 } 67 }
72 68
73 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const { 69 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const {
74 base::AutoLock auto_lock(lock_); 70 base::AutoLock auto_lock(lock_);
75 return private_->IsFeatureBlacklisted(feature); 71 return private_->IsFeatureBlacklisted(feature);
76 } 72 }
77 73
78 bool GpuDataManagerImpl::IsFeatureEnabled(int feature) const { 74 bool GpuDataManagerImpl::IsFeatureEnabled(int feature) const {
79 base::AutoLock auto_lock(lock_); 75 base::AutoLock auto_lock(lock_);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 private_->GetDisabledExtensions(disabled_extensions); 180 private_->GetDisabledExtensions(disabled_extensions);
185 } 181 }
186 182
187 void GpuDataManagerImpl::SetGpuInfo(const gpu::GPUInfo& gpu_info) { 183 void GpuDataManagerImpl::SetGpuInfo(const gpu::GPUInfo& gpu_info) {
188 base::AutoLock auto_lock(lock_); 184 base::AutoLock auto_lock(lock_);
189 private_->SetGpuInfo(gpu_info); 185 private_->SetGpuInfo(gpu_info);
190 } 186 }
191 187
192 void GpuDataManagerImpl::Initialize() { 188 void GpuDataManagerImpl::Initialize() {
193 base::AutoLock auto_lock(lock_); 189 base::AutoLock auto_lock(lock_);
194 // Relax the cross-thread access restriction to non-thread-safe RefCount.
195 // GpuDataManagerImplPrivate has GpuControlLists, which touches
196 // non-thread-safe GpuControlListEntry RefCount in the lock.
197 base::ScopedAllowCrossThreadRefCountAccess
198 allow_cross_thread_ref_count_access;
199 private_->Initialize(); 190 private_->Initialize();
200 } 191 }
201 192
202 void GpuDataManagerImpl::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { 193 void GpuDataManagerImpl::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) {
203 base::AutoLock auto_lock(lock_); 194 base::AutoLock auto_lock(lock_);
204 // Relax the cross-thread access restriction to non-thread-safe RefCount.
205 // See the comment in Initialize().
206 base::ScopedAllowCrossThreadRefCountAccess
207 allow_cross_thread_ref_count_access;
208 private_->UpdateGpuInfo(gpu_info); 195 private_->UpdateGpuInfo(gpu_info);
209 } 196 }
210 197
211 void GpuDataManagerImpl::UpdateGpuFeatureInfo( 198 void GpuDataManagerImpl::UpdateGpuFeatureInfo(
212 const gpu::GpuFeatureInfo& gpu_feature_info) { 199 const gpu::GpuFeatureInfo& gpu_feature_info) {
213 base::AutoLock auto_lock(lock_); 200 base::AutoLock auto_lock(lock_);
214 private_->UpdateGpuFeatureInfo(gpu_feature_info); 201 private_->UpdateGpuFeatureInfo(gpu_feature_info);
215 } 202 }
216 203
217 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( 204 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 290 }
304 291
305 size_t GpuDataManagerImpl::GetBlacklistedFeatureCount() const { 292 size_t GpuDataManagerImpl::GetBlacklistedFeatureCount() const {
306 base::AutoLock auto_lock(lock_); 293 base::AutoLock auto_lock(lock_);
307 return private_->GetBlacklistedFeatureCount(); 294 return private_->GetBlacklistedFeatureCount();
308 } 295 }
309 296
310 bool GpuDataManagerImpl::UpdateActiveGpu(uint32_t vendor_id, 297 bool GpuDataManagerImpl::UpdateActiveGpu(uint32_t vendor_id,
311 uint32_t device_id) { 298 uint32_t device_id) {
312 base::AutoLock auto_lock(lock_); 299 base::AutoLock auto_lock(lock_);
313 // Relax the cross-thread access restriction to non-thread-safe RefCount.
314 // See the comment in Initialize().
315 base::ScopedAllowCrossThreadRefCountAccess
316 allow_cross_thread_ref_count_access;
317 return private_->UpdateActiveGpu(vendor_id, device_id); 300 return private_->UpdateActiveGpu(vendor_id, device_id);
318 } 301 }
319 302
320 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& top_origin_url, 303 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& top_origin_url,
321 int render_process_id, 304 int render_process_id,
322 int render_frame_id, 305 int render_frame_id,
323 ThreeDAPIType requester) { 306 ThreeDAPIType requester) {
324 base::AutoLock auto_lock(lock_); 307 base::AutoLock auto_lock(lock_);
325 private_->Notify3DAPIBlocked( 308 private_->Notify3DAPIBlocked(
326 top_origin_url, render_process_id, render_frame_id, requester); 309 top_origin_url, render_process_id, render_frame_id, requester);
327 } 310 }
328 311
329 void GpuDataManagerImpl::OnGpuProcessInitFailure() { 312 void GpuDataManagerImpl::OnGpuProcessInitFailure() {
330 base::AutoLock auto_lock(lock_); 313 base::AutoLock auto_lock(lock_);
331 private_->OnGpuProcessInitFailure(); 314 private_->OnGpuProcessInitFailure();
332 } 315 }
333 316
334 GpuDataManagerImpl::GpuDataManagerImpl() 317 GpuDataManagerImpl::GpuDataManagerImpl()
335 : private_(GpuDataManagerImplPrivate::Create(this)) { 318 : private_(GpuDataManagerImplPrivate::Create(this)) {
336 } 319 }
337 320
338 GpuDataManagerImpl::~GpuDataManagerImpl() { 321 GpuDataManagerImpl::~GpuDataManagerImpl() {
339 } 322 }
340 323
341 } // namespace content 324 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698