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

Side by Side Diff: webkit/glue/webplugin_impl.cc

Issue 215018: The WebPluginImpl::paint function can be invoked when the delegate_ member is... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "base/gfx/rect.h" 5 #include "base/gfx/rect.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/base/escape.h" 9 #include "net/base/escape.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 void WebPluginImpl::destroy() { 229 void WebPluginImpl::destroy() {
230 SetContainer(NULL); 230 SetContainer(NULL);
231 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 231 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
232 } 232 }
233 233
234 NPObject* WebPluginImpl::scriptableObject() { 234 NPObject* WebPluginImpl::scriptableObject() {
235 return delegate_->GetPluginScriptableObject(); 235 return delegate_->GetPluginScriptableObject();
236 } 236 }
237 237
238 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& paint_rect) { 238 void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& paint_rect) {
239 if (!delegate_)
240 return;
239 // Note that |context| is only used when in windowless mode. 241 // Note that |context| is only used when in windowless mode.
240 #if WEBKIT_USING_SKIA 242 #if WEBKIT_USING_SKIA
241 gfx::NativeDrawingContext context = canvas->beginPlatformPaint(); 243 gfx::NativeDrawingContext context = canvas->beginPlatformPaint();
242 #elif WEBKIT_USING_CG 244 #elif WEBKIT_USING_CG
243 gfx::NativeDrawingContext context = canvas; 245 gfx::NativeDrawingContext context = canvas;
244 #endif 246 #endif
245 247
246 delegate_->Paint(context, paint_rect); 248 delegate_->Paint(context, paint_rect);
247 249
248 #if WEBKIT_USING_SKIA 250 #if WEBKIT_USING_SKIA
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 client_index = clients_.erase(client_index); 1054 client_index = clients_.erase(client_index);
1053 } 1055 }
1054 1056
1055 // This needs to be called now and not in the destructor since the 1057 // This needs to be called now and not in the destructor since the
1056 // webframe_ might not be valid anymore. 1058 // webframe_ might not be valid anymore.
1057 webframe_ = NULL; 1059 webframe_ = NULL;
1058 method_factory_.RevokeAll(); 1060 method_factory_.RevokeAll();
1059 } 1061 }
1060 1062
1061 } // namespace webkit_glue 1063 } // namespace webkit_glue
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