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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Consequently, it does not support looking up an object by title | 32 // Consequently, it does not support looking up an object by title |
33 // and parent, since such a lookup is not uniquely determined. Lastly, | 33 // and parent, since such a lookup is not uniquely determined. Lastly, |
34 // unlike a filesystem model, objects in the Sync API model have a strict | 34 // unlike a filesystem model, objects in the Sync API model have a strict |
35 // ordering within a parent; the position is manipulable by callers, and | 35 // ordering within a parent; the position is manipulable by callers, and |
36 // children of a node can be enumerated in the order of their position. | 36 // children of a node can be enumerated in the order of their position. |
37 | 37 |
38 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 38 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
39 #define CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 39 #define CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
40 | 40 |
41 #include "base/basictypes.h" | 41 #include "base/basictypes.h" |
| 42 #include "build/build_config.h" |
42 | 43 |
43 #if (defined(OS_WIN) || defined(OS_WINDOWS)) | 44 #if defined(OS_WIN) |
44 typedef wchar_t sync_char16; | 45 typedef wchar_t sync_char16; |
45 #else | 46 #else |
46 typedef uint16 sync_char16; | 47 typedef uint16 sync_char16; |
47 #endif | 48 #endif |
48 | 49 |
49 // The MSVC compiler for Windows requires that any classes exported by, or | 50 // The MSVC compiler for Windows requires that any classes exported by, or |
50 // imported from, a dynamic library be decorated with the following fanciness. | 51 // imported from, a dynamic library be decorated with the following fanciness. |
51 #if (defined(OS_WIN) || defined(OS_WINDOWS)) | 52 #if defined(OS_WIN) |
52 #if COMPILING_SYNCAPI_LIBRARY | 53 #if COMPILING_SYNCAPI_LIBRARY |
53 #define SYNC_EXPORT __declspec(dllexport) | 54 #define SYNC_EXPORT __declspec(dllexport) |
54 #elif COMPILING_SYNCAPI_STUB | 55 #elif COMPILING_SYNCAPI_STUB |
55 #define SYNC_EXPORT | 56 #define SYNC_EXPORT |
56 #else | 57 #else |
57 #define SYNC_EXPORT __declspec(dllimport) | 58 #define SYNC_EXPORT __declspec(dllimport) |
58 #endif | 59 #endif |
59 #else | 60 #else |
60 #define SYNC_EXPORT | 61 #define SYNC_EXPORT |
61 #endif // OS_WIN || OS_WINDOWS | 62 #endif // OS_WIN |
62 | 63 |
63 // Forward declarations of internal class types so that sync API objects | 64 // Forward declarations of internal class types so that sync API objects |
64 // may have opaque pointers to these types. | 65 // may have opaque pointers to these types. |
65 namespace syncable { | 66 namespace syncable { |
66 class BaseTransaction; | 67 class BaseTransaction; |
67 class DirectoryManager; | 68 class DirectoryManager; |
68 class Entry; | 69 class Entry; |
69 class MutableEntry; | 70 class MutableEntry; |
70 class ReadTransaction; | 71 class ReadTransaction; |
71 class ScopedDirLookup; | 72 class ScopedDirLookup; |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 // Subclasses should implement to invoke DoWork on |visitor| once on a thread | 703 // Subclasses should implement to invoke DoWork on |visitor| once on a thread |
703 // appropriate for data model modifications. | 704 // appropriate for data model modifications. |
704 // While it doesn't hurt, the impl does not need to be re-entrant (for now). | 705 // While it doesn't hurt, the impl does not need to be re-entrant (for now). |
705 // Note: |visitor| is owned by caller. | 706 // Note: |visitor| is owned by caller. |
706 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; | 707 virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0; |
707 }; | 708 }; |
708 | 709 |
709 } // namespace sync_api | 710 } // namespace sync_api |
710 | 711 |
711 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 712 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |