| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/invalidation/impl/p2p_invalidation_service.h" | 5 #include "components/invalidation/impl/p2p_invalidation_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "components/invalidation/impl/invalidation_service_util.h" | 10 #include "components/invalidation/impl/invalidation_service_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 ParseNotifierOptions(*base::CommandLine::ForCurrentProcess()); | 29 ParseNotifierOptions(*base::CommandLine::ForCurrentProcess()); |
| 30 notifier_options.request_context_getter = request_context; | 30 notifier_options.request_context_getter = request_context; |
| 31 invalidator_id_ = GenerateInvalidatorClientId(); | 31 invalidator_id_ = GenerateInvalidatorClientId(); |
| 32 invalidator_.reset(new syncer::P2PInvalidator( | 32 invalidator_.reset(new syncer::P2PInvalidator( |
| 33 notifier::PushClient::CreateDefault(notifier_options), | 33 notifier::PushClient::CreateDefault(notifier_options), |
| 34 invalidator_id_, | 34 invalidator_id_, |
| 35 notification_target)); | 35 notification_target)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 P2PInvalidationService::~P2PInvalidationService() { | 38 P2PInvalidationService::~P2PInvalidationService() { |
| 39 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void P2PInvalidationService::UpdateCredentials(const std::string& username, | 42 void P2PInvalidationService::UpdateCredentials(const std::string& username, |
| 42 const std::string& password) { | 43 const std::string& password) { |
| 43 invalidator_->UpdateCredentials(username, password); | 44 invalidator_->UpdateCredentials(username, password); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void P2PInvalidationService::RegisterInvalidationHandler( | 47 void P2PInvalidationService::RegisterInvalidationHandler( |
| 47 syncer::InvalidationHandler* handler) { | 48 syncer::InvalidationHandler* handler) { |
| 48 invalidator_->RegisterHandler(handler); | 49 invalidator_->RegisterHandler(handler); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 base::Callback<void(const base::DictionaryValue&)> caller) const { | 81 base::Callback<void(const base::DictionaryValue&)> caller) const { |
| 81 base::DictionaryValue value; | 82 base::DictionaryValue value; |
| 82 caller.Run(value); | 83 caller.Run(value); |
| 83 } | 84 } |
| 84 | 85 |
| 85 IdentityProvider* P2PInvalidationService::GetIdentityProvider() { | 86 IdentityProvider* P2PInvalidationService::GetIdentityProvider() { |
| 86 return identity_provider_.get(); | 87 return identity_provider_.get(); |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace invalidation | 90 } // namespace invalidation |
| OLD | NEW |