OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/glue/non_ui_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/non_ui_data_type_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/glue/shared_change_processor_ref.h" | 10 #include "chrome/browser/sync/glue/shared_change_processor_ref.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 shared_change_processor->ActivateDataType(model_safe_group()); | 391 shared_change_processor->ActivateDataType(model_safe_group()); |
392 StartDone(!sync_has_nodes ? OK_FIRST_RUN : OK, | 392 StartDone(!sync_has_nodes ? OK_FIRST_RUN : OK, |
393 local_merge_result, | 393 local_merge_result, |
394 syncer_merge_result); | 394 syncer_merge_result); |
395 } | 395 } |
396 | 396 |
397 void NonUIDataTypeController::ClearSharedChangeProcessor() { | 397 void NonUIDataTypeController::ClearSharedChangeProcessor() { |
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
399 // |shared_change_processor_| can already be NULL if Stop() is | 399 // |shared_change_processor_| can already be NULL if Stop() is |
400 // called after StartDoneImpl(_, DISABLED, _). | 400 // called after StartDoneImpl(_, DISABLED, _). |
401 if (shared_change_processor_) { | 401 if (shared_change_processor_.get()) { |
402 shared_change_processor_->Disconnect(); | 402 shared_change_processor_->Disconnect(); |
403 shared_change_processor_ = NULL; | 403 shared_change_processor_ = NULL; |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 void NonUIDataTypeController::StopLocalServiceAsync() { | 407 void NonUIDataTypeController::StopLocalServiceAsync() { |
408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
409 PostTaskOnBackendThread( | 409 PostTaskOnBackendThread( |
410 FROM_HERE, | 410 FROM_HERE, |
411 base::Bind(&NonUIDataTypeController::StopLocalService, this)); | 411 base::Bind(&NonUIDataTypeController::StopLocalService, this)); |
412 } | 412 } |
413 | 413 |
414 void NonUIDataTypeController::StopLocalService() { | 414 void NonUIDataTypeController::StopLocalService() { |
415 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); | 415 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
416 if (local_service_) | 416 if (local_service_) |
417 local_service_->StopSyncing(type()); | 417 local_service_->StopSyncing(type()); |
418 local_service_.reset(); | 418 local_service_.reset(); |
419 } | 419 } |
420 | 420 |
421 } // namepsace browser_sync | 421 } // namepsace browser_sync |
OLD | NEW |