OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <set> |
9 | 10 |
10 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
11 #include "content/browser/appcache/appcache_host.h" | 12 #include "content/browser/appcache/appcache_host.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 class AppCacheServiceImpl; | 17 class AppCacheServiceImpl; |
17 | 18 |
18 class CONTENT_EXPORT AppCacheBackendImpl { | 19 class CONTENT_EXPORT AppCacheBackendImpl { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 60 |
60 typedef base::hash_map<int, std::unique_ptr<AppCacheHost>> HostMap; | 61 typedef base::hash_map<int, std::unique_ptr<AppCacheHost>> HostMap; |
61 const HostMap& hosts() { return hosts_; } | 62 const HostMap& hosts() { return hosts_; } |
62 | 63 |
63 // Methods to support cross site navigations. Hosts are transferred | 64 // Methods to support cross site navigations. Hosts are transferred |
64 // from process to process accordingly, deparented from the old | 65 // from process to process accordingly, deparented from the old |
65 // processes backend and reparented to the new. | 66 // processes backend and reparented to the new. |
66 std::unique_ptr<AppCacheHost> TransferHostOut(int host_id); | 67 std::unique_ptr<AppCacheHost> TransferHostOut(int host_id); |
67 void TransferHostIn(int new_host_id, std::unique_ptr<AppCacheHost> host); | 68 void TransferHostIn(int new_host_id, std::unique_ptr<AppCacheHost> host); |
68 | 69 |
| 70 // PlzNaviate |
| 71 // The AppCacheHost is precreated by the AppCacheNavigationHandleCore class |
| 72 // when a navigation is initiated. We register the host with the backend in |
| 73 // this function and ignore registrations for this host id from the renderer. |
| 74 void RegisterPrecreatedHost(std::unique_ptr<AppCacheHost> host); |
| 75 |
69 private: | 76 private: |
70 AppCacheServiceImpl* service_; | 77 AppCacheServiceImpl* service_; |
71 AppCacheFrontend* frontend_; | 78 AppCacheFrontend* frontend_; |
72 int process_id_; | 79 int process_id_; |
73 HostMap hosts_; | 80 HostMap hosts_; |
74 | 81 |
| 82 // PlzNavigate: Contains a list of pending hosts which have been registered |
| 83 // via the RegisterPendingHost() function. The host is removed from the list |
| 84 // when the RegisterHost() function is called. |
| 85 std::set<int> pending_hosts_; |
| 86 |
75 DISALLOW_COPY_AND_ASSIGN(AppCacheBackendImpl); | 87 DISALLOW_COPY_AND_ASSIGN(AppCacheBackendImpl); |
76 }; | 88 }; |
77 | 89 |
78 } // namespace | 90 } // namespace |
79 | 91 |
80 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ | 92 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ |
OLD | NEW |