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

Side by Side Diff: chrome/common/extensions/features/feature.cc

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverting webdriver:Command::parameters_ to const Created 8 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
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/message_bundle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/common/extensions/features/feature.h" 5 #include "chrome/common/extensions/features/feature.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 scoped_ptr<VersionInfo::Channel> channel_for_testing_; 85 scoped_ptr<VersionInfo::Channel> channel_for_testing_;
86 }; 86 };
87 87
88 static base::LazyInstance<Channel> g_channel = LAZY_INSTANCE_INITIALIZER; 88 static base::LazyInstance<Channel> g_channel = LAZY_INSTANCE_INITIALIZER;
89 89
90 // TODO(aa): Can we replace all this manual parsing with JSON schema stuff? 90 // TODO(aa): Can we replace all this manual parsing with JSON schema stuff?
91 91
92 void ParseSet(const DictionaryValue* value, 92 void ParseSet(const DictionaryValue* value,
93 const std::string& property, 93 const std::string& property,
94 std::set<std::string>* set) { 94 std::set<std::string>* set) {
95 ListValue* list_value = NULL; 95 const ListValue* list_value = NULL;
96 if (!value->GetList(property, &list_value)) 96 if (!value->GetList(property, &list_value))
97 return; 97 return;
98 98
99 set->clear(); 99 set->clear();
100 for (size_t i = 0; i < list_value->GetSize(); ++i) { 100 for (size_t i = 0; i < list_value->GetSize(); ++i) {
101 std::string str_val; 101 std::string str_val;
102 CHECK(list_value->GetString(i, &str_val)) << property << " " << i; 102 CHECK(list_value->GetString(i, &str_val)) << property << " " << i;
103 set->insert(str_val); 103 set->insert(str_val);
104 } 104 }
105 } 105 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 371
372 // static 372 // static
373 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { 373 chrome::VersionInfo::Channel Feature::GetCurrentChannel() {
374 if (g_channel_checking_enabled) 374 if (g_channel_checking_enabled)
375 return g_channel.Get().GetChannel(); 375 return g_channel.Get().GetChannel();
376 return chrome::VersionInfo::GetChannel(); 376 return chrome::VersionInfo::GetChannel();
377 } 377 }
378 378
379 } // namespace 379 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/message_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698