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

Unified Diff: chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc
diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc
index 3b11e616d54f21177a410e6d0afd4b622b4100ae..79bac82fa809f665ec95827218bfae9c7f2c2cdf 100644
--- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc
+++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc
@@ -25,7 +25,7 @@ void CallbackInvocationAdapter(
const thumbnails::ThumbnailingAlgorithm::ConsumerCallback& callback,
scoped_refptr<thumbnails::ThumbnailingContext> context,
const SkBitmap& source_bitmap) {
- callback.Run(*context, source_bitmap);
+ callback.Run(*context.get(), source_bitmap);
}
} // namespace
@@ -60,15 +60,15 @@ void ContentBasedThumbnailingAlgorithm::ProcessBitmap(
const ConsumerCallback& callback,
const SkBitmap& bitmap) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(context);
+ DCHECK(context.get());
if (bitmap.isNull() || bitmap.empty())
return;
gfx::Size target_thumbnail_size =
SimpleThumbnailCrop::ComputeTargetSizeAtMaximumScale(target_size_);
- SkBitmap source_bitmap = PrepareSourceBitmap(
- bitmap, target_thumbnail_size, context);
+ SkBitmap source_bitmap =
+ PrepareSourceBitmap(bitmap, target_thumbnail_size, context.get());
// If the source is same (or smaller) than the target, just return it as
// the final result. Otherwise, send the shrinking task to the blocking
@@ -83,7 +83,7 @@ void ContentBasedThumbnailingAlgorithm::ProcessBitmap(
context->clip_result == CLIP_RESULT_NOT_CLIPPED ||
context->clip_result == CLIP_RESULT_SOURCE_SAME_AS_TARGET);
- callback.Run(*context, source_bitmap);
+ callback.Run(*context.get(), source_bitmap);
return;
}

Powered by Google App Engine
This is Rietveld 408576698