| 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 "sync/notifier/non_blocking_invalidator.h" | 5 #include "sync/notifier/non_blocking_invalidator.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "jingle/notifier/listener/push_client.h" | 15 #include "jingle/notifier/listener/push_client.h" |
| 16 #include "sync/notifier/gcm_network_channel_delegate.h" |
| 16 #include "sync/notifier/invalidation_notifier.h" | 17 #include "sync/notifier/invalidation_notifier.h" |
| 17 #include "sync/notifier/object_id_invalidation_map.h" | 18 #include "sync/notifier/object_id_invalidation_map.h" |
| 18 #include "sync/notifier/sync_system_resources.h" | 19 #include "sync/notifier/sync_system_resources.h" |
| 19 | 20 |
| 20 namespace syncer { | 21 namespace syncer { |
| 21 | 22 |
| 22 struct NonBlockingInvalidator::InitializeOptions { | 23 struct NonBlockingInvalidator::InitializeOptions { |
| 23 InitializeOptions( | 24 InitializeOptions( |
| 24 NetworkChannelCreator network_channel_creator, | 25 NetworkChannelCreator network_channel_creator, |
| 25 const std::string& invalidator_client_id, | 26 const std::string& invalidator_client_id, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 registrar_.DispatchInvalidationsToHandlers(invalidation_map); | 241 registrar_.DispatchInvalidationsToHandlers(invalidation_map); |
| 241 } | 242 } |
| 242 | 243 |
| 243 NetworkChannelCreator | 244 NetworkChannelCreator |
| 244 NonBlockingInvalidator::MakePushClientChannelCreator( | 245 NonBlockingInvalidator::MakePushClientChannelCreator( |
| 245 const notifier::NotifierOptions& notifier_options) { | 246 const notifier::NotifierOptions& notifier_options) { |
| 246 return base::Bind(SyncNetworkChannel::CreatePushClientChannel, | 247 return base::Bind(SyncNetworkChannel::CreatePushClientChannel, |
| 247 notifier_options); | 248 notifier_options); |
| 248 } | 249 } |
| 249 | 250 |
| 250 NetworkChannelCreator | 251 NetworkChannelCreator NonBlockingInvalidator::MakeGCMNetworkChannelCreator( |
| 251 NonBlockingInvalidator::MakeGCMNetworkChannelCreator() { | 252 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| 252 return base::Bind(SyncNetworkChannel::CreateGCMNetworkChannel); | 253 scoped_ptr<GCMNetworkChannelDelegate> delegate) { |
| 254 return base::Bind(SyncNetworkChannel::CreateGCMNetworkChannel, |
| 255 request_context_getter, |
| 256 base::Passed(&delegate)); |
| 253 } | 257 } |
| 254 | 258 |
| 255 } // namespace syncer | 259 } // namespace syncer |
| OLD | NEW |