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

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

Issue 107743002: Add 'Dump Database' tab to syncfs-internals (only for v2 for now) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: regular -> Regular, added app_id Created 7 years 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 content::StoragePartition* storage_partition = 317 content::StoragePartition* storage_partition =
318 content::BrowserContext::GetStoragePartitionForSite(profile_, origin); 318 content::BrowserContext::GetStoragePartitionForSite(profile_, origin);
319 fileapi::FileSystemContext* file_system_context = 319 fileapi::FileSystemContext* file_system_context =
320 storage_partition->GetFileSystemContext(); 320 storage_partition->GetFileSystemContext();
321 local_service_->MaybeInitializeFileSystemContext( 321 local_service_->MaybeInitializeFileSystemContext(
322 origin, file_system_context, 322 origin, file_system_context,
323 base::Bind(&SyncFileSystemService::DidInitializeFileSystemForDump, 323 base::Bind(&SyncFileSystemService::DidInitializeFileSystemForDump,
324 AsWeakPtr(), origin, callback)); 324 AsWeakPtr(), origin, callback));
325 } 325 }
326 326
327 scoped_ptr<base::ListValue> SyncFileSystemService::DumpDatabase() {
328 return remote_service_->DumpDatabase();
329 }
330
327 void SyncFileSystemService::GetFileSyncStatus( 331 void SyncFileSystemService::GetFileSyncStatus(
328 const FileSystemURL& url, const SyncFileStatusCallback& callback) { 332 const FileSystemURL& url, const SyncFileStatusCallback& callback) {
329 DCHECK(local_service_); 333 DCHECK(local_service_);
330 DCHECK(GetRemoteService(url.origin())); 334 DCHECK(GetRemoteService(url.origin()));
331 335
332 // It's possible to get an invalid FileEntry. 336 // It's possible to get an invalid FileEntry.
333 if (!url.is_valid()) { 337 if (!url.is_valid()) {
334 base::MessageLoopProxy::current()->PostTask( 338 base::MessageLoopProxy::current()->PostTask(
335 FROM_HERE, 339 FROM_HERE,
336 base::Bind(callback, 340 base::Bind(callback,
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext( 707 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext(
704 RemoteFileSyncService::V2, profile_); 708 RemoteFileSyncService::V2, profile_);
705 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); 709 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get());
706 v2_remote_service_->AddFileStatusObserver(this); 710 v2_remote_service_->AddFileStatusObserver(this);
707 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); 711 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get());
708 } 712 }
709 return v2_remote_service_.get(); 713 return v2_remote_service_.get();
710 } 714 }
711 715
712 } // namespace sync_file_system 716 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698