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

Side by Side Diff: webkit/fileapi/syncable/local_file_sync_status.h

Issue 11103031: webkit: Merge blob and fileapi into one build target 'storage' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ 5 #ifndef WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_
6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ 6 #define WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "webkit/fileapi/file_system_url.h" 14 #include "webkit/fileapi/file_system_url.h"
15 15
16 namespace fileapi { 16 namespace fileapi {
17 17
18 // Represents local file sync status. 18 // Represents local file sync status.
19 // This class is thread-safe and fields of this class are protected by a lock. 19 // This class is thread-safe and fields of this class are protected by a lock.
20 // TODO(kinuko): Limit access to this class only on IO thread. 20 // TODO(kinuko): Limit access to this class only on IO thread.
21 // 21 //
22 // This class manages two important synchronization flags: writing (counter) 22 // This class manages two important synchronization flags: writing (counter)
23 // and syncing (flag). Writing counter keeps track of which URL is in 23 // and syncing (flag). Writing counter keeps track of which URL is in
24 // writing and syncing flag indicates which URL is in syncing. 24 // writing and syncing flag indicates which URL is in syncing.
25 // 25 //
26 // An invariant of this class is: no FileSystem objects should be both 26 // An invariant of this class is: no FileSystem objects should be both
27 // in syncing_ and writing_ status, i.e. trying to increment writing 27 // in syncing_ and writing_ status, i.e. trying to increment writing
28 // while the target url is in syncing must fail and vice versa. 28 // while the target url is in syncing must fail and vice versa.
29 class FILEAPI_EXPORT LocalFileSyncStatus { 29 class STORAGE_EXPORT LocalFileSyncStatus {
30 public: 30 public:
31 LocalFileSyncStatus(); 31 LocalFileSyncStatus();
32 ~LocalFileSyncStatus(); 32 ~LocalFileSyncStatus();
33 33
34 // Tries to increment writing counter for |url|. 34 // Tries to increment writing counter for |url|.
35 // This fails if the target |url| is in syncing. 35 // This fails if the target |url| is in syncing.
36 bool TryIncrementWriting(const FileSystemURL& url); 36 bool TryIncrementWriting(const FileSystemURL& url);
37 37
38 // Decrement writing counter for |url|. 38 // Decrement writing counter for |url|.
39 void DecrementWriting(const FileSystemURL& url); 39 void DecrementWriting(const FileSystemURL& url);
(...skipping 26 matching lines...) Expand all
66 66
67 // If this flag is set sync process is running on the file. 67 // If this flag is set sync process is running on the file.
68 URLSet syncing_; 68 URLSet syncing_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus); 70 DISALLOW_COPY_AND_ASSIGN(LocalFileSyncStatus);
71 }; 71 };
72 72
73 } // namespace fileapi 73 } // namespace fileapi
74 74
75 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_ 75 #endif // WEBKIT_FILEAPI_SYNCABLE_LOCAL_FILE_SYNC_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698