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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10349013: Prevent browser thumbnailer from trying to read from frontbuffer (surface texture) when none exists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK protection against segfault. Created 8 years, 7 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 | Annotate | Revision Log
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/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 326
327 void RenderWidgetHostViewAura::Blur() { 327 void RenderWidgetHostViewAura::Blur() {
328 window_->Blur(); 328 window_->Blur();
329 } 329 }
330 330
331 bool RenderWidgetHostViewAura::HasFocus() const { 331 bool RenderWidgetHostViewAura::HasFocus() const {
332 return window_->HasFocus(); 332 return window_->HasFocus();
333 } 333 }
334 334
335 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const {
336 return current_surface_ != 0;
337 }
338
335 void RenderWidgetHostViewAura::Show() { 339 void RenderWidgetHostViewAura::Show() {
336 window_->Show(); 340 window_->Show();
337 } 341 }
338 342
339 void RenderWidgetHostViewAura::Hide() { 343 void RenderWidgetHostViewAura::Hide() {
340 window_->Hide(); 344 window_->Hide();
341 } 345 }
342 346
343 bool RenderWidgetHostViewAura::IsShowing() { 347 bool RenderWidgetHostViewAura::IsShowing() {
344 return window_->IsVisible(); 348 return window_->IsVisible();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 445
442 void RenderWidgetHostViewAura::CopyFromCompositingSurface( 446 void RenderWidgetHostViewAura::CopyFromCompositingSurface(
443 const gfx::Size& size, 447 const gfx::Size& size,
444 skia::PlatformCanvas* output, 448 skia::PlatformCanvas* output,
445 base::Callback<void(bool)> callback) { 449 base::Callback<void(bool)> callback) {
446 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); 450 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
447 ui::Compositor* compositor = GetCompositor(); 451 ui::Compositor* compositor = GetCompositor();
448 if (!compositor) 452 if (!compositor)
449 return; 453 return;
450 454
455 DCHECK(image_transport_clients_.find(current_surface_) !=
456 image_transport_clients_.end());
mazda 2012/05/23 20:06:23 When this condition holds, |container| is initiali
mmocny 2012/05/23 20:28:30 You are right. The issue was that we expect the e
451 ImageTransportClient* container = image_transport_clients_[current_surface_]; 457 ImageTransportClient* container = image_transport_clients_[current_surface_];
452 if (!container) 458 if (!container)
453 return; 459 return;
454 460
455 if (!output->initialize(size.width(), size.height(), true)) 461 if (!output->initialize(size.width(), size.height(), true))
456 return; 462 return;
457 463
458 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 464 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
459 content::GLHelper* gl_helper = factory->GetGLHelper(compositor); 465 content::GLHelper* gl_helper = factory->GetGLHelper(compositor);
460 if (!gl_helper) 466 if (!gl_helper)
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 1316 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
1311 RenderWidgetHost* widget) { 1317 RenderWidgetHost* widget) {
1312 return new RenderWidgetHostViewAura(widget); 1318 return new RenderWidgetHostViewAura(widget);
1313 } 1319 }
1314 1320
1315 // static 1321 // static
1316 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( 1322 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo(
1317 WebKit::WebScreenInfo* results) { 1323 WebKit::WebScreenInfo* results) {
1318 GetScreenInfoForWindow(results, NULL); 1324 GetScreenInfoForWindow(results, NULL);
1319 } 1325 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698