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

Unified Diff: chrome/browser/android/logo_bridge.cc

Issue 2780773003: [Doodle] Set a maximum download size of 1 MB for the image (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/logo_bridge.cc
diff --git a/chrome/browser/android/logo_bridge.cc b/chrome/browser/android/logo_bridge.cc
index 82de78ae10bd0aa5aa311c157e8d6b369282dc15..8b24611abf5673c2f5d5822656c2494971bc0b04 100644
--- a/chrome/browser/android/logo_bridge.cc
+++ b/chrome/browser/android/logo_bridge.cc
@@ -40,6 +40,8 @@ using base::android::ToJavaByteArray;
namespace {
+const int64_t kMaxImageDownloadBytes = 1024 * 1024;
+
ScopedJavaLocalRef<jobject> MakeJavaLogo(JNIEnv* env,
const SkBitmap* bitmap,
const GURL& on_click_url,
@@ -201,6 +203,7 @@ LogoBridge::LogoBridge(jobject j_profile)
image_fetcher_ = base::MakeUnique<image_fetcher::ImageFetcherImpl>(
base::MakeUnique<suggestions::ImageDecoderImpl>(),
profile->GetRequestContext());
+ image_fetcher_->SetImageDownloadLimit(kMaxImageDownloadBytes);
doodle_observer_.Add(doodle_service_);
} else {
« 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