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

Side by Side Diff: chrome/common/component_flash_hint_file_linux.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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/browser/ui/webui/nacl_ui.cc ('k') | chrome/common/extensions/extension_test_util.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 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 "chrome/common/component_flash_hint_file_linux.h" 5 #include "chrome/common/component_flash_hint_file_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (!PathService::Get(chrome::FILE_COMPONENT_FLASH_HINT, &hint_file_path)) 149 if (!PathService::Get(chrome::FILE_COMPONENT_FLASH_HINT, &hint_file_path))
150 return false; 150 return false;
151 151
152 std::string json_string; 152 std::string json_string;
153 if (!base::ReadFileToString(hint_file_path, &json_string)) 153 if (!base::ReadFileToString(hint_file_path, &json_string))
154 return false; 154 return false;
155 155
156 int error_code; 156 int error_code;
157 std::string error_message; 157 std::string error_message;
158 JSONStringValueDeserializer deserializer(json_string); 158 JSONStringValueDeserializer deserializer(json_string);
159 const scoped_ptr<base::Value> value( 159 const scoped_ptr<base::Value> value =
160 deserializer.Deserialize(&error_code, &error_message)); 160 deserializer.Deserialize(&error_code, &error_message);
161 161
162 if (!value) { 162 if (!value) {
163 LOG(ERROR) 163 LOG(ERROR)
164 << "Could not deserialize the component updated Flash hint file. Error " 164 << "Could not deserialize the component updated Flash hint file. Error "
165 << error_code << ": " << error_message; 165 << error_code << ": " << error_message;
166 return false; 166 return false;
167 } 167 }
168 168
169 base::DictionaryValue* dict = nullptr; 169 base::DictionaryValue* dict = nullptr;
170 if (!value->GetAsDictionary(&dict)) 170 if (!value->GetAsDictionary(&dict))
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 "component flash plugin will not be loaded."; 213 "component flash plugin will not be loaded.";
214 return false; 214 return false;
215 } 215 }
216 216
217 *path = plugin_path; 217 *path = plugin_path;
218 flash_version->assign(plugin_version_str); 218 flash_version->assign(plugin_version_str);
219 return true; 219 return true;
220 } 220 }
221 221
222 } // namespace component_flash_hint_file 222 } // namespace component_flash_hint_file
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/nacl_ui.cc ('k') | chrome/common/extensions/extension_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698