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

Unified Diff: chrome/browser/prefetch/prefetch.cc

Issue 142473003: Binds prefetching to the predictive networking privacy option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: chrome/browser/prefetch/prefetch.cc
diff --git a/chrome/browser/prefetch/prefetch.cc b/chrome/browser/prefetch/prefetch.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b2fc9abeac2ab247ed929f70b3b826e89f32365f
--- /dev/null
+++ b/chrome/browser/prefetch/prefetch.cc
@@ -0,0 +1,23 @@
+// Copyright 2014 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/prefetch/prefetch.h"
+
+#include <string>
+
+#include "base/metrics/field_trial.h"
+#include "base/strings/string_util.h"
+#include "chrome/browser/prefetch/prefetch_field_trial.h"
+#include "chrome/browser/profiles/profile_io_data.h"
+
+namespace prefetch {
+
+bool IsPrefetchEnabled(content::ResourceContext* resource_context) {
+ ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
+ if (io_data != NULL && io_data->network_prediction_enabled()->GetValue())
+ return IsPrefetchFieldTrialEnabled();
+ return false;
+}
+
+} // namespace prefetch

Powered by Google App Engine
This is Rietveld 408576698