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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 4141005: Mac: Don't crash in -[AcceleratedPluginView drawView] when the RWHVMac went away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <QuartzCore/QuartzCore.h> 5 #include <QuartzCore/QuartzCore.h>
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
8 8
9 #include "app/app_switches.h" 9 #include "app/app_switches.h"
10 #include "app/surface/io_surface_support_mac.h" 10 #include "app/surface/io_surface_support_mac.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (renderWidgetHostView_) 276 if (renderWidgetHostView_)
277 renderWidgetHostView_->DeallocFakePluginWindowHandle(pluginHandle_); 277 renderWidgetHostView_->DeallocFakePluginWindowHandle(pluginHandle_);
278 [[NSNotificationCenter defaultCenter] removeObserver:self]; 278 [[NSNotificationCenter defaultCenter] removeObserver:self];
279 [super dealloc]; 279 [super dealloc];
280 } 280 }
281 281
282 - (void)drawView { 282 - (void)drawView {
283 // Called on a background thread. Synchronized via the CGL context lock. 283 // Called on a background thread. Synchronized via the CGL context lock.
284 CGLLockContext(cglContext_); 284 CGLLockContext(cglContext_);
285 285
286 // TODO(thakis): Pixel or view coordinates for size? 286 if (renderWidgetHostView_) {
287 renderWidgetHostView_->DrawAcceleratedSurfaceInstance( 287 // TODO(thakis): Pixel or view coordinates for size?
288 cglContext_, pluginHandle_, [self cachedSize]); 288 renderWidgetHostView_->DrawAcceleratedSurfaceInstance(
289 cglContext_, pluginHandle_, [self cachedSize]);
290 }
289 291
290 CGLFlushDrawable(cglContext_); 292 CGLFlushDrawable(cglContext_);
291 CGLUnlockContext(cglContext_); 293 CGLUnlockContext(cglContext_);
292 } 294 }
293 295
294 - (void)onRenderWidgetHostViewGone { 296 - (void)onRenderWidgetHostViewGone {
295 CGLLockContext(cglContext_); 297 CGLLockContext(cglContext_);
296 // Deallocate the plugin handle while we still can. 298 // Deallocate the plugin handle while we still can.
297 renderWidgetHostView_->DeallocFakePluginWindowHandle(pluginHandle_); 299 renderWidgetHostView_->DeallocFakePluginWindowHandle(pluginHandle_);
298 renderWidgetHostView_ = NULL; 300 renderWidgetHostView_ = NULL;
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2511 if (!string) return NO; 2513 if (!string) return NO;
2512 2514
2513 // If the user is currently using an IME, confirm the IME input, 2515 // If the user is currently using an IME, confirm the IME input,
2514 // and then insert the text from the service, the same as TextEdit and Safari. 2516 // and then insert the text from the service, the same as TextEdit and Safari.
2515 [self confirmComposition]; 2517 [self confirmComposition];
2516 [self insertText:string]; 2518 [self insertText:string];
2517 return YES; 2519 return YES;
2518 } 2520 }
2519 2521
2520 @end 2522 @end
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