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

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

Issue 11234025: Add skeleton code to wire Local- and Remote- file sync services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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/sync_file_system_service.h ('k') | chrome/chrome_browser.gypi » ('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 #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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // TODO(kinuko,tzik): Instantiate the remote_file_service for the given 43 // TODO(kinuko,tzik): Instantiate the remote_file_service for the given
44 // |service_name| if it hasn't been initialized. 44 // |service_name| if it hasn't been initialized.
45 45
46 local_file_service_->MaybeInitializeFileSystemContext( 46 local_file_service_->MaybeInitializeFileSystemContext(
47 app_url, file_system_context, callback); 47 app_url, file_system_context, callback);
48 48
49 // TODO(tzik): Hook up remote service initialization code. 49 // TODO(tzik): Hook up remote service initialization code.
50 } 50 }
51 51
52 void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) {
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
54 DCHECK_GE(pending_changes, 0);
55 pending_local_changes_ = pending_changes;
56 }
57
58 void SyncFileSystemService::OnRemoteChangeAvailable(int64 pending_changes) {
59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
60 DCHECK_GE(pending_changes, 0);
61 pending_remote_changes_ = pending_changes;
62 }
63
52 SyncFileSystemService::SyncFileSystemService(Profile* profile) 64 SyncFileSystemService::SyncFileSystemService(Profile* profile)
53 : profile_(profile) {} 65 : profile_(profile),
66 pending_local_changes_(0),
67 pending_remote_changes_(0) {}
54 68
55 void SyncFileSystemService::Initialize( 69 void SyncFileSystemService::Initialize(
56 scoped_ptr<LocalFileSyncService> local_file_service) { 70 scoped_ptr<LocalFileSyncService> local_file_service) {
57 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
58 DCHECK(local_file_service.get()); 72 DCHECK(local_file_service.get());
59 DCHECK(profile_); 73 DCHECK(profile_);
60 74
61 local_file_service_ = local_file_service.Pass(); 75 local_file_service_ = local_file_service.Pass();
62 } 76 }
63 77
(...skipping 25 matching lines...) Expand all
89 // TODO(kinuko): Set up mock services if it is called for testing. 103 // TODO(kinuko): Set up mock services if it is called for testing.
90 104
91 scoped_ptr<LocalFileSyncService> local_file_service( 105 scoped_ptr<LocalFileSyncService> local_file_service(
92 new LocalFileSyncService); 106 new LocalFileSyncService);
93 107
94 service->Initialize(local_file_service.Pass()); 108 service->Initialize(local_file_service.Pass());
95 return service; 109 return service;
96 } 110 }
97 111
98 } // namespace chrome 112 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698