Commit 0a1eec7a authored by Tomasz Wiszkowski's avatar Tomasz Wiszkowski Committed by Commit Bot

Disable image prefetch for Android.

Android requires a different mechanism to prefetch suggestion images
to avoid copying byte buffers from C++ to Java and replicating caches.

Bug: 930349
Change-Id: I243ccb7c6832f0b9333ffb72a31b0d770a643c8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600963Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ender <ender@google.com>
Cr-Commit-Position: refs/heads/master@{#663878}
parent db118fc5
...@@ -313,6 +313,9 @@ void ChromeAutocompleteProviderClient::DeleteMatchingURLsForKeywordFromHistory( ...@@ -313,6 +313,9 @@ void ChromeAutocompleteProviderClient::DeleteMatchingURLsForKeywordFromHistory(
} }
void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) { void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) {
// Note: Android uses different image fetching mechanism to avoid
// penalty of copying byte buffers from C++ to Java.
#if !defined(OS_ANDROID)
BitmapFetcherService* image_service = BitmapFetcherService* image_service =
BitmapFetcherServiceFactory::GetForBrowserContext(profile_); BitmapFetcherServiceFactory::GetForBrowserContext(profile_);
DCHECK(image_service); DCHECK(image_service);
...@@ -358,6 +361,7 @@ void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) { ...@@ -358,6 +361,7 @@ void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) {
})"); })");
image_service->Prefetch(url, traffic_annotation); image_service->Prefetch(url, traffic_annotation);
#endif // !defined(OS_ANDROID)
} }
void ChromeAutocompleteProviderClient::StartServiceWorker( void ChromeAutocompleteProviderClient::StartServiceWorker(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment