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

Side by Side Diff: chrome/browser/extensions/api/dial/dial_service.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // True when we are currently doing discovery. 261 // True when we are currently doing discovery.
262 bool discovery_active_; 262 bool discovery_active_;
263 263
264 // The number of requests that have been sent in the current discovery. 264 // The number of requests that have been sent in the current discovery.
265 int num_requests_sent_; 265 int num_requests_sent_;
266 266
267 // The maximum number of requests to send per discovery cycle. 267 // The maximum number of requests to send per discovery cycle.
268 int max_requests_; 268 int max_requests_;
269 269
270 // Timer for finishing discovery. 270 // Timer for finishing discovery.
271 base::OneShotTimer<DialServiceImpl> finish_timer_; 271 base::OneShotTimer finish_timer_;
272 272
273 // The delay for |finish_timer_|; how long to wait for discovery to finish. 273 // The delay for |finish_timer_|; how long to wait for discovery to finish.
274 // Setting this to zero disables the timer. 274 // Setting this to zero disables the timer.
275 base::TimeDelta finish_delay_; 275 base::TimeDelta finish_delay_;
276 276
277 // Timer for sending multiple requests at fixed intervals. 277 // Timer for sending multiple requests at fixed intervals.
278 base::RepeatingTimer<DialServiceImpl> request_timer_; 278 base::RepeatingTimer request_timer_;
279 279
280 // The delay for |request_timer_|; how long to wait between successive 280 // The delay for |request_timer_|; how long to wait between successive
281 // requests. 281 // requests.
282 base::TimeDelta request_interval_; 282 base::TimeDelta request_interval_;
283 283
284 // List of observers. 284 // List of observers.
285 base::ObserverList<Observer> observer_list_; 285 base::ObserverList<Observer> observer_list_;
286 286
287 // Thread checker. 287 // Thread checker.
288 base::ThreadChecker thread_checker_; 288 base::ThreadChecker thread_checker_;
289 289
290 friend class DialServiceTest; 290 friend class DialServiceTest;
291 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestSendMultipleRequests); 291 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestSendMultipleRequests);
292 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestMultipleNetworkInterfaces); 292 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestMultipleNetworkInterfaces);
293 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestNotifyOnError); 293 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestNotifyOnError);
294 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDeviceDiscovered); 294 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDeviceDiscovered);
295 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDiscoveryFinished); 295 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDiscoveryFinished);
296 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDiscoveryRequest); 296 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestOnDiscoveryRequest);
297 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestResponseParsing); 297 FRIEND_TEST_ALL_PREFIXES(DialServiceTest, TestResponseParsing);
298 DISALLOW_COPY_AND_ASSIGN(DialServiceImpl); 298 DISALLOW_COPY_AND_ASSIGN(DialServiceImpl);
299 }; 299 };
300 300
301 } // namespace extensions 301 } // namespace extensions
302 302
303 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_ 303 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698