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

Side by Side Diff: chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h

Issue 6794005: Move sync notifier contruction out of syncer thread. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Minor fix. Created 9 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 | 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 // An implementation of SyncNotifier that wraps InvalidationNotifier 5 // An implementation of SyncNotifier that wraps InvalidationNotifier
6 // on its own thread. 6 // on its own thread.
7 7
8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_
9 #define CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ 9 #define CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_
10 #pragma once 10 #pragma once
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const std::string& client_info); 94 const std::string& client_info);
95 void DestroyWorkerThreadVars(); 95 void DestroyWorkerThreadVars();
96 96
97 // Equivalents of the public functions that are run on the worker 97 // Equivalents of the public functions that are run on the worker
98 // thread. 98 // thread.
99 void SetStateOnWorkerThread(const std::string& state); 99 void SetStateOnWorkerThread(const std::string& state);
100 void UpdateCredentialsOnWorkerThread(const std::string& email, 100 void UpdateCredentialsOnWorkerThread(const std::string& email,
101 const std::string& token); 101 const std::string& token);
102 void UpdateEnabledTypesOnWorkerThread(const syncable::ModelTypeSet& types); 102 void UpdateEnabledTypesOnWorkerThread(const syncable::ModelTypeSet& types);
103 103
104 MessageLoop* parent_message_loop_; 104 MessageLoop* construction_message_loop_;
105 MessageLoop* method_message_loop_;
105 106
106 scoped_refptr<ObserverListThreadSafe<SyncNotifierObserver> > observers_; 107 scoped_refptr<ObserverListThreadSafe<SyncNotifierObserver> > observers_;
107 108
108 base::Thread worker_thread_; 109 base::Thread worker_thread_;
109 // Created and destroyed on the worker thread. Not a scoped_ptr as 110 // Created and destroyed on the worker thread. Not a scoped_ptr as
110 // it's better to leak memory than to delete on the wrong thread. 111 // it's better to leak memory than to delete on the wrong thread.
111 // Created by CreateWorkerThreadVars() and destroyed by 112 // Created by CreateWorkerThreadVars() and destroyed by
112 // DestroyWorkerThreadVars(). 113 // DestroyWorkerThreadVars().
113 WorkerThreadVars* worker_thread_vars_; 114 WorkerThreadVars* worker_thread_vars_;
114 115
115 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier); 116 DISALLOW_COPY_AND_ASSIGN(NonBlockingInvalidationNotifier);
116 }; 117 };
117 118
118 } // namespace sync_notifier 119 } // namespace sync_notifier
119 120
120 // We own our worker thread, so we don't need to be ref-counted. 121 // We own our worker thread, so we don't need to be ref-counted.
121 DISABLE_RUNNABLE_METHOD_REFCOUNT( 122 DISABLE_RUNNABLE_METHOD_REFCOUNT(
122 sync_notifier::NonBlockingInvalidationNotifier); 123 sync_notifier::NonBlockingInvalidationNotifier);
123 124
124 #endif // CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_ 125 #endif // CHROME_BROWSER_SYNC_NOTIFIER_NON_BLOCKING_INVALIDATION_NOTIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698