OLD | NEW |
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 "remoting/host/elevated_controller_win.h" | 5 #include "remoting/host/elevated_controller_win.h" |
6 | 6 |
7 #include <sddl.h> | 7 #include <sddl.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 DWORD size = kMaxConfigFileSize; | 67 DWORD size = kMaxConfigFileSize; |
68 if (!::ReadFile(file, &buffer[0], size, &size, NULL)) { | 68 if (!::ReadFile(file, &buffer[0], size, &size, NULL)) { |
69 DWORD error = GetLastError(); | 69 DWORD error = GetLastError(); |
70 LOG_GETLASTERROR(ERROR) | 70 LOG_GETLASTERROR(ERROR) |
71 << "Failed to read '" << filename.value() << "'"; | 71 << "Failed to read '" << filename.value() << "'"; |
72 return HRESULT_FROM_WIN32(error); | 72 return HRESULT_FROM_WIN32(error); |
73 } | 73 } |
74 | 74 |
75 // Parse the JSON configuration, expecting it to contain a dictionary. | 75 // Parse the JSON configuration, expecting it to contain a dictionary. |
76 std::string file_content(buffer.get(), size); | 76 std::string file_content(buffer.get(), size); |
77 scoped_ptr<base::Value> value(base::JSONReader::Read(file_content, true)); | 77 scoped_ptr<base::Value> value( |
| 78 base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS)); |
78 | 79 |
79 base::DictionaryValue* dictionary; | 80 base::DictionaryValue* dictionary; |
80 if (value.get() == NULL || !value->GetAsDictionary(&dictionary)) { | 81 if (value.get() == NULL || !value->GetAsDictionary(&dictionary)) { |
81 LOG(ERROR) << "Failed to read '" << filename.value() << "'."; | 82 LOG(ERROR) << "Failed to read '" << filename.value() << "'."; |
82 return E_FAIL; | 83 return E_FAIL; |
83 } | 84 } |
84 | 85 |
85 value.release(); | 86 value.release(); |
86 config_out->reset(dictionary); | 87 config_out->reset(dictionary); |
87 return S_OK; | 88 return S_OK; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 << "Failed to open to the '" << kWindowsServiceName << "' service"; | 288 << "Failed to open to the '" << kWindowsServiceName << "' service"; |
288 | 289 |
289 return HRESULT_FROM_WIN32(error); | 290 return HRESULT_FROM_WIN32(error); |
290 } | 291 } |
291 | 292 |
292 service_out->Set(service.Take()); | 293 service_out->Set(service.Take()); |
293 return S_OK; | 294 return S_OK; |
294 } | 295 } |
295 | 296 |
296 } // namespace remoting | 297 } // namespace remoting |
OLD | NEW |