Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: components/gcm_driver/instance_id/instance_id_impl.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: Remove channel from product_category_for_subtypes, and address nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/gcm_driver/instance_id/instance_id_driver.cc ('k') | components/gcm_driver/registration_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698