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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 246163005: [SyncFS] Make ExtensionService usage of SyncWorker asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: buildfix Created 6 years, 8 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/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 base::MessageLoopProxy::current(), 189 base::MessageLoopProxy::current(),
190 file_task_runner)); 190 file_task_runner));
191 worker_observer_.reset( 191 worker_observer_.reset(
192 new WorkerObserver(base::MessageLoopProxy::current(), 192 new WorkerObserver(base::MessageLoopProxy::current(),
193 weak_ptr_factory_.GetWeakPtr())); 193 weak_ptr_factory_.GetWeakPtr()));
194 194
195 // TODO(peria): Use PostTask on |worker_task_runner_| to call this function. 195 // TODO(peria): Use PostTask on |worker_task_runner_| to call this function.
196 sync_worker_ = SyncWorker::CreateOnWorker( 196 sync_worker_ = SyncWorker::CreateOnWorker(
197 base_dir, 197 base_dir,
198 worker_observer_.get(), 198 worker_observer_.get(),
199 extension_service_, 199 extension_service_->AsWeakPtr(),
200 sync_engine_context.Pass(), 200 sync_engine_context.Pass(),
201 env_override); 201 env_override);
202 202
203 if (notification_manager_) 203 if (notification_manager_)
204 notification_manager_->AddObserver(this); 204 notification_manager_->AddObserver(this);
205 GetDriveService()->AddObserver(this); 205 GetDriveService()->AddObserver(this);
206 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); 206 net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
207 } 207 }
208 208
209 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) { 209 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; 507 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT;
508 if (is_app_enabled && !is_app_root_tracker_enabled) 508 if (is_app_enabled && !is_app_root_tracker_enabled)
509 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); 509 EnableOrigin(origin, base::Bind(&EmptyStatusCallback));
510 else if (!is_app_enabled && is_app_root_tracker_enabled) 510 else if (!is_app_enabled && is_app_root_tracker_enabled)
511 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); 511 DisableOrigin(origin, base::Bind(&EmptyStatusCallback));
512 } 512 }
513 } 513 }
514 514
515 } // namespace drive_backend 515 } // namespace drive_backend
516 } // namespace sync_file_system 516 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698