OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/sessions/sync_session_context.h" | 5 #include "chrome/browser/sync/sessions/sync_session_context.h" |
6 | 6 |
7 #include "chrome/browser/sync/sessions/debug_info_getter.h" | 7 #include "chrome/browser/sync/sessions/debug_info_getter.h" |
8 #include "chrome/browser/sync/sessions/session_state.h" | 8 #include "chrome/browser/sync/sessions/session_state.h" |
9 #include "chrome/browser/sync/util/extensions_activity_monitor.h" | 9 #include "chrome/browser/sync/util/extensions_activity_monitor.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 registrar_(model_safe_worker_registrar), | 26 registrar_(model_safe_worker_registrar), |
27 extensions_activity_monitor_(new ExtensionsActivityMonitor()), | 27 extensions_activity_monitor_(new ExtensionsActivityMonitor()), |
28 notifications_enabled_(false), | 28 notifications_enabled_(false), |
29 max_commit_batch_size_(kDefaultMaxCommitBatchSize), | 29 max_commit_batch_size_(kDefaultMaxCommitBatchSize), |
30 debug_info_getter_(debug_info_getter) { | 30 debug_info_getter_(debug_info_getter) { |
31 std::vector<SyncEngineEventListener*>::const_iterator it; | 31 std::vector<SyncEngineEventListener*>::const_iterator it; |
32 for (it = listeners.begin(); it != listeners.end(); ++it) | 32 for (it = listeners.begin(); it != listeners.end(); ++it) |
33 listeners_.AddObserver(*it); | 33 listeners_.AddObserver(*it); |
34 } | 34 } |
35 | 35 |
36 SyncSessionContext::SyncSessionContext() | |
37 : connection_manager_(NULL), | |
38 directory_manager_(NULL), | |
39 registrar_(NULL), | |
40 extensions_activity_monitor_(NULL), | |
41 debug_info_getter_(NULL) { | |
42 } | |
43 | |
36 SyncSessionContext::~SyncSessionContext() { | 44 SyncSessionContext::~SyncSessionContext() { |
37 // In unittests, there may be no UI thread, so the above will fail. | 45 // In unittests, there may be no UI thread, so the above will fail. |
38 if (!BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, | 46 if (!BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, |
39 extensions_activity_monitor_)) { | 47 extensions_activity_monitor_)) { |
40 delete extensions_activity_monitor_; | 48 delete extensions_activity_monitor_; |
41 } | 49 } |
42 } | 50 } |
43 | 51 |
52 void SyncSessionContext::AddUnthrottleTime(const syncable::ModelTypeSet& types, | |
53 const base::TimeTicks& time) { | |
akalin
2011/11/21 20:04:26
indent
lipalani1
2011/11/21 21:55:38
Done.
| |
54 for (syncable::ModelTypeSet::const_iterator it = types.begin(); | |
55 it != types.end(); | |
56 ++it) { | |
57 DCHECK(unthrottle_times_.count(*it) == 0); | |
akalin
2011/11/21 20:04:26
DCHECK_EQ
lipalani1
2011/11/21 21:55:38
Actually removed it. I thought about this further
| |
58 unthrottle_times_[*it] = time; | |
59 } | |
60 } | |
61 | |
44 } // namespace sessions | 62 } // namespace sessions |
45 } // namespace browser_sync | 63 } // namespace browser_sync |
OLD | NEW |