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

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

Issue 98633003: SyncFS v2: Add modest logging for ApplyLocalChange, ApplyRemoteChange (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « chrome/browser/sync_file_system/local/local_file_sync_service.cc ('k') | no next file » | 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 #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 29 matching lines...) Expand all
40 using extensions::Extension; 40 using extensions::Extension;
41 using extensions::ExtensionPrefs; 41 using extensions::ExtensionPrefs;
42 using fileapi::FileSystemURL; 42 using fileapi::FileSystemURL;
43 using fileapi::FileSystemURLSet; 43 using fileapi::FileSystemURLSet;
44 44
45 namespace sync_file_system { 45 namespace sync_file_system {
46 46
47 namespace { 47 namespace {
48 48
49 const char kLocalSyncName[] = "Local sync"; 49 const char kLocalSyncName[] = "Local sync";
50 const char kRemoteSyncNameV1[] = "Remote sync (v1)"; 50 const char kRemoteSyncName[] = "Remote sync";
51 const char kRemoteSyncNameV2[] = "Remote sync (v2)"; 51 const char kRemoteSyncNameV2[] = "Remote sync (v2)";
52 52
53 SyncServiceState RemoteStateToSyncServiceState( 53 SyncServiceState RemoteStateToSyncServiceState(
54 RemoteServiceState state) { 54 RemoteServiceState state) {
55 switch (state) { 55 switch (state) {
56 case REMOTE_SERVICE_OK: 56 case REMOTE_SERVICE_OK:
57 return SYNC_SERVICE_RUNNING; 57 return SYNC_SERVICE_RUNNING;
58 case REMOTE_SERVICE_TEMPORARY_UNAVAILABLE: 58 case REMOTE_SERVICE_TEMPORARY_UNAVAILABLE:
59 return SYNC_SERVICE_TEMPORARY_UNAVAILABLE; 59 return SYNC_SERVICE_TEMPORARY_UNAVAILABLE;
60 case REMOTE_SERVICE_AUTHENTICATION_REQUIRED: 60 case REMOTE_SERVICE_AUTHENTICATION_REQUIRED:
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 DCHECK(local_service); 390 DCHECK(local_service);
391 DCHECK(remote_service); 391 DCHECK(remote_service);
392 DCHECK(profile_); 392 DCHECK(profile_);
393 393
394 local_service_ = local_service.Pass(); 394 local_service_ = local_service.Pass();
395 remote_service_ = remote_service.Pass(); 395 remote_service_ = remote_service.Pass();
396 396
397 scoped_ptr<LocalSyncRunner> local_syncer( 397 scoped_ptr<LocalSyncRunner> local_syncer(
398 new LocalSyncRunner(kLocalSyncName, this)); 398 new LocalSyncRunner(kLocalSyncName, this));
399 scoped_ptr<RemoteSyncRunner> remote_syncer( 399 scoped_ptr<RemoteSyncRunner> remote_syncer(
400 new RemoteSyncRunner(kRemoteSyncNameV1, this, remote_service_.get())); 400 new RemoteSyncRunner(kRemoteSyncName, this, remote_service_.get()));
401 401
402 local_service_->AddChangeObserver(local_syncer.get()); 402 local_service_->AddChangeObserver(local_syncer.get());
403 local_service_->SetLocalChangeProcessorCallback( 403 local_service_->SetLocalChangeProcessorCallback(
404 base::Bind(&GetLocalChangeProcessorAdapter, AsWeakPtr())); 404 base::Bind(&GetLocalChangeProcessorAdapter, AsWeakPtr()));
405 405
406 remote_service_->AddServiceObserver(remote_syncer.get()); 406 remote_service_->AddServiceObserver(remote_syncer.get());
407 remote_service_->AddFileStatusObserver(this); 407 remote_service_->AddFileStatusObserver(this);
408 remote_service_->SetRemoteChangeProcessor(local_service_.get()); 408 remote_service_->SetRemoteChangeProcessor(local_service_.get());
409 409
410 sync_runners_.push_back(local_syncer.release()); 410 sync_runners_.push_back(local_syncer.release());
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext( 703 v2_remote_service_ = RemoteFileSyncService::CreateForBrowserContext(
704 RemoteFileSyncService::V2, profile_); 704 RemoteFileSyncService::V2, profile_);
705 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); 705 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get());
706 v2_remote_service_->AddFileStatusObserver(this); 706 v2_remote_service_->AddFileStatusObserver(this);
707 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); 707 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get());
708 } 708 }
709 return v2_remote_service_.get(); 709 return v2_remote_service_.get();
710 } 710 }
711 711
712 } // namespace sync_file_system 712 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/local/local_file_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698