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

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: testfix 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/sync_worker.h » ('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 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 scoped_ptr<SyncEngineContext> sync_engine_context( 186 scoped_ptr<SyncEngineContext> sync_engine_context(
187 new SyncEngineContext(drive_service_.get(), 187 new SyncEngineContext(drive_service_.get(),
188 drive_uploader_.get(), 188 drive_uploader_.get(),
189 base::MessageLoopProxy::current(), 189 base::MessageLoopProxy::current(),
190 worker_task_runner_, 190 worker_task_runner_,
191 file_task_runner)); 191 file_task_runner));
192 worker_observer_.reset( 192 worker_observer_.reset(
193 new WorkerObserver(base::MessageLoopProxy::current(), 193 new WorkerObserver(base::MessageLoopProxy::current(),
194 weak_ptr_factory_.GetWeakPtr())); 194 weak_ptr_factory_.GetWeakPtr()));
195 195
196 base::WeakPtr<ExtensionServiceInterface> extension_service_weak_ptr;
197 if (extension_service_)
198 extension_service_weak_ptr = extension_service_->AsWeakPtr();
199
196 // TODO(peria): Use PostTask on |worker_task_runner_| to call this function. 200 // TODO(peria): Use PostTask on |worker_task_runner_| to call this function.
197 sync_worker_ = SyncWorker::CreateOnWorker( 201 sync_worker_ = SyncWorker::CreateOnWorker(
198 base_dir, 202 base_dir,
199 worker_observer_.get(), 203 worker_observer_.get(),
200 extension_service_, 204 extension_service_weak_ptr,
201 sync_engine_context.Pass(), 205 sync_engine_context.Pass(),
202 env_override); 206 env_override);
203 207
204 if (notification_manager_) 208 if (notification_manager_)
205 notification_manager_->AddObserver(this); 209 notification_manager_->AddObserver(this);
206 GetDriveService()->AddObserver(this); 210 GetDriveService()->AddObserver(this);
207 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); 211 net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
208 } 212 }
209 213
210 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) { 214 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; 522 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT;
519 if (is_app_enabled && !is_app_root_tracker_enabled) 523 if (is_app_enabled && !is_app_root_tracker_enabled)
520 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); 524 EnableOrigin(origin, base::Bind(&EmptyStatusCallback));
521 else if (!is_app_enabled && is_app_root_tracker_enabled) 525 else if (!is_app_enabled && is_app_root_tracker_enabled)
522 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); 526 DisableOrigin(origin, base::Bind(&EmptyStatusCallback));
523 } 527 }
524 } 528 }
525 529
526 } // namespace drive_backend 530 } // namespace drive_backend
527 } // namespace sync_file_system 531 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/sync_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698