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..cb95bf5085e16bb19cf98acea093c22a91952418 100644 |
--- a/content/browser/appcache/appcache_dispatcher_host.h |
+++ b/content/browser/appcache/appcache_dispatcher_host.h |
@@ -38,6 +38,20 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { |
~AppCacheDispatcherHost() override; |
private: |
+ // PlzNavigate: |
+ // The AppCache backend is setup by the AppCacheFrameNavigationHandler class |
+ // when a navigation for a FrameTreeNode occurs. When the navigation commits |
+ // we get notified here along with the |backend| which was registered when |
+ // the navigation was initiated. We need to switch the backend instance |
+ // maintained by this class instance with the one passed in. |
+ void FrameNavigationCommitted(std::unique_ptr<AppCacheBackendImpl> backend); |
michaeln
2016/11/22 00:17:27
I think this assumes the destination process had n
ananta
2016/11/23 04:05:14
Reverted
|
+ |
+ // 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. |
michaeln
2016/11/22 00:17:27
why does the navigation we need more than the 'hos
ananta
2016/11/23 04:05:14
Leaving this as is for now. I don't know if we can
|
+ void RegisterPendingHost(int host); |
+ |
// IPC message handlers |
void OnRegisterHost(int host_id); |
void OnUnregisterHost(int host_id); |
@@ -62,10 +76,14 @@ 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_; |
- AppCacheBackendImpl backend_impl_; |
+ std::unique_ptr<AppCacheBackendImpl> backend_impl_; |
content::GetStatusCallback get_status_callback_; |
content::StartUpdateCallback start_update_callback_; |
@@ -75,6 +93,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 initialize the |
+ // AppCacheBackendImpl instance, etc. |
+ friend class AppCacheFrameNavigationHandler; |
+ |
base::WeakPtrFactory<AppCacheDispatcherHost> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(AppCacheDispatcherHost); |