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

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: comment 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
234 // The widget might have been released in the meantime.
235 PerCompositorDataMap::iterator it =
236 per_compositor_data_.find(compositor.get());
237 if (it == per_compositor_data_.end())
238 return;
239
240 PerCompositorData* data = it->second;
234 DCHECK(data); 241 DCHECK(data);
235 242
236 if (num_attempts > kNumRetriesBeforeSoftwareFallback) { 243 if (num_attempts > kNumRetriesBeforeSoftwareFallback) {
237 #if defined(OS_CHROMEOS) 244 #if defined(OS_CHROMEOS)
238 LOG(FATAL) << "Unable to create a UI graphics context, and cannot use " 245 LOG(FATAL) << "Unable to create a UI graphics context, and cannot use "
239 << "software compositing on ChromeOS."; 246 << "software compositing on ChromeOS.";
240 #endif 247 #endif
241 create_gpu_output_surface = false; 248 create_gpu_output_surface = false;
242 } 249 }
243 250
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 640 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
634 observer_list_, 641 observer_list_,
635 OnLostResources()); 642 OnLostResources());
636 643
637 // Kill things that use the shared context before killing the shared context. 644 // Kill things that use the shared context before killing the shared context.
638 lost_gl_helper.reset(); 645 lost_gl_helper.reset();
639 lost_shared_main_thread_contexts = NULL; 646 lost_shared_main_thread_contexts = NULL;
640 } 647 }
641 648
642 } // namespace content 649 } // 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