Commit 5097ce9b authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

AppCache: Delete non-PlzNavigate dead code.

Bug: 789577
Change-Id: I10cbc8ad7e7c1052ccabfcc9bc9328367a537faa
Reviewed-on: https://chromium-review.googlesource.com/1118077Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571306}
parent b00d5b77
......@@ -126,39 +126,8 @@ void AppCacheBackendImpl::GetResourceList(
host->GetResourceList(resource_infos);
}
std::unique_ptr<AppCacheHost> AppCacheBackendImpl::TransferHostOut(
int host_id) {
auto found = hosts_.find(host_id);
if (found == hosts_.end()) {
NOTREACHED();
return std::unique_ptr<AppCacheHost>();
}
std::unique_ptr<AppCacheHost> transferree = std::move(found->second);
// Put a new empty host in its place.
found->second = std::make_unique<AppCacheHost>(host_id, frontend_, service_);
// We give up ownership.
transferree->PrepareForTransfer();
return transferree;
}
void AppCacheBackendImpl::TransferHostIn(int new_host_id,
std::unique_ptr<AppCacheHost> host) {
auto found = hosts_.find(new_host_id);
if (found == hosts_.end()) {
NOTREACHED();
return;
}
host->CompleteTransfer(new_host_id, frontend_);
found->second = std::move(host);
}
void AppCacheBackendImpl::RegisterPrecreatedHost(
std::unique_ptr<AppCacheHost> host) {
DCHECK(IsBrowserSideNavigationEnabled());
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(host.get());
......
......@@ -59,13 +59,6 @@ class CONTENT_EXPORT AppCacheBackendImpl {
using HostMap = base::hash_map<int, std::unique_ptr<AppCacheHost>>;
const HostMap& hosts() { return hosts_; }
// Methods to support cross site navigations. Hosts are transferred
// from process to process accordingly, deparented from the old
// processes backend and reparented to the new.
std::unique_ptr<AppCacheHost> TransferHostOut(int host_id);
void TransferHostIn(int new_host_id, std::unique_ptr<AppCacheHost> host);
// 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.
......
......@@ -39,17 +39,15 @@ void AppCacheDispatcherHost::Create(ChromeAppCacheService* appcache_service,
void AppCacheDispatcherHost::RegisterHost(int32_t host_id) {
if (appcache_service_) {
// PlzNavigate
// The AppCacheHost could have been precreated in which case we want to
// register it with the backend here.
if (IsBrowserSideNavigationEnabled()) {
std::unique_ptr<content::AppCacheHost> host =
AppCacheNavigationHandleCore::GetPrecreatedHost(host_id);
if (host.get()) {
backend_impl_.RegisterPrecreatedHost(std::move(host));
return;
}
std::unique_ptr<content::AppCacheHost> host =
AppCacheNavigationHandleCore::GetPrecreatedHost(host_id);
if (host.get()) {
backend_impl_.RegisterPrecreatedHost(std::move(host));
return;
}
if (!backend_impl_.RegisterHost(host_id)) {
mojo::ReportBadMessage("ACDH_REGISTER");
}
......
......@@ -509,20 +509,6 @@ void AppCacheHost::NotifyMainResourceBlocked(const GURL& manifest_url) {
blocked_manifest_url_ = manifest_url;
}
void AppCacheHost::PrepareForTransfer() {
// This can only happen prior to the document having been loaded.
DCHECK(!associated_cache());
DCHECK(!is_selection_pending());
DCHECK(!group_being_updated_.get());
host_id_ = kAppCacheNoHostId;
frontend_ = nullptr;
}
void AppCacheHost::CompleteTransfer(int host_id, AppCacheFrontend* frontend) {
host_id_ = host_id;
frontend_ = frontend;
}
base::WeakPtr<AppCacheHost> AppCacheHost::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
......
......@@ -191,10 +191,6 @@ class CONTENT_EXPORT AppCacheHost
const GURL& first_party_url() const { return first_party_url_; }
// Methods to support cross site navigations.
void PrepareForTransfer();
void CompleteTransfer(int host_id, AppCacheFrontend* frontend);
// Returns a weak pointer reference to the host.
base::WeakPtr<AppCacheHost> GetWeakPtr();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment