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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 10392007: Restoring the chrome variatioons client, with a fix for browser_test failures caused by it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved comment Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/metrics/proto/study.proto » ('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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "chrome/browser/gpu_util.h" 48 #include "chrome/browser/gpu_util.h"
49 #include "chrome/browser/instant/instant_field_trial.h" 49 #include "chrome/browser/instant/instant_field_trial.h"
50 #include "chrome/browser/jankometer.h" 50 #include "chrome/browser/jankometer.h"
51 #include "chrome/browser/language_usage_metrics.h" 51 #include "chrome/browser/language_usage_metrics.h"
52 #include "chrome/browser/metrics/histogram_synchronizer.h" 52 #include "chrome/browser/metrics/histogram_synchronizer.h"
53 #include "chrome/browser/metrics/field_trial_synchronizer.h" 53 #include "chrome/browser/metrics/field_trial_synchronizer.h"
54 #include "chrome/browser/metrics/metrics_log.h" 54 #include "chrome/browser/metrics/metrics_log.h"
55 #include "chrome/browser/metrics/metrics_service.h" 55 #include "chrome/browser/metrics/metrics_service.h"
56 #include "chrome/browser/metrics/thread_watcher.h" 56 #include "chrome/browser/metrics/thread_watcher.h"
57 #include "chrome/browser/metrics/tracking_synchronizer.h" 57 #include "chrome/browser/metrics/tracking_synchronizer.h"
58 #include "chrome/browser/metrics/variations_service.h"
58 #include "chrome/browser/nacl_host/nacl_process_host.h" 59 #include "chrome/browser/nacl_host/nacl_process_host.h"
59 #include "chrome/browser/net/chrome_net_log.h" 60 #include "chrome/browser/net/chrome_net_log.h"
60 #include "chrome/browser/net/predictor.h" 61 #include "chrome/browser/net/predictor.h"
61 #include "chrome/browser/notifications/desktop_notification_service.h" 62 #include "chrome/browser/notifications/desktop_notification_service.h"
62 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 63 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
63 #include "chrome/browser/plugin_prefs.h" 64 #include "chrome/browser/plugin_prefs.h"
64 #include "chrome/browser/prefs/pref_service.h" 65 #include "chrome/browser/prefs/pref_service.h"
65 #include "chrome/browser/prefs/pref_value_store.h" 66 #include "chrome/browser/prefs/pref_value_store.h"
66 #include "chrome/browser/prefs/scoped_user_pref_update.h" 67 #include "chrome/browser/prefs/scoped_user_pref_update.h"
67 #include "chrome/browser/prerender/prerender_field_trial.h" 68 #include "chrome/browser/prerender/prerender_field_trial.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 584 const CommandLine* command_line = CommandLine::ForCurrentProcess();
584 if (command_line->HasSwitch(switches::kForceFieldTrials)) { 585 if (command_line->HasSwitch(switches::kForceFieldTrials)) {
585 std::string persistent = command_line->GetSwitchValueASCII( 586 std::string persistent = command_line->GetSwitchValueASCII(
586 switches::kForceFieldTrials); 587 switches::kForceFieldTrials);
587 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); 588 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent);
588 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << 589 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials <<
589 " list specified."; 590 " list specified.";
590 } 591 }
591 #endif // NDEBUG 592 #endif // NDEBUG
592 593
594 VariationsService* variations_service =
595 browser_process_->variations_service();
596 variations_service->CreateTrialsFromSeed(browser_process_->local_state());
597
593 SetupFieldTrials(metrics->recording_active(), 598 SetupFieldTrials(metrics->recording_active(),
594 local_state_->IsManagedPreference( 599 local_state_->IsManagedPreference(
595 prefs::kMaxConnectionsPerProxy)); 600 prefs::kMaxConnectionsPerProxy));
596 601
597 // Initialize FieldTrialSynchronizer system. This is a singleton and is used 602 // Initialize FieldTrialSynchronizer system. This is a singleton and is used
598 // for posting tasks via base::Bind. Its deleted when it goes out of scope. 603 // for posting tasks via base::Bind. Its deleted when it goes out of scope.
599 // Even though base::Bind does AddRef and Release, the object will not be 604 // Even though base::Bind does AddRef and Release, the object will not be
600 // deleted after the Task is executed. 605 // deleted after the Task is executed.
601 field_trial_synchronizer_ = new FieldTrialSynchronizer(); 606 field_trial_synchronizer_ = new FieldTrialSynchronizer();
602 } 607 }
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 parameters().autorelease_pool->Recycle(); 1859 parameters().autorelease_pool->Recycle();
1855 #endif 1860 #endif
1856 1861
1857 RecordPreReadExperimentTime("Startup.BrowserOpenTabs", 1862 RecordPreReadExperimentTime("Startup.BrowserOpenTabs",
1858 base::TimeTicks::Now() - browser_open_start); 1863 base::TimeTicks::Now() - browser_open_start);
1859 1864
1860 // TODO(mad): Move this call in a proper place on CrOS. 1865 // TODO(mad): Move this call in a proper place on CrOS.
1861 // http://crosbug.com/17687 1866 // http://crosbug.com/17687
1862 #if !defined(OS_CHROMEOS) 1867 #if !defined(OS_CHROMEOS)
1863 // If we're running tests (ui_task is non-null), then we don't want to 1868 // If we're running tests (ui_task is non-null), then we don't want to
1864 // call FetchLanguageListFromTranslateServer 1869 // call FetchLanguageListFromTranslateServer or
1865 if (parameters().ui_task == NULL && translate_manager_ != NULL) { 1870 // StartFetchingVariationsSeed.
1866 translate_manager_->FetchLanguageListFromTranslateServer( 1871 if (parameters().ui_task == NULL) {
1867 profile_->GetPrefs()); 1872 // Request new variations seed information from server.
1873 browser_process_->variations_service()->StartFetchingVariationsSeed();
1874
1875 if (translate_manager_ != NULL) {
1876 translate_manager_->FetchLanguageListFromTranslateServer(
1877 profile_->GetPrefs());
1878 }
1868 } 1879 }
1869 #endif 1880 #endif
1870 1881
1871 run_message_loop_ = true; 1882 run_message_loop_ = true;
1872 } else { 1883 } else {
1873 run_message_loop_ = false; 1884 run_message_loop_ = false;
1874 } 1885 }
1875 browser_creator_.reset(); 1886 browser_creator_.reset();
1876 1887
1877 PostBrowserStart(); 1888 PostBrowserStart();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 if (base::win::GetVersion() <= base::win::VERSION_XP) 2018 if (base::win::GetVersion() <= base::win::VERSION_XP)
2008 uma_name += "_XP"; 2019 uma_name += "_XP";
2009 2020
2010 uma_name += "_PreRead_"; 2021 uma_name += "_PreRead_";
2011 uma_name += pre_read_percentage; 2022 uma_name += pre_read_percentage;
2012 AddPreReadHistogramTime(uma_name.c_str(), time); 2023 AddPreReadHistogramTime(uma_name.c_str(), time);
2013 } 2024 }
2014 #endif 2025 #endif
2015 #endif 2026 #endif
2016 } 2027 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/metrics/proto/study.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698