| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/notifier/server_notifier_thread.h" | 5 #include "chrome/browser/sync/notifier/server_notifier_thread.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // generated from our own changes. | 116 // generated from our own changes. |
| 117 const std::string kClientId = "server_notifier_thread"; | 117 const std::string kClientId = "server_notifier_thread"; |
| 118 chrome_invalidation_client_->Start( | 118 chrome_invalidation_client_->Start( |
| 119 kClientId, state_, this, this, base_task_); | 119 kClientId, state_, this, this, base_task_); |
| 120 state_.clear(); | 120 state_.clear(); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ServerNotifierThread::RegisterTypesAndSignalSubscribed() { | 124 void ServerNotifierThread::RegisterTypesAndSignalSubscribed() { |
| 125 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); | 125 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); |
| 126 DCHECK(chrome_invalidation_client_.get()); | 126 if (!chrome_invalidation_client_.get()) { |
| 127 return; |
| 128 } |
| 127 chrome_invalidation_client_->RegisterTypes(); | 129 chrome_invalidation_client_->RegisterTypes(); |
| 128 observers_->Notify(&Observer::OnSubscriptionStateChange, true); | 130 observers_->Notify(&Observer::OnSubscriptionStateChange, true); |
| 129 } | 131 } |
| 130 | 132 |
| 131 void ServerNotifierThread::StopInvalidationListener() { | 133 void ServerNotifierThread::StopInvalidationListener() { |
| 132 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); | 134 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); |
| 133 chrome_invalidation_client_.reset(); | 135 chrome_invalidation_client_.reset(); |
| 134 } | 136 } |
| 135 | 137 |
| 136 } // namespace sync_notifier | 138 } // namespace sync_notifier |
| OLD | NEW |