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

Unified Diff: components/metrics/metrics_service.h

Issue 630983003: Declaring the weak_ptr_factory in proper order in src/components (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service.h
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h
index a6259537792409b2244c00cfd1d6adf6139024c1..de6c83497d27beda8779cf601cb5a1ba9b0735dc 100644
--- a/components/metrics/metrics_service.h
+++ b/components/metrics/metrics_service.h
@@ -244,6 +244,8 @@ class MetricsService : public base::HistogramFlattener {
NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN
};
+ friend class ::MetricsServiceAccessor;
+
typedef std::vector<SyntheticTrialGroup> SyntheticTrialGroups;
// Calls into the client to start metrics gathering.
@@ -430,14 +432,6 @@ class MetricsService : public base::HistogramFlattener {
// A number that identifies the how many times the app has been launched.
int session_id_;
- // Weak pointers factory used to post task on different threads. All weak
- // pointers managed by this factory have the same lifetime as MetricsService.
- base::WeakPtrFactory<MetricsService> self_ptr_factory_;
-
- // Weak pointers factory used for saving state. All weak pointers managed by
- // this factory are invalidated in ScheduleNextStateSave.
- base::WeakPtrFactory<MetricsService> state_saver_factory_;
-
// The scheduler for determining when uploads should happen.
scoped_ptr<MetricsReportingScheduler> scheduler_;
@@ -457,13 +451,19 @@ class MetricsService : public base::HistogramFlattener {
// exited-cleanly bit in the prefs.
static ShutdownCleanliness clean_shutdown_status_;
- friend class ::MetricsServiceAccessor;
-
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest,
PermutedEntropyCacheClearedWhenLowEntropyReset);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial);
+ // Weak pointers factory used to post task on different threads. All weak
+ // pointers managed by this factory have the same lifetime as MetricsService.
+ base::WeakPtrFactory<MetricsService> self_ptr_factory_;
+
+ // Weak pointers factory used for saving state. All weak pointers managed by
+ // this factory are invalidated in ScheduleNextStateSave.
+ base::WeakPtrFactory<MetricsService> state_saver_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MetricsService);
};
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698