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

Unified Diff: chrome/browser/android/webapk/webapk_installer.h

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.cc ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapk/webapk_installer.h
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h
index 0aac26e96a522b7b08c106179e9d5f8f8a42e361..3c18002005e730d6976687d6a06bab77892cafdf 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -73,13 +73,10 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// net::URLFetcherDelegate:
void OnURLFetchComplete(const net::URLFetcher* source) override;
- // Initializes |request_context_getter_| on UI thread.
- void InitializeRequestContextGetterOnUIThread(
- content::BrowserContext* browser_context);
-
// Sends request to WebAPK server to create WebAPK. During a successful
// request the WebAPK server responds with the URL of the generated WebAPK.
- void SendCreateWebApkRequest();
+ // |webapk| is the proto to send to the WebAPK server.
+ void SendCreateWebApkRequest(std::unique_ptr<webapk::WebApk> webapk_proto);
// Called with the URL of generated WebAPK and the package name that the
// WebAPK should be installed at.
@@ -95,7 +92,8 @@ class WebApkInstaller : public net::URLFetcherDelegate {
FileDownloader::Result result);
// Populates webapk::WebApk and returns it.
- std::unique_ptr<webapk::WebApk> BuildWebApkProto();
+ // Must be called on a worker thread because it encodes an SkBitmap.
+ std::unique_ptr<webapk::WebApk> BuildWebApkProtoInBackground();
// Called when the request to the WebAPK server times out or when the WebAPK
// download times out.
@@ -141,8 +139,8 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// The number of milliseconds to wait for the WebAPK download to complete.
int download_timeout_ms_;
- // Used to get |weak_ptr_| on the IO thread.
- base::WeakPtrFactory<WebApkInstaller> io_weak_ptr_factory_;
+ // Used to get |weak_ptr_|.
+ base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebApkInstaller);
};
« no previous file with comments | « chrome/browser/android/shortcut_helper.cc ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698