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

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

Issue 2932593005: Simplify WebAPK proto building code (Closed)
Patch Set: Merge branch 'master' into background_updates000 Created 3 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
« no previous file with comments | « no previous file | 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 52ab9b48f540daddadf288d3618f1ba4ba32506e..807b24b4f5d102177624f64954b5510d51a1ddb2 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -87,12 +87,17 @@ class WebApkInstaller : public net::URLFetcherDelegate {
const base::android::JavaParamRef<jobject>& obj,
jint result);
- // Creates a WebApk install or update request.
- // Should be used only for testing.
- void BuildWebApkProtoInBackgroundForTesting(
- const base::Callback<void(std::unique_ptr<webapk::WebApk>)>& callback,
+ // Asynchronously builds the WebAPK proto on a background thread for an update
+ // or install request. Runs |callback| on the calling thread when complete.
+ static void BuildProto(
+ const ShortcutInfo& shortcut_info,
+ const SkBitmap& primary_icon,
+ const SkBitmap& badge_icon,
+ const std::string& package_name,
+ const std::string& version,
const std::map<std::string, std::string>& icon_url_to_murmur2_hash,
- bool is_manifest_stale);
+ bool is_manifest_stale,
+ const base::Callback<void(std::unique_ptr<webapk::WebApk>)>& callback);
// Registers JNI hooks.
static bool Register(JNIEnv* env);
@@ -150,22 +155,10 @@ class WebApkInstaller : public net::URLFetcherDelegate {
const std::string& primary_icon_hash,
const std::string& badge_icon_hash);
- // Sends request to WebAPK server to create WebAPK. During a successful
- // request the WebAPK server responds with the URL of the generated WebAPK.
- // |webapk| is the proto to send to the WebAPK server.
- void SendCreateWebApkRequest(std::unique_ptr<webapk::WebApk> webapk_proto);
-
- // Sends request to WebAPK server to update a WebAPK. During a successful
- // request the WebAPK server responds with the URL of the generated WebAPK.
- // |webapk| is the proto to send to the WebAPK server.
- void SendUpdateWebApkRequest(int webapk_version,
- std::unique_ptr<webapk::WebApk> webapk_proto);
-
// Sends a request to WebAPK server to create/update WebAPK. During a
// successful request the WebAPK server responds with the URL of the generated
// WebAPK.
- void SendRequest(std::unique_ptr<webapk::WebApk> request_proto,
- const GURL& server_url);
+ void SendRequest(std::unique_ptr<webapk::WebApk> request_proto);
net::URLRequestContextGetter* request_context_getter_;
@@ -203,7 +196,6 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// Whether the server wants the WebAPK to request updates less frequently.
bool relax_updates_;
-
// Indicates whether the installer is for installing or updating a WebAPK.
TaskType task_type_;
« no previous file with comments | « no previous file | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698