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

Side by Side Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 #include "chrome/browser/sync_file_system/sync_file_system_service.h" 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/sync_file_system/sync_status_code.h" 28 #include "chrome/browser/sync_file_system/sync_status_code.h"
29 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" 29 #include "chrome/browser/sync_file_system/syncable_file_system_util.h"
30 #include "components/keyed_service/content/browser_context_dependency_manager.h" 30 #include "components/keyed_service/content/browser_context_dependency_manager.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/storage_partition.h" 32 #include "content/public/browser/storage_partition.h"
33 #include "extensions/browser/extension_prefs.h" 33 #include "extensions/browser/extension_prefs.h"
34 #include "extensions/browser/extension_registry.h" 34 #include "extensions/browser/extension_registry.h"
35 #include "extensions/common/extension.h" 35 #include "extensions/common/extension.h"
36 #include "extensions/common/manifest_constants.h" 36 #include "extensions/common/manifest_constants.h"
37 #include "url/gurl.h" 37 #include "url/gurl.h"
38 #include "webkit/browser/fileapi/file_system_context.h" 38 #include "storage/browser/fileapi/file_system_context.h"
39 39
40 using content::BrowserThread; 40 using content::BrowserThread;
41 using extensions::Extension; 41 using extensions::Extension;
42 using extensions::ExtensionPrefs; 42 using extensions::ExtensionPrefs;
43 using extensions::ExtensionRegistry; 43 using extensions::ExtensionRegistry;
44 using fileapi::FileSystemURL; 44 using storage::FileSystemURL;
45 using fileapi::FileSystemURLSet; 45 using storage::FileSystemURLSet;
46 46
47 namespace sync_file_system { 47 namespace sync_file_system {
48 48
49 namespace { 49 namespace {
50 50
51 const char kLocalSyncName[] = "Local sync"; 51 const char kLocalSyncName[] = "Local sync";
52 const char kRemoteSyncName[] = "Remote sync"; 52 const char kRemoteSyncName[] = "Remote sync";
53 const char kRemoteSyncNameV2[] = "Remote sync (v2)"; 53 const char kRemoteSyncNameV2[] = "Remote sync (v2)";
54 54
55 SyncServiceState RemoteStateToSyncServiceState( 55 SyncServiceState RemoteStateToSyncServiceState(
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 profile_ = NULL; 272 profile_ = NULL;
273 } 273 }
274 274
275 SyncFileSystemService::~SyncFileSystemService() { 275 SyncFileSystemService::~SyncFileSystemService() {
276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
277 DCHECK(!profile_); 277 DCHECK(!profile_);
278 } 278 }
279 279
280 void SyncFileSystemService::InitializeForApp( 280 void SyncFileSystemService::InitializeForApp(
281 fileapi::FileSystemContext* file_system_context, 281 storage::FileSystemContext* file_system_context,
282 const GURL& app_origin, 282 const GURL& app_origin,
283 const SyncStatusCallback& callback) { 283 const SyncStatusCallback& callback) {
284 DCHECK(local_service_); 284 DCHECK(local_service_);
285 DCHECK(remote_service_); 285 DCHECK(remote_service_);
286 DCHECK(app_origin == app_origin.GetOrigin()); 286 DCHECK(app_origin == app_origin.GetOrigin());
287 287
288 util::Log(logging::LOG_VERBOSE, FROM_HERE, 288 util::Log(logging::LOG_VERBOSE, FROM_HERE,
289 "Initializing for App: %s", app_origin.spec().c_str()); 289 "Initializing for App: %s", app_origin.spec().c_str());
290 290
291 local_service_->MaybeInitializeFileSystemContext( 291 local_service_->MaybeInitializeFileSystemContext(
292 app_origin, file_system_context, 292 app_origin, file_system_context,
293 base::Bind(&SyncFileSystemService::DidInitializeFileSystem, 293 base::Bind(&SyncFileSystemService::DidInitializeFileSystem,
294 AsWeakPtr(), app_origin, callback)); 294 AsWeakPtr(), app_origin, callback));
295 } 295 }
296 296
297 void SyncFileSystemService::GetExtensionStatusMap( 297 void SyncFileSystemService::GetExtensionStatusMap(
298 const ExtensionStatusMapCallback& callback) { 298 const ExtensionStatusMapCallback& callback) {
299 remote_service_->GetOriginStatusMap( 299 remote_service_->GetOriginStatusMap(
300 base::Bind(&SyncFileSystemService::DidGetExtensionStatusMap, 300 base::Bind(&SyncFileSystemService::DidGetExtensionStatusMap,
301 AsWeakPtr(), callback)); 301 AsWeakPtr(), callback));
302 } 302 }
303 303
304 void SyncFileSystemService::DumpFiles(const GURL& origin, 304 void SyncFileSystemService::DumpFiles(const GURL& origin,
305 const DumpFilesCallback& callback) { 305 const DumpFilesCallback& callback) {
306 DCHECK(!origin.is_empty()); 306 DCHECK(!origin.is_empty());
307 307
308 content::StoragePartition* storage_partition = 308 content::StoragePartition* storage_partition =
309 content::BrowserContext::GetStoragePartitionForSite(profile_, origin); 309 content::BrowserContext::GetStoragePartitionForSite(profile_, origin);
310 fileapi::FileSystemContext* file_system_context = 310 storage::FileSystemContext* file_system_context =
311 storage_partition->GetFileSystemContext(); 311 storage_partition->GetFileSystemContext();
312 local_service_->MaybeInitializeFileSystemContext( 312 local_service_->MaybeInitializeFileSystemContext(
313 origin, file_system_context, 313 origin, file_system_context,
314 base::Bind(&SyncFileSystemService::DidInitializeFileSystemForDump, 314 base::Bind(&SyncFileSystemService::DidInitializeFileSystemForDump,
315 AsWeakPtr(), origin, callback)); 315 AsWeakPtr(), origin, callback));
316 } 316 }
317 317
318 void SyncFileSystemService::DumpDatabase(const DumpFilesCallback& callback) { 318 void SyncFileSystemService::DumpDatabase(const DumpFilesCallback& callback) {
319 remote_service_->DumpDatabase( 319 remote_service_->DumpDatabase(
320 base::Bind(&SyncFileSystemService::DidDumpDatabase, 320 base::Bind(&SyncFileSystemService::DidDumpDatabase,
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); 764 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get());
765 v2_remote_service_->AddFileStatusObserver(this); 765 v2_remote_service_->AddFileStatusObserver(this);
766 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); 766 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get());
767 v2_remote_service_->SetSyncEnabled(sync_enabled_); 767 v2_remote_service_->SetSyncEnabled(sync_enabled_);
768 remote_sync_runners_.push_back(v2_remote_syncer.release()); 768 remote_sync_runners_.push_back(v2_remote_syncer.release());
769 } 769 }
770 return v2_remote_service_.get(); 770 return v2_remote_service_.get();
771 } 771 }
772 772
773 } // namespace sync_file_system 773 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698