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/local_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_service.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // LocalFileSyncService ------------------------------------------------------- | 106 // LocalFileSyncService ------------------------------------------------------- |
107 | 107 |
108 scoped_ptr<LocalFileSyncService> LocalFileSyncService::Create( | 108 scoped_ptr<LocalFileSyncService> LocalFileSyncService::Create( |
109 Profile* profile) { | 109 Profile* profile) { |
110 return make_scoped_ptr(new LocalFileSyncService(profile, NULL)); | 110 return make_scoped_ptr(new LocalFileSyncService(profile, NULL)); |
111 } | 111 } |
112 | 112 |
113 scoped_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting( | 113 scoped_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting( |
114 Profile* profile, | 114 Profile* profile, |
115 leveldb::Env* env) { | 115 leveldb::Env* env) { |
116 return make_scoped_ptr(new LocalFileSyncService(profile, env)); | 116 scoped_ptr<LocalFileSyncService> sync_service( |
| 117 new LocalFileSyncService(profile, env)); |
| 118 sync_service->sync_context_->set_mock_notify_changes_duration_in_sec(0); |
| 119 return sync_service.Pass(); |
117 } | 120 } |
118 | 121 |
119 LocalFileSyncService::~LocalFileSyncService() { | 122 LocalFileSyncService::~LocalFileSyncService() { |
120 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
121 } | 124 } |
122 | 125 |
123 void LocalFileSyncService::Shutdown() { | 126 void LocalFileSyncService::Shutdown() { |
124 sync_context_->RemoveOriginChangeObserver(this); | 127 sync_context_->RemoveOriginChangeObserver(this); |
125 sync_context_->ShutdownOnUIThread(); | 128 sync_context_->ShutdownOnUIThread(); |
126 profile_ = NULL; | 129 profile_ = NULL; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 503 |
501 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( | 504 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( |
502 const FileSystemURL& url) { | 505 const FileSystemURL& url) { |
503 if (!get_local_change_processor_.is_null()) | 506 if (!get_local_change_processor_.is_null()) |
504 return get_local_change_processor_.Run(url.origin()); | 507 return get_local_change_processor_.Run(url.origin()); |
505 DCHECK(local_change_processor_); | 508 DCHECK(local_change_processor_); |
506 return local_change_processor_; | 509 return local_change_processor_; |
507 } | 510 } |
508 | 511 |
509 } // namespace sync_file_system | 512 } // namespace sync_file_system |
OLD | NEW |