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

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

Issue 591313005: Provide a way to specify in Finch trials to disable prerender local (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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_local_predictor.h" 5 #include "chrome/browser/prerender/prerender_local_predictor.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 "Prerender.LocalPredictorTimeUntilUsed", 609 "Prerender.LocalPredictorTimeUntilUsed",
610 GetCurrentTime() - current_prerender_->actual_start_time, 610 GetCurrentTime() - current_prerender_->actual_start_time,
611 base::TimeDelta::FromMilliseconds(10), 611 base::TimeDelta::FromMilliseconds(10),
612 base::TimeDelta::FromMilliseconds(GetMaxLocalPredictionTimeMs()), 612 base::TimeDelta::FromMilliseconds(GetMaxLocalPredictionTimeMs()),
613 50); 613 50);
614 last_swapped_in_prerender_.reset(current_prerender_.release()); 614 last_swapped_in_prerender_.reset(current_prerender_.release());
615 RecordEvent(EVENT_ADD_VISIT_PRERENDER_IDENTIFIED); 615 RecordEvent(EVENT_ADD_VISIT_PRERENDER_IDENTIFIED);
616 } 616 }
617 if (ShouldExcludeTransitionForPrediction(info.transition)) 617 if (ShouldExcludeTransitionForPrediction(info.transition))
618 return; 618 return;
619 Profile* profile = prerender_manager_->profile();
620 if (!profile || DisableLocalPredictorBasedOnSyncAndConfiguration(profile))
jkarlin 2014/09/23 14:54:03 I expected to see something call your new Temporar
tburkard 2014/09/24 15:15:34 Done.
621 return;
619 RecordEvent(EVENT_ADD_VISIT_RELEVANT_TRANSITION); 622 RecordEvent(EVENT_ADD_VISIT_RELEVANT_TRANSITION);
620 base::TimeDelta max_age = 623 base::TimeDelta max_age =
621 base::TimeDelta::FromMilliseconds(GetMaxLocalPredictionTimeMs()); 624 base::TimeDelta::FromMilliseconds(GetMaxLocalPredictionTimeMs());
622 base::TimeDelta min_age = 625 base::TimeDelta min_age =
623 base::TimeDelta::FromMilliseconds(kMinLocalPredictionTimeMs); 626 base::TimeDelta::FromMilliseconds(kMinLocalPredictionTimeMs);
624 std::set<URLID> next_urls_currently_found; 627 std::set<URLID> next_urls_currently_found;
625 std::map<URLID, int> next_urls_num_found; 628 std::map<URLID, int> next_urls_num_found;
626 int num_occurrences_of_current_visit = 0; 629 int num_occurrences_of_current_visit = 0;
627 base::Time last_visited; 630 base::Time last_visited;
628 scoped_ptr<CandidatePrerenderInfo> lookup_info( 631 scoped_ptr<CandidatePrerenderInfo> lookup_info(
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 break; 1569 break;
1567 case content::SessionStorageNamespace::MERGE_RESULT_MERGEABLE: 1570 case content::SessionStorageNamespace::MERGE_RESULT_MERGEABLE:
1568 RecordEvent(EVENT_NAMESPACE_MISMATCH_MERGE_RESULT_MERGEABLE); 1571 RecordEvent(EVENT_NAMESPACE_MISMATCH_MERGE_RESULT_MERGEABLE);
1569 break; 1572 break;
1570 default: 1573 default:
1571 NOTREACHED(); 1574 NOTREACHED();
1572 } 1575 }
1573 } 1576 }
1574 1577
1575 } // namespace prerender 1578 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698