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

Unified Diff: chrome/browser/browser_main.cc

Issue 113473: Automatically adapt to faster/slower uploads of renderer histograms... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
===================================================================
--- chrome/browser/browser_main.cc (revision 17103)
+++ chrome/browser/browser_main.cc (working copy)
@@ -46,6 +46,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/histogram_synchronizer.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/main_function_params.h"
#include "chrome/common/pref_names.h"
@@ -438,6 +439,13 @@
// Initialize histogram statistics gathering system.
StatisticsRecorder statistics;
+ // Initialize histogram synchronizer system. This is a singleton and is used
+ // for posting tasks via NewRunnableMethod. Its deleted when it goes out of
+ // scope. Even though NewRunnableMethod does AddRef and Release, the object
+ // will not be deleted after the Task is executed.
+ scoped_refptr<HistogramSynchronizer> histogram_synchronizer =
+ new HistogramSynchronizer();
+
// Initialize the shared instance of user data manager.
scoped_ptr<UserDataManager> user_data_manager(UserDataManager::Create());
@@ -576,14 +584,18 @@
// Set up a field trial to see what disabling DNS pre-resolution does to
// latency of network transactions.
FieldTrial::Probability kDIVISOR = 100;
- FieldTrial::Probability k_PROBABILITY_PER_GROUP = 10; // 10%.
+ FieldTrial::Probability k_PROBABILITY_PER_GROUP = 10; // 10% probability.
+ // For options we don't (currently) wish to test, we use zero probability.
+ FieldTrial::Probability k_PROBABILITY_DISABLED = 0;
scoped_refptr<FieldTrial> dns_trial = new FieldTrial("DnsImpact", kDIVISOR);
dns_trial->AppendGroup("_disabled_prefetch", k_PROBABILITY_PER_GROUP);
+ // Don't discard names (erase these lines) yet, as we may use them, and we
+ // have histogram data named for these options.
int disabled_plus_4_connections = dns_trial->AppendGroup(
- "_disabled_prefetch_4_connections", k_PROBABILITY_PER_GROUP);
+ "_disabled_prefetch_4_connections", k_PROBABILITY_DISABLED);
int enabled_plus_4_connections = dns_trial->AppendGroup(
- "_enabled_prefetch_4_connections", k_PROBABILITY_PER_GROUP);
+ "_enabled_prefetch_4_connections", k_PROBABILITY_DISABLED);
scoped_ptr<chrome_browser_net::DnsPrefetcherInit> dns_prefetch_init;
if (dns_trial->group() == FieldTrial::kNotParticipating ||
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698