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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Profile* profile) { | 110 Profile* profile) { |
111 return make_scoped_ptr(new LocalFileSyncService(profile, nullptr)); | 111 return make_scoped_ptr(new LocalFileSyncService(profile, nullptr)); |
112 } | 112 } |
113 | 113 |
114 scoped_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting( | 114 scoped_ptr<LocalFileSyncService> LocalFileSyncService::CreateForTesting( |
115 Profile* profile, | 115 Profile* profile, |
116 leveldb::Env* env) { | 116 leveldb::Env* env) { |
117 scoped_ptr<LocalFileSyncService> sync_service( | 117 scoped_ptr<LocalFileSyncService> sync_service( |
118 new LocalFileSyncService(profile, env)); | 118 new LocalFileSyncService(profile, env)); |
119 sync_service->sync_context_->set_mock_notify_changes_duration_in_sec(0); | 119 sync_service->sync_context_->set_mock_notify_changes_duration_in_sec(0); |
120 return sync_service.Pass(); | 120 return sync_service; |
121 } | 121 } |
122 | 122 |
123 LocalFileSyncService::~LocalFileSyncService() { | 123 LocalFileSyncService::~LocalFileSyncService() { |
124 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 124 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
125 } | 125 } |
126 | 126 |
127 void LocalFileSyncService::Shutdown() { | 127 void LocalFileSyncService::Shutdown() { |
128 sync_context_->RemoveOriginChangeObserver(this); | 128 sync_context_->RemoveOriginChangeObserver(this); |
129 sync_context_->ShutdownOnUIThread(); | 129 sync_context_->ShutdownOnUIThread(); |
130 profile_ = nullptr; | 130 profile_ = nullptr; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( | 493 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( |
494 const FileSystemURL& url) { | 494 const FileSystemURL& url) { |
495 if (!get_local_change_processor_.is_null()) | 495 if (!get_local_change_processor_.is_null()) |
496 return get_local_change_processor_.Run(url.origin()); | 496 return get_local_change_processor_.Run(url.origin()); |
497 DCHECK(local_change_processor_); | 497 DCHECK(local_change_processor_); |
498 return local_change_processor_; | 498 return local_change_processor_; |
499 } | 499 } |
500 | 500 |
501 } // namespace sync_file_system | 501 } // namespace sync_file_system |
OLD | NEW |