OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // A class to run the syncer on a thread. | 5 // A class to run the syncer on a thread. |
6 // This is the default implementation of SyncerThread whose Stop implementation | 6 // This is the default implementation of SyncerThread whose Stop implementation |
7 // does not support a timeout, but is greatly simplified. | 7 // does not support a timeout, but is greatly simplified. |
8 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ | 8 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ |
9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ | 9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 struct TalkMediatorEvent; | 48 struct TalkMediatorEvent; |
49 | 49 |
50 class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>, | 50 class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>, |
51 public sessions::SyncSession::Delegate { | 51 public sessions::SyncSession::Delegate { |
52 FRIEND_TEST(SyncerThreadTest, CalculateSyncWaitTime); | 52 FRIEND_TEST(SyncerThreadTest, CalculateSyncWaitTime); |
53 FRIEND_TEST(SyncerThreadTest, CalculatePollingWaitTime); | 53 FRIEND_TEST(SyncerThreadTest, CalculatePollingWaitTime); |
54 FRIEND_TEST(SyncerThreadWithSyncerTest, Polling); | 54 FRIEND_TEST(SyncerThreadWithSyncerTest, Polling); |
55 FRIEND_TEST(SyncerThreadWithSyncerTest, Nudge); | 55 FRIEND_TEST(SyncerThreadWithSyncerTest, Nudge); |
56 FRIEND_TEST(SyncerThreadWithSyncerTest, Throttling); | 56 FRIEND_TEST(SyncerThreadWithSyncerTest, Throttling); |
57 FRIEND_TEST(SyncerThreadWithSyncerTest, AuthInvalid); | 57 FRIEND_TEST(SyncerThreadWithSyncerTest, AuthInvalid); |
58 FRIEND_TEST(SyncerThreadWithSyncerTest, Pause); | 58 FRIEND_TEST(SyncerThreadWithSyncerTest, DISABLED_Pause); |
59 friend class SyncerThreadWithSyncerTest; | 59 friend class SyncerThreadWithSyncerTest; |
60 friend class SyncerThreadFactory; | 60 friend class SyncerThreadFactory; |
61 public: | 61 public: |
62 // Encapsulates the parameters that make up an interval on which the | 62 // Encapsulates the parameters that make up an interval on which the |
63 // syncer thread is sleeping. | 63 // syncer thread is sleeping. |
64 struct WaitInterval { | 64 struct WaitInterval { |
65 enum Mode { | 65 enum Mode { |
66 // A wait interval whose duration has not been affected by exponential | 66 // A wait interval whose duration has not been affected by exponential |
67 // backoff. The base case for exponential backoff falls in to this case | 67 // backoff. The base case for exponential backoff falls in to this case |
68 // (e.g when the exponent is 1). So far, we don't need a separate case. | 68 // (e.g when the exponent is 1). So far, we don't need a separate case. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 // Useful for unit tests | 333 // Useful for unit tests |
334 bool disable_idle_detection_; | 334 bool disable_idle_detection_; |
335 | 335 |
336 DISALLOW_COPY_AND_ASSIGN(SyncerThread); | 336 DISALLOW_COPY_AND_ASSIGN(SyncerThread); |
337 }; | 337 }; |
338 | 338 |
339 } // namespace browser_sync | 339 } // namespace browser_sync |
340 | 340 |
341 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ | 341 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_THREAD_H_ |
OLD | NEW |