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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2515433002: Revert of Change call-sites now that SkCanvas is not ref-counted (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index ac4b7931a7e7bff680542828fa28c08942b960a5..6254e040d1152557af19e959bd659b5214c1ac0f 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1798,7 +1798,7 @@
if (!num_pages)
return 0;
current_print_settings_ = print_settings;
- canvas_ = nullptr;
+ canvas_.reset();
ranges_.clear();
return num_pages;
}
@@ -1817,7 +1817,7 @@
#endif // defined(OS_MACOSX)
if (save_for_later) {
ranges_.push_back(page_range);
- canvas_ = canvas;
+ canvas_ = sk_ref_sp(canvas);
} else {
PrintPageHelper(&page_range, 1, canvas);
}
@@ -1849,8 +1849,8 @@
// Keep a reference on the stack. See NOTE above.
scoped_refptr<PepperPluginInstanceImpl> ref(this);
if (!ranges_.empty())
- PrintPageHelper(&(ranges_.front()), ranges_.size(), canvas_);
- canvas_ = nullptr;
+ PrintPageHelper(&(ranges_.front()), ranges_.size(), canvas_.get());
+ canvas_.reset();
ranges_.clear();
DCHECK(plugin_print_interface_);
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/ppb_image_data_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698