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

Side by Side Diff: components/precache/content/precache_manager.cc

Issue 151183006: Set up field trial for precache experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years, 10 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/precache/content/precache_manager.h" 5 #include "components/precache/content/precache_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/field_trial.h" 11 #include "base/metrics/field_trial.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "components/precache/core/precache_database.h" 13 #include "components/precache/core/precache_database.h"
14 #include "components/precache/core/precache_switches.h" 14 #include "components/precache/core/precache_switches.h"
15 #include "components/precache/core/url_list_provider.h" 15 #include "components/precache/core/url_list_provider.h"
16 #include "content/public/browser/browser_context.h" 16 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "net/base/network_change_notifier.h" 18 #include "net/base/network_change_notifier.h"
19 19
20 using content::BrowserThread; 20 using content::BrowserThread;
21 21
22 namespace { 22 namespace {
23 23
24 const char kPrecacheFieldTrialName[] = "Precache"; 24 const char kPrecacheFieldTrialName[] = "Precache";
25 const char kPrecacheFieldTrialEnabledGroup[] = "PrecacheEnabled"; 25 const char kPrecacheFieldTrialEnabledGroup[] = "Enabled";
26 26
27 } // namespace 27 } // namespace
28 28
29 namespace precache { 29 namespace precache {
30 30
31 PrecacheManager::PrecacheManager(content::BrowserContext* browser_context) 31 PrecacheManager::PrecacheManager(content::BrowserContext* browser_context)
32 : browser_context_(browser_context), 32 : browser_context_(browser_context),
33 precache_database_(new PrecacheDatabase()), 33 precache_database_(new PrecacheDatabase()),
34 is_precaching_(false) { 34 is_precaching_(false) {
35 base::FilePath db_path(browser_context_->GetPath().Append( 35 base::FilePath db_path(browser_context_->GetPath().Append(
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return; 154 return;
155 } 155 }
156 156
157 // Start precaching. 157 // Start precaching.
158 precache_fetcher_.reset( 158 precache_fetcher_.reset(
159 new PrecacheFetcher(urls, browser_context_->GetRequestContext(), this)); 159 new PrecacheFetcher(urls, browser_context_->GetRequestContext(), this));
160 precache_fetcher_->Start(); 160 precache_fetcher_->Start();
161 } 161 }
162 162
163 } // namespace precache 163 } // namespace precache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698