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

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

Issue 2600893002: Prerender: exclude AGSA from the PrerenderSilence experiment (Closed)
Patch Set: Created 3 years, 12 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 | chrome/browser/prerender/prerender_unittest.cc » ('j') | 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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 return; 1255 return;
1256 int64_t recent_profile_bytes = 1256 int64_t recent_profile_bytes =
1257 profile_network_bytes_ - last_recorded_profile_network_bytes_; 1257 profile_network_bytes_ - last_recorded_profile_network_bytes_;
1258 last_recorded_profile_network_bytes_ = profile_network_bytes_; 1258 last_recorded_profile_network_bytes_ = profile_network_bytes_;
1259 DCHECK_GE(recent_profile_bytes, 0); 1259 DCHECK_GE(recent_profile_bytes, 0);
1260 histograms_->RecordNetworkBytes( 1260 histograms_->RecordNetworkBytes(
1261 origin, used, prerender_bytes, recent_profile_bytes); 1261 origin, used, prerender_bytes, recent_profile_bytes);
1262 } 1262 }
1263 1263
1264 bool PrerenderManager::IsPrerenderSilenceExperiment(Origin origin) const { 1264 bool PrerenderManager::IsPrerenderSilenceExperiment(Origin origin) const {
1265 if (origin == ORIGIN_OFFLINE) 1265 if (origin == ORIGIN_OFFLINE ||
1266 origin == ORIGIN_EXTERNAL_REQUEST_FORCED_CELLULAR) {
1266 return false; 1267 return false;
1268 }
1267 1269
1268 // The group name should contain expiration time formatted as: 1270 // The group name should contain expiration time formatted as:
1269 // "ExperimentYes_expires_YYYY-MM-DDTHH:MM:SSZ". 1271 // "ExperimentYes_expires_YYYY-MM-DDTHH:MM:SSZ".
1270 std::string group_name = 1272 std::string group_name =
1271 base::FieldTrialList::FindFullName("PrerenderSilence"); 1273 base::FieldTrialList::FindFullName("PrerenderSilence");
1272 const char kExperimentPrefix[] = "ExperimentYes"; 1274 const char kExperimentPrefix[] = "ExperimentYes";
1273 if (!base::StartsWith(group_name, kExperimentPrefix, 1275 if (!base::StartsWith(group_name, kExperimentPrefix,
1274 base::CompareCase::INSENSITIVE_ASCII)) { 1276 base::CompareCase::INSENSITIVE_ASCII)) {
1275 return false; 1277 return false;
1276 } 1278 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 return weak_factory_.GetWeakPtr(); 1364 return weak_factory_.GetWeakPtr();
1363 } 1365 }
1364 1366
1365 void PrerenderManager::SetPrerenderContentsFactoryForTest( 1367 void PrerenderManager::SetPrerenderContentsFactoryForTest(
1366 PrerenderContents::Factory* prerender_contents_factory) { 1368 PrerenderContents::Factory* prerender_contents_factory) {
1367 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1369 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1368 prerender_contents_factory_.reset(prerender_contents_factory); 1370 prerender_contents_factory_.reset(prerender_contents_factory);
1369 } 1371 }
1370 1372
1371 } // namespace prerender 1373 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698