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

Side by Side Diff: chrome/browser/sync/syncable/directory_change_delegate.h

Issue 7190001: [Sync] Split DirectoryChangeListener for thread-safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 9 years, 6 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 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
6 #define CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ 6 #define CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/syncable/model_type.h" 9 #include "chrome/browser/sync/syncable/model_type.h"
10 #include "chrome/browser/sync/syncable/syncable.h" 10 #include "chrome/browser/sync/syncable/syncable.h"
11 11
12 namespace syncable { 12 namespace syncable {
13 13
14 // This is an interface for listening to directory change events, triggered by 14 // This is an interface for listening to directory change events, triggered by
15 // the releasing of the syncable transaction. The listener performs work to 15 // the releasing of the syncable transaction. The delegate performs work to
16 // 1. Calculate changes, depending on the source of the transaction 16 // 1. Calculate changes, depending on the source of the transaction
17 // (HandleCalculateChangesChangeEventFromSyncer/Syncapi). 17 // (HandleCalculateChangesChangeEventFromSyncer/Syncapi).
18 // 2. Perform final work while the transaction is held 18 // 2. Perform final work while the transaction is held
19 // (HandleTransactionEndingChangeEvent). 19 // (HandleTransactionEndingChangeEvent).
20 // 3. Perform any work that should be done after the transaction is released. 20 // 3. Perform any work that should be done after the transaction is released.
21 // (HandleTransactionCompleteChangeEvent). 21 // (HandleTransactionCompleteChangeEvent).
22 class DirectoryChangeListener { 22 //
23 // Note that these methods may be called on *any* thread.
24 class DirectoryChangeDelegate {
23 public: 25 public:
24 virtual void HandleCalculateChangesChangeEventFromSyncApi( 26 virtual void HandleCalculateChangesChangeEventFromSyncApi(
25 const OriginalEntries& originals, 27 const OriginalEntries& originals,
26 const WriterTag& writer,
27 BaseTransaction* trans) = 0; 28 BaseTransaction* trans) = 0;
28 virtual void HandleCalculateChangesChangeEventFromSyncer( 29 virtual void HandleCalculateChangesChangeEventFromSyncer(
29 const OriginalEntries& originals, 30 const OriginalEntries& originals,
30 const WriterTag& writer,
31 BaseTransaction* trans) = 0; 31 BaseTransaction* trans) = 0;
32 // Must return the set of all ModelTypes that were modified in the
33 // transaction.
32 virtual ModelTypeBitSet HandleTransactionEndingChangeEvent( 34 virtual ModelTypeBitSet HandleTransactionEndingChangeEvent(
33 BaseTransaction* trans) = 0; 35 BaseTransaction* trans) = 0;
34 virtual void HandleTransactionCompleteChangeEvent( 36 virtual void HandleTransactionCompleteChangeEvent(
35 const ModelTypeBitSet& models_with_changes) = 0; 37 const ModelTypeBitSet& models_with_changes) = 0;
36 protected: 38 protected:
37 virtual ~DirectoryChangeListener() {} 39 virtual ~DirectoryChangeDelegate() {}
38 }; 40 };
39 41
40 } // namespace syncable 42 } // namespace syncable
41 43
42 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ 44 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/sync_session_unittest.cc ('k') | chrome/browser/sync/syncable/directory_change_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698