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

Side by Side Diff: components/prefs/command_line_pref_store.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/prefs/command_line_pref_store.h" 5 #include "components/prefs/command_line_pref_store.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 std::string str_value = command_line_->GetSwitchValueASCII( 53 std::string str_value = command_line_->GetSwitchValueASCII(
54 integer_switch[i].switch_name); 54 integer_switch[i].switch_name);
55 int int_value = 0; 55 int int_value = 0;
56 if (!base::StringToInt(str_value, &int_value)) { 56 if (!base::StringToInt(str_value, &int_value)) {
57 LOG(ERROR) << "The value " << str_value << " of " 57 LOG(ERROR) << "The value " << str_value << " of "
58 << integer_switch[i].switch_name 58 << integer_switch[i].switch_name
59 << " can not be converted to integer, ignoring!"; 59 << " can not be converted to integer, ignoring!";
60 continue; 60 continue;
61 } 61 }
62 SetValue(integer_switch[i].preference_path, 62 SetValue(integer_switch[i].preference_path,
63 base::MakeUnique<base::FundamentalValue>(int_value), 63 base::MakeUnique<base::Value>(int_value),
64 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); 64 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
65 } 65 }
66 } 66 }
67 } 67 }
68 68
69 void CommandLinePrefStore::ApplyBooleanSwitches( 69 void CommandLinePrefStore::ApplyBooleanSwitches(
70 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry 70 const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry
71 boolean_switch_map[], size_t size) { 71 boolean_switch_map[], size_t size) {
72 for (size_t i = 0; i < size; ++i) { 72 for (size_t i = 0; i < size; ++i) {
73 if (command_line_->HasSwitch(boolean_switch_map[i].switch_name)) { 73 if (command_line_->HasSwitch(boolean_switch_map[i].switch_name)) {
74 SetValue(boolean_switch_map[i].preference_path, 74 SetValue(boolean_switch_map[i].preference_path,
75 base::MakeUnique<base::FundamentalValue>( 75 base::MakeUnique<base::Value>(boolean_switch_map[i].set_value),
76 boolean_switch_map[i].set_value),
77 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); 76 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
78 } 77 }
79 } 78 }
80 } 79 }
OLDNEW
« no previous file with comments | « components/policy/tools/generate_policy_source_test.py ('k') | components/prefs/in_memory_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698