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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1406993003: aura: Handle released widget when GPU channel gets established (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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 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 "content/browser/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 EstablishedGpuChannel(compositor, create_gpu_output_surface, 0); 223 EstablishedGpuChannel(compositor, create_gpu_output_surface, 0);
224 } 224 }
225 } 225 }
226 226
227 void GpuProcessTransportFactory::EstablishedGpuChannel( 227 void GpuProcessTransportFactory::EstablishedGpuChannel(
228 base::WeakPtr<ui::Compositor> compositor, 228 base::WeakPtr<ui::Compositor> compositor,
229 bool create_gpu_output_surface, 229 bool create_gpu_output_surface,
230 int num_attempts) { 230 int num_attempts) {
231 if (!compositor) 231 if (!compositor)
232 return; 232 return;
233 PerCompositorData* data = per_compositor_data_[compositor.get()]; 233 PerCompositorData* data = per_compositor_data_[compositor.get()];
piman 2015/10/20 01:51:49 Can you use per_compositor_data_.find(compositor.g
234 DCHECK(data); 234 // The widget might have been released in the meantime.
235 if (!data)
236 return;
235 237
236 if (num_attempts > kNumRetriesBeforeSoftwareFallback) { 238 if (num_attempts > kNumRetriesBeforeSoftwareFallback) {
237 #if defined(OS_CHROMEOS) 239 #if defined(OS_CHROMEOS)
238 LOG(FATAL) << "Unable to create a UI graphics context, and cannot use " 240 LOG(FATAL) << "Unable to create a UI graphics context, and cannot use "
239 << "software compositing on ChromeOS."; 241 << "software compositing on ChromeOS.";
240 #endif 242 #endif
241 create_gpu_output_surface = false; 243 create_gpu_output_surface = false;
242 } 244 }
243 245
244 scoped_refptr<ContextProviderCommandBuffer> context_provider; 246 scoped_refptr<ContextProviderCommandBuffer> context_provider;
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 635 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
634 observer_list_, 636 observer_list_,
635 OnLostResources()); 637 OnLostResources());
636 638
637 // Kill things that use the shared context before killing the shared context. 639 // Kill things that use the shared context before killing the shared context.
638 lost_gl_helper.reset(); 640 lost_gl_helper.reset();
639 lost_shared_main_thread_contexts = NULL; 641 lost_shared_main_thread_contexts = NULL;
640 } 642 }
641 643
642 } // namespace content 644 } // 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