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

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

Issue 15080009: Enable the side-effect free whitelist and use it for local browsing based (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/prerender_local_predictor.cc
===================================================================
--- chrome/browser/prerender/prerender_local_predictor.cc (revision 200384)
+++ chrome/browser/prerender/prerender_local_predictor.cc (working copy)
@@ -15,6 +15,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/timer.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history_database.h"
#include "chrome/browser/history/history_db_task.h"
#include "chrome/browser/history/history_service.h"
@@ -23,6 +24,8 @@
#include "chrome/browser/prerender/prerender_histograms.h"
#include "chrome/browser/prerender/prerender_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/safe_browsing/database_manager.h"
+#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
@@ -662,6 +665,9 @@
scoped_ptr<LocalPredictorURLLookupInfo> info) {
RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_STARTED);
scoped_ptr<LocalPredictorURLInfo> url_info;
+ scoped_refptr<SafeBrowsingDatabaseManager> sb_db_manager =
+ g_browser_process->safe_browsing_service()->database_manager();
+
for (int i = 0; i < static_cast<int>(info->candidate_urls_.size()); i++) {
url_info.reset(new LocalPredictorURLInfo(info->candidate_urls_[i]));
@@ -710,6 +716,12 @@
url_info.reset(NULL);
continue;
}
+ if (sb_db_manager->CheckSideEffectFreeWhitelistUrl(url_info->url)) {
+ // If a page is on the side-effect free whitelist, we will just prerender
+ // it without any additional checks.
+ RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_ON_SIDE_EFFECT_FREE_WHITELIST);
+ break;
+ }
if (!url_info->logged_in && url_info->logged_in_lookup_ok) {
RecordEvent(EVENT_CONTINUE_PRERENDER_CHECK_NOT_LOGGED_IN);
break;
« no previous file with comments | « chrome/browser/prerender/prerender_local_predictor.h ('k') | chrome/browser/safe_browsing/database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698