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

Side by Side Diff: chrome/browser/prerender/prerender_manager.cc

Issue 1896943002: Remove PrerenderManager::OnCloseWebContentsDeleter::SwappedOut (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make it compile Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/prerender/prerender_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::Bind(&OnCloseWebContentsDeleter::ScheduleWebContentsForDeletion, 137 base::Bind(&OnCloseWebContentsDeleter::ScheduleWebContentsForDeletion,
138 AsWeakPtr(), true), 138 AsWeakPtr(), true),
139 base::TimeDelta::FromSeconds(kDeleteWithExtremePrejudiceSeconds)); 139 base::TimeDelta::FromSeconds(kDeleteWithExtremePrejudiceSeconds));
140 } 140 }
141 141
142 void CloseContents(WebContents* source) override { 142 void CloseContents(WebContents* source) override {
143 DCHECK_EQ(tab_.get(), source); 143 DCHECK_EQ(tab_.get(), source);
144 ScheduleWebContentsForDeletion(false); 144 ScheduleWebContentsForDeletion(false);
145 } 145 }
146 146
147 void SwappedOut(WebContents* source) override {
148 DCHECK_EQ(tab_.get(), source);
149 ScheduleWebContentsForDeletion(false);
150 }
151
152 bool ShouldSuppressDialogs(WebContents* source) override { 147 bool ShouldSuppressDialogs(WebContents* source) override {
153 // Use this as a proxy for getting statistics on how often we fail to honor 148 // Use this as a proxy for getting statistics on how often we fail to honor
154 // the beforeunload event. 149 // the beforeunload event.
155 DCHECK_EQ(tab_.get(), source); 150 DCHECK_EQ(tab_.get(), source);
156 suppressed_dialog_ = true; 151 suppressed_dialog_ = true;
157 return true; 152 return true;
158 } 153 }
159 154
160 private: 155 private:
161 static const int kDeleteWithExtremePrejudiceSeconds = 3; 156 static const int kDeleteWithExtremePrejudiceSeconds = 3;
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 } 1355 }
1361 1356
1362 void PrerenderManager::RenderProcessHostDestroyed( 1357 void PrerenderManager::RenderProcessHostDestroyed(
1363 content::RenderProcessHost* host) { 1358 content::RenderProcessHost* host) {
1364 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1359 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1365 size_t erased = prerender_process_hosts_.erase(host); 1360 size_t erased = prerender_process_hosts_.erase(host);
1366 DCHECK_EQ(1u, erased); 1361 DCHECK_EQ(1u, erased);
1367 } 1362 }
1368 1363
1369 } // namespace prerender 1364 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698