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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_service.cc

Issue 363373003: Replace MessageLoopProxy::current() with ThreadTaskRunnerHandle::Get() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 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
peria 2014/07/04 05:36:44 Add #include "base/single_thread_task_runner.h" ?
tzik 2014/07/04 05:58:13 Done. That was from browser_thread.
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/thread_task_runner_handle.h"
8 #include "chrome/browser/extensions/extension_util.h" 9 #include "chrome/browser/extensions/extension_util.h"
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sync_file_system/file_change.h" 11 #include "chrome/browser/sync_file_system/file_change.h"
11 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" 12 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h"
12 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" 13 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h"
13 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" 14 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h"
14 #include "chrome/browser/sync_file_system/local_change_processor.h" 15 #include "chrome/browser/sync_file_system/local_change_processor.h"
15 #include "chrome/browser/sync_file_system/logger.h" 16 #include "chrome/browser/sync_file_system/logger.h"
16 #include "chrome/browser/sync_file_system/sync_file_metadata.h" 17 #include "chrome/browser/sync_file_system/sync_file_metadata.h"
17 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 void LocalFileSyncService::SetLocalChangeProcessorCallback( 170 void LocalFileSyncService::SetLocalChangeProcessorCallback(
170 const GetLocalChangeProcessorCallback& get_local_change_processor) { 171 const GetLocalChangeProcessorCallback& get_local_change_processor) {
171 get_local_change_processor_ = get_local_change_processor; 172 get_local_change_processor_ = get_local_change_processor;
172 } 173 }
173 174
174 void LocalFileSyncService::HasPendingLocalChanges( 175 void LocalFileSyncService::HasPendingLocalChanges(
175 const FileSystemURL& url, 176 const FileSystemURL& url,
176 const HasPendingLocalChangeCallback& callback) { 177 const HasPendingLocalChangeCallback& callback) {
177 if (!ContainsKey(origin_to_contexts_, url.origin())) { 178 if (!ContainsKey(origin_to_contexts_, url.origin())) {
178 base::MessageLoopProxy::current()->PostTask( 179 base::ThreadTaskRunnerHandle::Get()->PostTask(
179 FROM_HERE, 180 FROM_HERE,
180 base::Bind(callback, SYNC_FILE_ERROR_INVALID_URL, false)); 181 base::Bind(callback, SYNC_FILE_ERROR_INVALID_URL, false));
181 return; 182 return;
182 } 183 }
183 sync_context_->HasPendingLocalChanges( 184 sync_context_->HasPendingLocalChanges(
184 origin_to_contexts_[url.origin()], url, callback); 185 origin_to_contexts_[url.origin()], url, callback);
185 } 186 }
186 187
187 void LocalFileSyncService::PromoteDemotedChanges() { 188 void LocalFileSyncService::PromoteDemotedChanges() {
188 for (OriginToContext::iterator iter = origin_to_contexts_.begin(); 189 for (OriginToContext::iterator iter = origin_to_contexts_.begin();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 483
483 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( 484 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor(
484 const FileSystemURL& url) { 485 const FileSystemURL& url) {
485 if (!get_local_change_processor_.is_null()) 486 if (!get_local_change_processor_.is_null())
486 return get_local_change_processor_.Run(url.origin()); 487 return get_local_change_processor_.Run(url.origin());
487 DCHECK(local_change_processor_); 488 DCHECK(local_change_processor_);
488 return local_change_processor_; 489 return local_change_processor_;
489 } 490 }
490 491
491 } // namespace sync_file_system 492 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698