OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/gcm_driver/instance_id/instance_id_impl.h" | 5 #include "components/gcm_driver/instance_id/instance_id_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 default: | 42 default: |
43 NOTREACHED() << "Unexpected value of result cannot be converted: " | 43 NOTREACHED() << "Unexpected value of result cannot be converted: " |
44 << result; | 44 << result; |
45 } | 45 } |
46 return InstanceID::UNKNOWN_ERROR; | 46 return InstanceID::UNKNOWN_ERROR; |
47 } | 47 } |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 // static | 51 // static |
52 std::unique_ptr<InstanceID> InstanceID::Create(const std::string& app_id, | 52 std::unique_ptr<InstanceID> InstanceID::CreateInternal( |
53 gcm::GCMDriver* gcm_driver) { | 53 const std::string& app_id, |
| 54 gcm::GCMDriver* gcm_driver) { |
54 return base::WrapUnique(new InstanceIDImpl(app_id, gcm_driver)); | 55 return base::WrapUnique(new InstanceIDImpl(app_id, gcm_driver)); |
55 } | 56 } |
56 | 57 |
57 InstanceIDImpl::InstanceIDImpl(const std::string& app_id, | 58 InstanceIDImpl::InstanceIDImpl(const std::string& app_id, |
58 gcm::GCMDriver* gcm_driver) | 59 gcm::GCMDriver* gcm_driver) |
59 : InstanceID(app_id, gcm_driver), weak_ptr_factory_(this) { | 60 : InstanceID(app_id, gcm_driver), weak_ptr_factory_(this) { |
60 Handler()->GetInstanceIDData( | 61 Handler()->GetInstanceIDData( |
61 app_id, base::Bind(&InstanceIDImpl::GetInstanceIDDataCompleted, | 62 app_id, base::Bind(&InstanceIDImpl::GetInstanceIDDataCompleted, |
62 weak_ptr_factory_.GetWeakPtr())); | 63 weak_ptr_factory_.GetWeakPtr())); |
63 } | 64 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 269 } |
269 | 270 |
270 gcm::InstanceIDHandler* InstanceIDImpl::Handler() { | 271 gcm::InstanceIDHandler* InstanceIDImpl::Handler() { |
271 gcm::InstanceIDHandler* handler = | 272 gcm::InstanceIDHandler* handler = |
272 gcm_driver()->GetInstanceIDHandlerInternal(); | 273 gcm_driver()->GetInstanceIDHandlerInternal(); |
273 DCHECK(handler); | 274 DCHECK(handler); |
274 return handler; | 275 return handler; |
275 } | 276 } |
276 | 277 |
277 } // namespace instance_id | 278 } // namespace instance_id |
OLD | NEW |