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

Side by Side Diff: chrome/browser/android/data_usage/external_data_use_observer.h

Issue 2834463005: Fix race with google variation ID registration (Closed)
Patch Set: rebased Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // to move this, ExternalDataUseObserverBridge needs to hold a pointer to 71 // to move this, ExternalDataUseObserverBridge needs to hold a pointer to
72 // ExternalDataUseReporter. This is currently not doable, since this creates 72 // ExternalDataUseReporter. This is currently not doable, since this creates
73 // a circular dependency between ExternalDataUseReporter, DataUseTabModel and 73 // a circular dependency between ExternalDataUseReporter, DataUseTabModel and
74 // ExternalDataUseObserverBridge, which creates issues during desctruction. 74 // ExternalDataUseObserverBridge, which creates issues during desctruction.
75 void OnReportDataUseDone(bool success); 75 void OnReportDataUseDone(bool success);
76 76
77 ExternalDataUseReporter* GetExternalDataUseReporterForTesting() const { 77 ExternalDataUseReporter* GetExternalDataUseReporterForTesting() const {
78 return external_data_use_reporter_; 78 return external_data_use_reporter_;
79 } 79 }
80 80
81 void SetRegisterGoogleVariationID(bool register_google_variation_id); 81 void SetProfileSigninStatus(bool signin_status);
82 82
83 private: 83 private:
84 friend class DataUseTabModelTest; 84 friend class DataUseTabModelTest;
85 friend class DataUseUITabModelTest; 85 friend class DataUseUITabModelTest;
86 friend class ExternalDataUseObserverTest; 86 friend class ExternalDataUseObserverTest;
87 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, 87 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
88 MatchingRuleFetchOnControlAppInstall); 88 MatchingRuleFetchOnControlAppInstall);
89 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, 89 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
90 PeriodicFetchMatchingRules); 90 PeriodicFetchMatchingRules);
91 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, 91 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Time when the matching rules were last fetched. 129 // Time when the matching rules were last fetched.
130 base::TimeTicks last_matching_rules_fetch_time_; 130 base::TimeTicks last_matching_rules_fetch_time_;
131 131
132 // Duration after which matching rules are periodically fetched. 132 // Duration after which matching rules are periodically fetched.
133 const base::TimeDelta fetch_matching_rules_duration_; 133 const base::TimeDelta fetch_matching_rules_duration_;
134 134
135 // True if |this| is currently registered as a data use observer. 135 // True if |this| is currently registered as a data use observer.
136 bool registered_as_data_use_observer_; 136 bool registered_as_data_use_observer_;
137 137
138 // True if profile is signed in and authenticated.
139 bool profile_signin_status_;
140
138 base::ThreadChecker thread_checker_; 141 base::ThreadChecker thread_checker_;
139 142
140 base::WeakPtrFactory<ExternalDataUseObserver> weak_factory_; 143 base::WeakPtrFactory<ExternalDataUseObserver> weak_factory_;
141 144
142 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserver); 145 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserver);
143 }; 146 };
144 147
145 } // namespace android 148 } // namespace android
146 149
147 } // namespace chrome 150 } // namespace chrome
148 151
149 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 152 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698