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

Unified Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 11280251: chrome: Use skia::RefPtr for skia ref-counted objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linuxbuild Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/badge_util.cc ('k') | chrome/renderer/safe_browsing/phishing_thumbnailer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_view_observer.cc
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index b0503bb9dac75941e26caa3c4de6facecd80e103..3291631493079bd249a1e5dec6e0ee28dbf1339d 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -818,13 +818,13 @@ bool ChromeRenderViewObserver::CaptureSnapshot(WebView* view,
view->layout();
const WebSize& size = view->size();
- SkCanvas* canvas = skia::CreatePlatformCanvas(size.width, size.height, true,
- NULL, skia::RETURN_NULL_ON_FAILURE);
+ skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(
+ skia::CreatePlatformCanvas(
+ size.width, size.height, true, NULL, skia::RETURN_NULL_ON_FAILURE));
if (!canvas)
return false;
- SkAutoUnref au(canvas);
- view->paint(webkit_glue::ToWebCanvas(canvas),
+ view->paint(webkit_glue::ToWebCanvas(canvas.get()),
WebRect(0, 0, size.width, size.height));
// TODO: Add a way to snapshot the whole page, not just the currently
// visible part.
« no previous file with comments | « chrome/common/badge_util.cc ('k') | chrome/renderer/safe_browsing/phishing_thumbnailer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698