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

Unified Diff: content/child/appcache/web_application_cache_host_impl.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Address review comments 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
« no previous file with comments | « content/child/appcache/web_application_cache_host_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/appcache/web_application_cache_host_impl.cc
diff --git a/content/child/appcache/web_application_cache_host_impl.cc b/content/child/appcache/web_application_cache_host_impl.cc
index 1493304b4d658a47e450d43a1c36c58a2dfd6a3e..ee079528d2c9e604a38575b1c26186d0cceafae2 100644
--- a/content/child/appcache/web_application_cache_host_impl.cc
+++ b/content/child/appcache/web_application_cache_host_impl.cc
@@ -10,6 +10,7 @@
#include "base/id_map.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
@@ -57,16 +58,25 @@ WebApplicationCacheHostImpl* WebApplicationCacheHostImpl::FromId(int id) {
WebApplicationCacheHostImpl::WebApplicationCacheHostImpl(
WebApplicationCacheHostClient* client,
- AppCacheBackend* backend)
+ AppCacheBackend* backend,
+ int appcache_host_id)
: client_(client),
backend_(backend),
- host_id_(all_hosts()->Add(this)),
status_(APPCACHE_STATUS_UNCACHED),
is_scheme_supported_(false),
is_get_method_(false),
is_new_master_entry_(MAYBE),
was_select_cache_called_(false) {
- DCHECK(client && backend && (host_id_ != kAppCacheNoHostId));
+ DCHECK(client && backend);
+ // PlzNavigate: The browser passes the ID to be used.
+ if (appcache_host_id != kAppCacheNoHostId) {
+ DCHECK(IsBrowserSideNavigationEnabled());
+ all_hosts()->AddWithID(this, appcache_host_id);
+ host_id_ = appcache_host_id;
+ } else {
+ host_id_ = all_hosts()->Add(this);
+ }
+ DCHECK(host_id_ != kAppCacheNoHostId);
backend_->RegisterHost(host_id_);
}
« no previous file with comments | « content/child/appcache/web_application_cache_host_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698