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

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

Issue 2228273002: Run ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap() on Worker thread instead of IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2_thread Created 4 years, 4 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 | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/webapk/webapk_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 7ab56020584b889955e925293c0723aaf604679e..26000d260338a4c30d0821f095c6efadd7b11537 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -64,34 +64,30 @@ void GetHomescreenIconAndSplashImageSizes() {
} // anonymous namespace
// static
-void ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap(
+void ShortcutHelper::AddToLauncherWithSkBitmap(
content::BrowserContext* browser_context,
const ShortcutInfo& info,
const std::string& webapp_id,
const SkBitmap& icon_bitmap,
const base::Closure& splash_image_callback) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
if (info.display == blink::WebDisplayModeStandalone ||
info.display == blink::WebDisplayModeFullscreen) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableWebApk)) {
- InstallWebApkInBackgroundWithSkBitmap(browser_context, info, icon_bitmap);
+ InstallWebApkWithSkBitmap(browser_context, info, icon_bitmap);
return;
}
- AddWebappInBackgroundWithSkBitmap(info, webapp_id, icon_bitmap,
- splash_image_callback);
+ AddWebappWithSkBitmap(info, webapp_id, icon_bitmap, splash_image_callback);
return;
}
- AddShortcutInBackgroundWithSkBitmap(info, icon_bitmap);
+ AddShortcutWithSkBitmap(info, icon_bitmap);
}
// static
-void ShortcutHelper::InstallWebApkInBackgroundWithSkBitmap(
+void ShortcutHelper::InstallWebApkWithSkBitmap(
content::BrowserContext* browser_context,
const ShortcutInfo& info,
const SkBitmap& icon_bitmap) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
// WebApkInstaller destroys itself when it is done.
WebApkInstaller* installer = new WebApkInstaller(info, icon_bitmap);
installer->InstallAsync(browser_context,
@@ -99,13 +95,11 @@ void ShortcutHelper::InstallWebApkInBackgroundWithSkBitmap(
}
// static
-void ShortcutHelper::AddWebappInBackgroundWithSkBitmap(
+void ShortcutHelper::AddWebappWithSkBitmap(
const ShortcutInfo& info,
const std::string& webapp_id,
const SkBitmap& icon_bitmap,
const base::Closure& splash_image_callback) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-
// Send the data to the Java side to create the shortcut.
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> java_webapp_id =
@@ -151,7 +145,7 @@ void ShortcutHelper::AddWebappInBackgroundWithSkBitmap(
callback_pointer);
}
-void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
+void ShortcutHelper::AddShortcutWithSkBitmap(
const ShortcutInfo& info,
const SkBitmap& icon_bitmap) {
JNIEnv* env = base::android::AttachCurrentThread();
@@ -295,7 +289,7 @@ GURL ShortcutHelper::GetScopeFromURL(const GURL& url) {
// Callback used by Java when the shortcut has been created.
// |splash_image_callback| is a pointer to a base::Closure allocated in
-// AddShortcutInBackgroundWithSkBitmap, so reinterpret_cast it back and run it.
+// AddShortcutWithSkBitmap, so reinterpret_cast it back and run it.
//
// This callback should only ever be called when the shortcut was for a
// webapp-capable site; otherwise, |splash_image_callback| will have never been
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/webapk/webapk_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698