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

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

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void CloseContents(WebContents* source) override { 184 void CloseContents(WebContents* source) override {
185 DCHECK_EQ(tab_, source); 185 DCHECK_EQ(tab_, source);
186 ScheduleWebContentsForDeletion(false); 186 ScheduleWebContentsForDeletion(false);
187 } 187 }
188 188
189 void SwappedOut(WebContents* source) override { 189 void SwappedOut(WebContents* source) override {
190 DCHECK_EQ(tab_, source); 190 DCHECK_EQ(tab_, source);
191 ScheduleWebContentsForDeletion(false); 191 ScheduleWebContentsForDeletion(false);
192 } 192 }
193 193
194 bool ShouldSuppressDialogs() override { 194 bool ShouldSuppressDialogs(WebContents* source) override {
davidben 2014/11/07 19:08:26 Nit: May as well add a DCHECK_EQ(tab_, source);
195 // Use this as a proxy for getting statistics on how often we fail to honor 195 // Use this as a proxy for getting statistics on how often we fail to honor
196 // the beforeunload event. 196 // the beforeunload event.
197 suppressed_dialog_ = true; 197 suppressed_dialog_ = true;
198 return true; 198 return true;
199 } 199 }
200 200
201 private: 201 private:
202 static const int kDeleteWithExtremePrejudiceSeconds = 3; 202 static const int kDeleteWithExtremePrejudiceSeconds = 3;
203 203
204 void ScheduleWebContentsForDeletion(bool timeout) { 204 void ScheduleWebContentsForDeletion(bool timeout) {
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 content::RenderProcessHost* host) { 1893 content::RenderProcessHost* host) {
1894 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1894 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1895 prerender_process_hosts_.erase(host); 1895 prerender_process_hosts_.erase(host);
1896 BrowserThread::PostTask( 1896 BrowserThread::PostTask(
1897 BrowserThread::IO, FROM_HERE, 1897 BrowserThread::IO, FROM_HERE,
1898 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread, 1898 base::Bind(&PrerenderTracker::RemovePrerenderCookieStoreOnIOThread,
1899 base::Unretained(prerender_tracker()), host->GetID(), false)); 1899 base::Unretained(prerender_tracker()), host->GetID(), false));
1900 } 1900 }
1901 1901
1902 } // namespace prerender 1902 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.cc ('k') | chrome/browser/tab_contents/background_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698