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

Side by Side Diff: chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h

Issue 2402903002: Make the timing of ManifestUpgradeDetectorFetcher::Start() call less subtle (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
6 #define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 6 #define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h" 9 #include "base/android/jni_weak_ref.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const base::android::JavaParamRef<jobject>& obj, 46 const base::android::JavaParamRef<jobject>& obj,
47 const base::android::JavaParamRef<jobject>& java_web_contents); 47 const base::android::JavaParamRef<jobject>& java_web_contents);
48 48
49 // Registers JNI hooks. 49 // Registers JNI hooks.
50 static bool Register(JNIEnv* env); 50 static bool Register(JNIEnv* env);
51 51
52 private: 52 private:
53 ~ManifestUpgradeDetectorFetcher() override; 53 ~ManifestUpgradeDetectorFetcher() override;
54 54
55 // content::WebContentsObserver: 55 // content::WebContentsObserver:
56 void DidFinishLoad(content::RenderFrameHost* render_frame_host, 56 void DidStopLoading() override;
57 const GURL& validated_url) override; 57
58 // Fetches the installable data.
59 void FetchInstallableData();
58 60
59 // Called once the installable data has been fetched. 61 // Called once the installable data has been fetched.
60 void OnDidGetInstallableData(const InstallableData& installable_data); 62 void OnDidGetInstallableData(const InstallableData& installable_data);
61 63
62 // Called with the computed Murmur2 hash for the app icon. 64 // Called with the computed Murmur2 hash for the app icon.
63 void OnGotIconMurmur2Hash(const std::string& icon_murmur2_hash); 65 void OnGotIconMurmur2Hash(const std::string& icon_murmur2_hash);
64 66
65 void OnDataAvailable(const ShortcutInfo& info, 67 void OnDataAvailable(const ShortcutInfo& info,
66 const std::string& icon_murmur2_hash, 68 const std::string& icon_murmur2_hash,
67 const SkBitmap& icon); 69 const SkBitmap& icon);
68 70
69 // Points to the Java object. 71 // Points to the Java object.
70 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 72 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
71 73
72 // The detector will only fetch the URL within the scope of the WebAPK. 74 // The detector will only fetch the URL within the scope of the WebAPK.
73 const GURL scope_; 75 const GURL scope_;
74 76
75 // The WebAPK's Web Manifest URL that the detector is looking for. 77 // The WebAPK's Web Manifest URL that the detector is looking for.
76 const GURL web_manifest_url_; 78 const GURL web_manifest_url_;
77 79
80 // The URL for which the installable data is being fetched / was last fetched.
81 GURL last_fetched_url_;
82
78 // Downloads app icon and computes Murmur2 hash. 83 // Downloads app icon and computes Murmur2 hash.
79 std::unique_ptr<WebApkIconHasher> icon_hasher_; 84 std::unique_ptr<WebApkIconHasher> icon_hasher_;
80 85
81 // Downloaded data for |web_manifest_url_|. 86 // Downloaded data for |web_manifest_url_|.
82 ShortcutInfo info_; 87 ShortcutInfo info_;
83 SkBitmap icon_; 88 SkBitmap icon_;
84 89
85 base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_; 90 base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_;
86 91
87 DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher); 92 DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher);
88 }; 93 };
89 94
90 #endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 95 #endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698