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

Side by Side Diff: chrome/installer/util/master_preferences.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 (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/installer/util/master_preferences.h" 5 #include "chrome/installer/util/master_preferences.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 base::DictionaryValue* ParseDistributionPreferences( 57 base::DictionaryValue* ParseDistributionPreferences(
58 const std::string& json_data) { 58 const std::string& json_data) {
59 JSONStringValueDeserializer json(json_data); 59 JSONStringValueDeserializer json(json_data);
60 std::string error; 60 std::string error;
61 std::unique_ptr<base::Value> root(json.Deserialize(NULL, &error)); 61 std::unique_ptr<base::Value> root(json.Deserialize(NULL, &error));
62 if (!root.get()) { 62 if (!root.get()) {
63 LOG(WARNING) << "Failed to parse master prefs file: " << error; 63 LOG(WARNING) << "Failed to parse master prefs file: " << error;
64 return NULL; 64 return NULL;
65 } 65 }
66 if (!root->IsType(base::Value::TYPE_DICTIONARY)) { 66 if (!root->IsType(base::Value::Type::DICTIONARY)) {
67 LOG(WARNING) << "Failed to parse master prefs file: " 67 LOG(WARNING) << "Failed to parse master prefs file: "
68 << "Root item must be a dictionary."; 68 << "Root item must be a dictionary.";
69 return NULL; 69 return NULL;
70 } 70 }
71 return static_cast<base::DictionaryValue*>(root.release()); 71 return static_cast<base::DictionaryValue*>(root.release());
72 } 72 }
73 73
74 } // namespace 74 } // namespace
75 75
76 namespace installer { 76 namespace installer {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 return result; 310 return result;
311 } 311 }
312 312
313 // static 313 // static
314 const MasterPreferences& MasterPreferences::ForCurrentProcess() { 314 const MasterPreferences& MasterPreferences::ForCurrentProcess() {
315 return g_master_preferences.Get(); 315 return g_master_preferences.Get();
316 } 316 }
317 317
318 } // namespace installer 318 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698