| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 const browser_sync::SyncProtocolError& sync_error) { | 518 const browser_sync::SyncProtocolError& sync_error) { |
| 519 if (!sync_loop_) | 519 if (!sync_loop_) |
| 520 return; | 520 return; |
| 521 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 521 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| 522 host_->frontend_loop_->PostTask( | 522 host_->frontend_loop_->PostTask( |
| 523 FROM_HERE, | 523 FROM_HERE, |
| 524 NewRunnableMethod(this, &Core::HandleActionableErrorEventOnFrontendLoop, | 524 NewRunnableMethod(this, &Core::HandleActionableErrorEventOnFrontendLoop, |
| 525 sync_error)); | 525 sync_error)); |
| 526 } | 526 } |
| 527 | 527 |
| 528 void SyncBackendHost::Core::OnUnrecoverableError( |
| 529 const tracked_objects::Location& location, |
| 530 const std::string& message) { |
| 531 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| 532 host_->frontend_loop_->PostTask( |
| 533 FROM_HERE, |
| 534 NewRunnableMethod(this, &Core::HandleUnrecoverableErrorOnFrontendLoop, |
| 535 location, |
| 536 message)); |
| 537 |
| 538 } |
| 539 |
| 528 SyncBackendHost::Core::DoInitializeOptions::DoInitializeOptions( | 540 SyncBackendHost::Core::DoInitializeOptions::DoInitializeOptions( |
| 529 MessageLoop* sync_loop, | 541 MessageLoop* sync_loop, |
| 530 SyncBackendRegistrar* registrar, | 542 SyncBackendRegistrar* registrar, |
| 531 const WeakHandle<JsEventHandler>& event_handler, | 543 const WeakHandle<JsEventHandler>& event_handler, |
| 532 const GURL& service_url, | 544 const GURL& service_url, |
| 533 const scoped_refptr<net::URLRequestContextGetter>& | 545 const scoped_refptr<net::URLRequestContextGetter>& |
| 534 request_context_getter, | 546 request_context_getter, |
| 535 const sync_api::SyncCredentials& credentials, | 547 const sync_api::SyncCredentials& credentials, |
| 536 bool delete_sync_data_folder, | 548 bool delete_sync_data_folder, |
| 537 const std::string& restored_key_for_bootstrapping, | 549 const std::string& restored_key_for_bootstrapping, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 } | 756 } |
| 745 | 757 |
| 746 void SyncBackendHost::Core::HandleActionableErrorEventOnFrontendLoop( | 758 void SyncBackendHost::Core::HandleActionableErrorEventOnFrontendLoop( |
| 747 const browser_sync::SyncProtocolError& sync_error) { | 759 const browser_sync::SyncProtocolError& sync_error) { |
| 748 if (!host_ || !host_->frontend_) | 760 if (!host_ || !host_->frontend_) |
| 749 return; | 761 return; |
| 750 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 762 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 751 host_->frontend_->OnActionableError(sync_error); | 763 host_->frontend_->OnActionableError(sync_error); |
| 752 } | 764 } |
| 753 | 765 |
| 766 void SyncBackendHost::Core::HandleUnrecoverableErrorOnFrontendLoop( |
| 767 const tracked_objects::Location& location, |
| 768 const std::string& message) { |
| 769 if (!host_ || !host_->frontend_) |
| 770 return; |
| 771 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 772 host_->frontend_->OnUnrecoverableError(location, message); |
| 773 } |
| 774 |
| 775 |
| 754 void SyncBackendHost::Core::HandleAuthErrorEventOnFrontendLoop( | 776 void SyncBackendHost::Core::HandleAuthErrorEventOnFrontendLoop( |
| 755 const GoogleServiceAuthError& new_auth_error) { | 777 const GoogleServiceAuthError& new_auth_error) { |
| 756 if (!host_ || !host_->frontend_) | 778 if (!host_ || !host_->frontend_) |
| 757 return; | 779 return; |
| 758 | 780 |
| 759 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 781 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 760 | 782 |
| 761 host_->last_auth_error_ = new_auth_error; | 783 host_->last_auth_error_ = new_auth_error; |
| 762 host_->frontend_->OnAuthError(); | 784 host_->frontend_->OnAuthError(); |
| 763 } | 785 } |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 FROM_HERE, | 1066 FROM_HERE, |
| 1045 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, | 1067 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, |
| 1046 core_.get(), sync_thread_done_callback)); | 1068 core_.get(), sync_thread_done_callback)); |
| 1047 } | 1069 } |
| 1048 | 1070 |
| 1049 #undef SVLOG | 1071 #undef SVLOG |
| 1050 | 1072 |
| 1051 #undef SLOG | 1073 #undef SLOG |
| 1052 | 1074 |
| 1053 } // namespace browser_sync | 1075 } // namespace browser_sync |
| OLD | NEW |