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

Side by Side Diff: chrome/browser/installable/installable_manager.h

Issue 2963473003: Don't block InstallableManager::GetData calls when waiting for a service worker. (Closed)
Patch Set: Created 3 years, 5 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
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_INSTALLABLE_INSTALLABLE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_
6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 // Returns the error code associated with the resources requested in |params|, 188 // Returns the error code associated with the resources requested in |params|,
189 // or NO_ERROR_DETECTED if there is no error. 189 // or NO_ERROR_DETECTED if there is no error.
190 InstallableStatusCode GetErrorCode(const InstallableParams& params); 190 InstallableStatusCode GetErrorCode(const InstallableParams& params);
191 191
192 // Gets/sets parts of particular properties. Exposed for testing. 192 // Gets/sets parts of particular properties. Exposed for testing.
193 InstallableStatusCode manifest_error() const; 193 InstallableStatusCode manifest_error() const;
194 InstallableStatusCode valid_manifest_error() const; 194 InstallableStatusCode valid_manifest_error() const;
195 void set_valid_manifest_error(InstallableStatusCode error_code); 195 void set_valid_manifest_error(InstallableStatusCode error_code);
196 InstallableStatusCode worker_error() const; 196 InstallableStatusCode worker_error() const;
197 bool worker_waiting() const;
198 InstallableStatusCode icon_error(const IconParams& icon_params); 197 InstallableStatusCode icon_error(const IconParams& icon_params);
199 GURL& icon_url(const IconParams& icon_params); 198 GURL& icon_url(const IconParams& icon_params);
200 const SkBitmap* icon(const IconParams& icon); 199 const SkBitmap* icon(const IconParams& icon);
201 200
202 // Returns the WebContents to which this object is attached, or nullptr if the 201 // Returns the WebContents to which this object is attached, or nullptr if the
203 // WebContents doesn't exist or is currently being destroyed. 202 // WebContents doesn't exist or is currently being destroyed.
204 content::WebContents* GetWebContents(); 203 content::WebContents* GetWebContents();
205 204
206 // Returns true if |params| requires no more work to be done. 205 // Returns true if |params| requires no more work to be done.
207 bool IsComplete(const InstallableParams& params) const; 206 bool IsComplete(const InstallableParams& params) const;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 void DidFinishNavigation(content::NavigationHandle* handle) override; 241 void DidFinishNavigation(content::NavigationHandle* handle) override;
243 void WebContentsDestroyed() override; 242 void WebContentsDestroyed() override;
244 243
245 const GURL& manifest_url() const; 244 const GURL& manifest_url() const;
246 const content::Manifest& manifest() const; 245 const content::Manifest& manifest() const;
247 bool is_installable() const; 246 bool is_installable() const;
248 247
249 // The list of <params, callback> pairs that have come from a call to GetData. 248 // The list of <params, callback> pairs that have come from a call to GetData.
250 std::vector<Task> tasks_; 249 std::vector<Task> tasks_;
251 250
251 // Tasks which are waiting indefinitely for a service worker to be detected.
252 std::vector<Task> paused_tasks_;
253
252 // Installable properties cached on this object. 254 // Installable properties cached on this object.
253 std::unique_ptr<ManifestProperty> manifest_; 255 std::unique_ptr<ManifestProperty> manifest_;
254 std::unique_ptr<ValidManifestProperty> valid_manifest_; 256 std::unique_ptr<ValidManifestProperty> valid_manifest_;
255 std::unique_ptr<ServiceWorkerProperty> worker_; 257 std::unique_ptr<ServiceWorkerProperty> worker_;
256 std::map<IconParams, IconProperty> icons_; 258 std::map<IconParams, IconProperty> icons_;
257 259
258 // Owned by the storage partition attached to the content::WebContents which 260 // Owned by the storage partition attached to the content::WebContents which
259 // this object is scoped to. 261 // this object is scoped to.
260 content::ServiceWorkerContext* service_worker_context_; 262 content::ServiceWorkerContext* service_worker_context_;
261 263
(...skipping 10 matching lines...) Expand all
272 274
273 bool is_active_; 275 bool is_active_;
274 bool is_pwa_check_complete_; 276 bool is_pwa_check_complete_;
275 277
276 base::WeakPtrFactory<InstallableManager> weak_factory_; 278 base::WeakPtrFactory<InstallableManager> weak_factory_;
277 279
278 DISALLOW_COPY_AND_ASSIGN(InstallableManager); 280 DISALLOW_COPY_AND_ASSIGN(InstallableManager);
279 }; 281 };
280 282
281 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ 283 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698