summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prerender/prerender_tracker.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-25 20:52:39 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-25 20:52:39 +0000
commiteb4524fe5209b09e798054079c43198007aae8a9 (patch)
treeb2b8cdbe52ff516d464541d927a9b3496df22c79 /chrome/browser/prerender/prerender_tracker.cc
parentce17dddb8d512f30229a29d62ddd8349834eda8a (diff)
downloadchromium_src-eb4524fe5209b09e798054079c43198007aae8a9.zip
chromium_src-eb4524fe5209b09e798054079c43198007aae8a9.tar.gz
chromium_src-eb4524fe5209b09e798054079c43198007aae8a9.tar.bz2
Revert 237109 "When there is a session storage namespace mismatc..."
> When there is a session storage namespace mismatch during prerender swap-in, attempt merging namespaces. > > R=davidben@chromium.org, jam@chromium.org, michaeln@chromium.org, creis@chromium.org > > Review URL: https://codereview.chromium.org/59823003 TBR=tburkard@chromium.org Review URL: https://codereview.chromium.org/86393002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_tracker.cc')
-rw-r--r--chrome/browser/prerender/prerender_tracker.cc99
1 files changed, 2 insertions, 97 deletions
diff --git a/chrome/browser/prerender/prerender_tracker.cc b/chrome/browser/prerender/prerender_tracker.cc
index 6588f9d..8a80802 100644
--- a/chrome/browser/prerender/prerender_tracker.cc
+++ b/chrome/browser/prerender/prerender_tracker.cc
@@ -8,13 +8,14 @@
#include "base/logging.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prerender/prerender_manager.h"
-#include "chrome/browser/prerender/prerender_pending_swap_throttle.h"
#include "chrome/browser/prerender/prerender_resource_throttle.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_context.h"
#include "net/base/load_flags.h"
using content::BrowserThread;
+using content::RenderViewHost;
namespace prerender {
@@ -191,16 +192,6 @@ bool PrerenderTracker::IsPrerenderingOnIOThread(int child_id,
return resource_throttle_io_thread_map_.count(child_route_id_pair) > 0;
}
-bool PrerenderTracker::IsPendingSwapRequestOnIOThread(
- int child_id, int route_id, const GURL& url) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
- ChildRouteIdPair child_route_id_pair(child_id, route_id);
- PendingSwapThrottleMap::const_iterator it =
- pending_swap_throttle_map_.find(child_route_id_pair);
- return (it != pending_swap_throttle_map_.end() && it->second.url == url);
-}
-
void PrerenderTracker::AddResourceThrottleOnIOThread(
int child_id,
int route_id,
@@ -214,22 +205,6 @@ void PrerenderTracker::AddResourceThrottleOnIOThread(
resource_throttle_map_it->second.push_back(throttle);
}
-void PrerenderTracker::AddPendingSwapThrottleOnIOThread(
- int child_id,
- int route_id,
- const GURL& url,
- const base::WeakPtr<PrerenderPendingSwapThrottle>& throttle) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
- ChildRouteIdPair child_route_id_pair(child_id, route_id);
- PendingSwapThrottleMap::iterator it =
- pending_swap_throttle_map_.find(child_route_id_pair);
- DCHECK(it != pending_swap_throttle_map_.end());
- if (it == pending_swap_throttle_map_.end())
- return;
- it->second.throttles.push_back(throttle);
-}
-
void PrerenderTracker::AddPrerenderOnIOThread(
const ChildRouteIdPair& child_route_id_pair) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -264,61 +239,6 @@ void PrerenderTracker::RemovePrerenderOnIOThread(
resource_throttle_io_thread_map_.erase(resource_throttle_map_it);
}
-void PrerenderTracker::AddPrerenderPendingSwapOnIOThread(
- const ChildRouteIdPair& child_route_id_pair,
- const GURL& url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- std::pair<PendingSwapThrottleMap::iterator, bool> insert_result =
- pending_swap_throttle_map_.insert(std::make_pair(
- child_route_id_pair, PendingSwapThrottleData(url)));
- DCHECK(insert_result.second);
-}
-
-void PrerenderTracker::RemovePrerenderPendingSwapOnIOThread(
- const ChildRouteIdPair& child_route_id_pair,
- bool swap_successful) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- PendingSwapThrottleMap::iterator it =
- pending_swap_throttle_map_.find(child_route_id_pair);
- DCHECK(it != pending_swap_throttle_map_.end());
- // Cancel or resume all throttled resources.
- for (size_t i = 0; i < it->second.throttles.size(); i++) {
- if (!it->second.throttles[i])
- continue;
- if (swap_successful)
- it->second.throttles[i]->Cancel();
- else
- it->second.throttles[i]->Resume();
- }
- pending_swap_throttle_map_.erase(child_route_id_pair);
-}
-
-void PrerenderTracker::AddPrerenderPendingSwap(
- const ChildRouteIdPair& child_route_id_pair,
- const GURL& url) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&AddPrerenderPendingSwapOnIOThreadTask,
- child_route_id_pair, url));
-}
-
-void PrerenderTracker::RemovePrerenderPendingSwap(
- const ChildRouteIdPair& child_route_id_pair,
- bool swap_successful) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&RemovePrerenderPendingSwapOnIOThreadTask,
- child_route_id_pair, swap_successful));
-}
-
-PrerenderTracker::PendingSwapThrottleData::PendingSwapThrottleData(
- const GURL& swap_url)
- : url(swap_url) {
-}
-
-PrerenderTracker::PendingSwapThrottleData::~PendingSwapThrottleData() {
-}
-
// static
PrerenderTracker* PrerenderTracker::GetDefault() {
return g_browser_process->prerender_tracker();
@@ -337,19 +257,4 @@ void PrerenderTracker::RemovePrerenderOnIOThreadTask(
GetDefault()->RemovePrerenderOnIOThread(child_route_id_pair, final_status);
}
-// static
-void PrerenderTracker::AddPrerenderPendingSwapOnIOThreadTask(
- const ChildRouteIdPair& child_route_id_pair,
- const GURL& url) {
- GetDefault()->AddPrerenderPendingSwapOnIOThread(child_route_id_pair, url);
-}
-
-// static
-void PrerenderTracker::RemovePrerenderPendingSwapOnIOThreadTask(
- const ChildRouteIdPair& child_route_id_pair,
- bool swap_successful) {
- GetDefault()->RemovePrerenderPendingSwapOnIOThread(child_route_id_pair,
- swap_successful);
-}
-
} // namespace prerender