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

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

Issue 1854093002: Enable InstanceID field trial by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid3test
Patch Set: Rebase Created 4 years, 8 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_driver.h" 5 #include "components/gcm_driver/instance_id/instance_id_driver.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/gcm_driver/gcm_driver.h" 9 #include "components/gcm_driver/gcm_driver.h"
10 #include "components/gcm_driver/instance_id/instance_id.h" 10 #include "components/gcm_driver/instance_id/instance_id.h"
11 11
12 namespace instance_id { 12 namespace instance_id {
13 13
14 namespace { 14 namespace {
15 const char kInstanceIDFieldTrialName[] = "InstanceID"; 15 const char kInstanceIDFieldTrialName[] = "InstanceID";
16 const char kInstanceIDFieldTrialEnabledGroupName[] = "Enabled"; 16 const char kInstanceIDFieldTrialDisabledGroupName[] = "Disabled";
17 } // namespace 17 } // namespace
18 18
19 // static 19 // static
20 bool InstanceIDDriver::IsInstanceIDEnabled() { 20 bool InstanceIDDriver::IsInstanceIDEnabled() {
21 std::string group_name = 21 std::string group_name =
22 base::FieldTrialList::FindFullName(kInstanceIDFieldTrialName); 22 base::FieldTrialList::FindFullName(kInstanceIDFieldTrialName);
23 return group_name == kInstanceIDFieldTrialEnabledGroupName; 23 return group_name != kInstanceIDFieldTrialDisabledGroupName;
24 } 24 }
25 25
26 InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver) 26 InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver)
27 : gcm_driver_(gcm_driver) { 27 : gcm_driver_(gcm_driver) {
28 } 28 }
29 29
30 InstanceIDDriver::~InstanceIDDriver() { 30 InstanceIDDriver::~InstanceIDDriver() {
31 } 31 }
32 32
33 InstanceID* InstanceIDDriver::GetInstanceID(const std::string& app_id) { 33 InstanceID* InstanceIDDriver::GetInstanceID(const std::string& app_id) {
(...skipping 11 matching lines...) Expand all
45 45
46 void InstanceIDDriver::RemoveInstanceID(const std::string& app_id) { 46 void InstanceIDDriver::RemoveInstanceID(const std::string& app_id) {
47 instance_id_map_.erase(app_id); 47 instance_id_map_.erase(app_id);
48 } 48 }
49 49
50 bool InstanceIDDriver::ExistsInstanceID(const std::string& app_id) const { 50 bool InstanceIDDriver::ExistsInstanceID(const std::string& app_id) const {
51 return instance_id_map_.find(app_id) != instance_id_map_.end(); 51 return instance_id_map_.find(app_id) != instance_id_map_.end();
52 } 52 }
53 53
54 } // namespace instance_id 54 } // namespace instance_id
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698