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

Unified Diff: chrome/browser/prerender/prerender_pending_swap_throttle.cc

Issue 797443002: Remove prerender sessionStorage namespace merging (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 months 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 | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/prerender/prerender_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_pending_swap_throttle.cc
diff --git a/chrome/browser/prerender/prerender_pending_swap_throttle.cc b/chrome/browser/prerender/prerender_pending_swap_throttle.cc
deleted file mode 100644
index 5148ace853df1ed0d0776fffeb9884735e477e6f..0000000000000000000000000000000000000000
--- a/chrome/browser/prerender/prerender_pending_swap_throttle.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/prerender/prerender_pending_swap_throttle.h"
-
-#include "chrome/browser/prerender/prerender_final_status.h"
-#include "chrome/browser/prerender/prerender_manager.h"
-#include "chrome/browser/prerender/prerender_tracker.h"
-#include "chrome/browser/prerender/prerender_util.h"
-#include "content/public/browser/resource_controller.h"
-#include "content/public/browser/resource_request_info.h"
-#include "net/url_request/url_request.h"
-
-using content::ResourceType;
-
-namespace prerender {
-
-PrerenderPendingSwapThrottle::PrerenderPendingSwapThrottle(
- net::URLRequest* request,
- PrerenderTracker* tracker)
- : request_(request),
- tracker_(tracker),
- throttled_(false) {
-}
-
-void PrerenderPendingSwapThrottle::WillStartRequest(bool* defer) {
- DCHECK(!throttled_);
- const content::ResourceRequestInfo* info =
- content::ResourceRequestInfo::ForRequest(request_);
-
- // We only care about main frame loads.
- if (info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME)
- return;
-
- int render_process_id = info->GetChildID();
- int render_frame_id = info->GetRenderFrameID();
-
- // Check if this request is for a URL we intend to swap in.
- if (!tracker_->IsPendingSwapRequestOnIOThread(
- render_process_id, render_frame_id, request_->url())) {
- return;
- }
-
- *defer = true;
- throttled_ = true;
- tracker_->AddPendingSwapThrottleOnIOThread(
- render_process_id, render_frame_id, request_->url(), this->AsWeakPtr());
-}
-
-const char* PrerenderPendingSwapThrottle::GetNameForLogging() const {
- return "PrerenderPendingSwapThrottle";
-}
-
-void PrerenderPendingSwapThrottle::Resume() {
- DCHECK(throttled_);
-
- throttled_ = false;
- controller()->Resume();
-}
-
-void PrerenderPendingSwapThrottle::Cancel() {
- DCHECK(throttled_);
-
- throttled_ = false;
- controller()->Cancel();
-}
-
-} // namespace prerender
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/prerender/prerender_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698