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

Side by Side Diff: chrome/browser/sync_file_system/drive_metadata_store.h

Issue 15711009: [SyncFileSystem][Clean up] Delete DriveMetadataDB::DeleteEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_metadata_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/threading/non_thread_safe.h" 18 #include "base/threading/non_thread_safe.h"
19 #include "webkit/browser/fileapi/file_system_url.h" 19 #include "webkit/browser/fileapi/file_system_url.h"
20 #include "webkit/browser/fileapi/syncable/sync_callbacks.h" 20 #include "webkit/browser/fileapi/syncable/sync_callbacks.h"
21 #include "webkit/browser/fileapi/syncable/sync_status_code.h" 21 #include "webkit/browser/fileapi/syncable/sync_status_code.h"
22 22
23 namespace base { 23 namespace base {
24 class SequencedTaskRunner; 24 class SequencedTaskRunner;
25 } 25 }
26 26
27 namespace leveldb { 27 namespace leveldb {
28 class DB; 28 class DB;
29 class WriteBatch;
29 } 30 }
30 31
31 class GURL; 32 class GURL;
32 33
33 namespace sync_file_system { 34 namespace sync_file_system {
34 35
35 class DriveMetadata; 36 class DriveMetadata;
36 class DriveMetadataDB; 37 class DriveMetadataDB;
37 struct DriveMetadataDBContents; 38 struct DriveMetadataDBContents;
38 39
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 143
143 // Maps |resource_id| to corresponding |origin|. 144 // Maps |resource_id| to corresponding |origin|.
144 // Returns true if the directory indicated by |resource_id| is not an origin 145 // Returns true if the directory indicated by |resource_id| is not an origin
145 // root directory. 146 // root directory.
146 bool GetOriginByOriginRootDirectoryId(const std::string& resource_id, 147 bool GetOriginByOriginRootDirectoryId(const std::string& resource_id,
147 GURL* origin); 148 GURL* origin);
148 149
149 private: 150 private:
150 friend class DriveMetadataStoreTest; 151 friend class DriveMetadataStoreTest;
151 152
153 void WriteToDB(scoped_ptr<leveldb::WriteBatch> batch,
154 const SyncStatusCallback& callback);
155
152 void UpdateDBStatus(SyncStatusCode status); 156 void UpdateDBStatus(SyncStatusCode status);
153 void UpdateDBStatusAndInvokeCallback(const SyncStatusCallback& callback, 157 void UpdateDBStatusAndInvokeCallback(const SyncStatusCallback& callback,
154 SyncStatusCode status); 158 SyncStatusCode status);
155 void DidInitialize(const InitializationCallback& callback, 159 void DidInitialize(const InitializationCallback& callback,
156 DriveMetadataDBContents* contents, 160 DriveMetadataDBContents* contents,
157 SyncStatusCode error); 161 SyncStatusCode error);
158 void DidUpdateOrigin(const SyncStatusCallback& callback, 162 void DidUpdateOrigin(const SyncStatusCallback& callback,
159 SyncStatusCode status); 163 SyncStatusCode status);
160 164
161 // These are only for testing. 165 // These are only for testing.
(...skipping 20 matching lines...) Expand all
182 ResourceIdByOrigin disabled_origins_; 186 ResourceIdByOrigin disabled_origins_;
183 187
184 OriginByResourceId origin_by_resource_id_; 188 OriginByResourceId origin_by_resource_id_;
185 189
186 DISALLOW_COPY_AND_ASSIGN(DriveMetadataStore); 190 DISALLOW_COPY_AND_ASSIGN(DriveMetadataStore);
187 }; 191 };
188 192
189 } // namespace sync_file_system 193 } // namespace sync_file_system
190 194
191 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_ 195 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_METADATA_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_metadata_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698