OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | 5 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" | 9 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
10 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" | 10 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
11 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h
" | 11 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h
" |
12 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 12 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
13 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" | 13 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" |
14 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 14 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
17 #include "webkit/browser/fileapi/file_system_context.h" | 17 #include "webkit/browser/fileapi/file_system_context.h" |
18 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" | 18 #include "webkit/browser/fileapi/file_system_file_stream_reader.h" |
19 #include "webkit/browser/fileapi/file_system_operation_impl.h" | 19 #include "webkit/browser/fileapi/file_system_operation.h" |
20 #include "webkit/browser/fileapi/sandbox_file_stream_writer.h" | 20 #include "webkit/browser/fileapi/sandbox_file_stream_writer.h" |
21 #include "webkit/browser/fileapi/sandbox_quota_observer.h" | 21 #include "webkit/browser/fileapi/sandbox_quota_observer.h" |
22 #include "webkit/common/fileapi/file_system_util.h" | 22 #include "webkit/common/fileapi/file_system_util.h" |
23 | 23 |
24 using content::BrowserThread; | 24 using content::BrowserThread; |
25 | 25 |
26 namespace sync_file_system { | 26 namespace sync_file_system { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 DCHECK(CanHandleType(url.type())); | 153 DCHECK(CanHandleType(url.type())); |
154 DCHECK(context); | 154 DCHECK(context); |
155 DCHECK(error_code); | 155 DCHECK(error_code); |
156 | 156 |
157 scoped_ptr<fileapi::FileSystemOperationContext> operation_context = | 157 scoped_ptr<fileapi::FileSystemOperationContext> operation_context = |
158 GetDelegate()->CreateFileSystemOperationContext(url, context, error_code); | 158 GetDelegate()->CreateFileSystemOperationContext(url, context, error_code); |
159 if (!operation_context) | 159 if (!operation_context) |
160 return NULL; | 160 return NULL; |
161 | 161 |
162 if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) { | 162 if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) { |
163 return new fileapi::FileSystemOperationImpl( | 163 return fileapi::FileSystemOperation::Create( |
164 url, context, operation_context.Pass()); | 164 url, context, operation_context.Pass()); |
165 } | 165 } |
166 | 166 |
167 return new SyncableFileSystemOperation( | 167 return new SyncableFileSystemOperation( |
168 url, context, operation_context.Pass()); | 168 url, context, operation_context.Pass()); |
169 } | 169 } |
170 | 170 |
171 scoped_ptr<webkit_blob::FileStreamReader> | 171 scoped_ptr<webkit_blob::FileStreamReader> |
172 SyncFileSystemBackend::CreateFileStreamReader( | 172 SyncFileSystemBackend::CreateFileStreamReader( |
173 const fileapi::FileSystemURL& url, | 173 const fileapi::FileSystemURL& url, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 callback.Run(GURL(), std::string(), | 281 callback.Run(GURL(), std::string(), |
282 SyncStatusCodeToPlatformFileError(status)); | 282 SyncStatusCodeToPlatformFileError(status)); |
283 return; | 283 return; |
284 } | 284 } |
285 | 285 |
286 GetDelegate()->OpenFileSystem(origin_url, type, mode, callback, | 286 GetDelegate()->OpenFileSystem(origin_url, type, mode, callback, |
287 GetSyncableFileSystemRootURI(origin_url)); | 287 GetSyncableFileSystemRootURI(origin_url)); |
288 } | 288 } |
289 | 289 |
290 } // namespace sync_file_system | 290 } // namespace sync_file_system |
OLD | NEW |