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

Unified Diff: content/browser/appcache/appcache_dispatcher_host.h

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Rebase to tip correctly Created 4 years 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
Index: content/browser/appcache/appcache_dispatcher_host.h
diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h
index 9b882c8a97e706e4bf6723e15ff1b5dd35dae5b6..c17bf3496f34288c0affa40e9a6434fe463f198d 100644
--- a/content/browser/appcache/appcache_dispatcher_host.h
+++ b/content/browser/appcache/appcache_dispatcher_host.h
@@ -38,6 +38,18 @@ class AppCacheDispatcherHost : public BrowserMessageFilter {
~AppCacheDispatcherHost() override;
private:
+ // PlzNavigate:
+ // The AppCacheHost is precreated by the AppCacheNavigationHandleCore class
+ // when a navigation is initiated. We register the host with the backend in
+ // this function and ignore registrations for this host id from the renderer.
+ void RegisterPrecreatedHost(std::unique_ptr<AppCacheHost> host);
+
+ // PlzNavigate: A pending host is registered when a navigation is initiated
+ // by the browser. The registration completes when the renderer sends the
+ // AppCacheHostMsg_RegisterHost message to us. This function should be called
+ // on the IO thread.
+ void RegisterPendingHost(int host);
+
// IPC message handlers
void OnRegisterHost(int host_id);
void OnUnregisterHost(int host_id);
@@ -62,6 +74,10 @@ class AppCacheDispatcherHost : public BrowserMessageFilter {
void StartUpdateCallback(bool result, void* param);
void SwapCacheCallback(bool result, void* param);
+ // Returns the AppCacheDispatcherHost instance associated with the
+ // |process_id| passed in.
+ static scoped_refptr<AppCacheDispatcherHost> GetHostForProcess(
+ int process_id);
scoped_refptr<ChromeAppCacheService> appcache_service_;
AppCacheFrontendProxy frontend_proxy_;
@@ -75,6 +91,16 @@ class AppCacheDispatcherHost : public BrowserMessageFilter {
// The corresponding ChildProcessHost object's id().
int process_id_;
+ // PlzNavigate: Contains a list of pending hosts which have been registered
+ // via the RegisterPendingHost() function. The host is removed from the list
+ // when we receive the AppCacheHostMsg_RegisterHost IPC message.
+ std::set<int> pending_hosts_;
+
+ // PlzNavigate:
+ // This class needs to invoke functionality to register the precreated host
+ // with the AppCacheDispatcherHost.
+ friend class AppCacheNavigationHandleCore;
+
base::WeakPtrFactory<AppCacheDispatcherHost> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AppCacheDispatcherHost);

Powered by Google App Engine
This is Rietveld 408576698