| 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 "chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h" | 5 #include "chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const std::string& state) { | 134 const std::string& state) { |
| 135 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); | 135 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); |
| 136 observers_->Notify(&SyncNotifierObserver::StoreState, state); | 136 observers_->Notify(&SyncNotifierObserver::StoreState, state); |
| 137 } | 137 } |
| 138 | 138 |
| 139 NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( | 139 NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( |
| 140 const notifier::NotifierOptions& notifier_options, | 140 const notifier::NotifierOptions& notifier_options, |
| 141 const std::string& client_info) | 141 const std::string& client_info) |
| 142 : core_(new Core), | 142 : core_(new Core), |
| 143 parent_message_loop_proxy_( | 143 parent_message_loop_proxy_( |
| 144 base::MessageLoopProxy::CreateForCurrentThread()), | 144 base::MessageLoopProxy::current()), |
| 145 io_message_loop_proxy_(notifier_options.request_context_getter-> | 145 io_message_loop_proxy_(notifier_options.request_context_getter-> |
| 146 GetIOMessageLoopProxy()) { | 146 GetIOMessageLoopProxy()) { |
| 147 if (!io_message_loop_proxy_->PostTask( | 147 if (!io_message_loop_proxy_->PostTask( |
| 148 FROM_HERE, | 148 FROM_HERE, |
| 149 NewRunnableMethod( | 149 NewRunnableMethod( |
| 150 core_.get(), | 150 core_.get(), |
| 151 &NonBlockingInvalidationNotifier::Core::Initialize, | 151 &NonBlockingInvalidationNotifier::Core::Initialize, |
| 152 notifier_options, client_info))) { | 152 notifier_options, client_info))) { |
| 153 NOTREACHED(); | 153 NOTREACHED(); |
| 154 } | 154 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 void NonBlockingInvalidationNotifier::SendNotification() { | 231 void NonBlockingInvalidationNotifier::SendNotification() { |
| 232 DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); | 232 DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread()); |
| 233 // InvalidationClient doesn't implement SendNotification(), so no | 233 // InvalidationClient doesn't implement SendNotification(), so no |
| 234 // need to forward on the call. | 234 // need to forward on the call. |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace sync_notifier | 237 } // namespace sync_notifier |
| OLD | NEW |