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

Side by Side Diff: chrome/browser/sync/sessions/sync_session_context.cc

Issue 8595023: [Sync] Parse and save per-data type throttle data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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) {
54 for (syncable::ModelTypeSet::const_iterator it = types.begin();
55 it != types.end();
56 ++it) {
57 unthrottle_times_[*it] = time;
58 }
59 }
60
44 } // namespace sessions 61 } // namespace sessions
45 } // namespace browser_sync 62 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698