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/plugin/daemon_controller.h" | 5 #include "remoting/host/plugin/daemon_controller.h" |
6 | 6 |
7 #include <objbase.h> | 7 #include <objbase.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 hr = control->GetConfig(host_config.Receive()); | 320 hr = control->GetConfig(host_config.Receive()); |
321 if (FAILED(hr)) { | 321 if (FAILED(hr)) { |
322 callback.Run(scoped_ptr<base::DictionaryValue>()); | 322 callback.Run(scoped_ptr<base::DictionaryValue>()); |
323 return; | 323 return; |
324 } | 324 } |
325 | 325 |
326 string16 file_content(static_cast<BSTR>(host_config), host_config.Length()); | 326 string16 file_content(static_cast<BSTR>(host_config), host_config.Length()); |
327 | 327 |
328 // Parse the string into a dictionary. | 328 // Parse the string into a dictionary. |
329 scoped_ptr<base::Value> config( | 329 scoped_ptr<base::Value> config( |
330 base::JSONReader::Read(UTF16ToUTF8(file_content), true)); | 330 base::JSONReader::Read(UTF16ToUTF8(file_content), |
| 331 base::JSON_ALLOW_TRAILING_COMMAS)); |
331 | 332 |
332 base::DictionaryValue* dictionary; | 333 base::DictionaryValue* dictionary; |
333 if (config.get() == NULL || !config->GetAsDictionary(&dictionary)) { | 334 if (config.get() == NULL || !config->GetAsDictionary(&dictionary)) { |
334 callback.Run(scoped_ptr<base::DictionaryValue>()); | 335 callback.Run(scoped_ptr<base::DictionaryValue>()); |
335 return; | 336 return; |
336 } | 337 } |
337 | 338 |
338 config.release(); | 339 config.release(); |
339 callback.Run(scoped_ptr<base::DictionaryValue>(dictionary)); | 340 callback.Run(scoped_ptr<base::DictionaryValue>(dictionary)); |
340 } | 341 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 done_callback.Run(HResultToAsyncResult(hr)); | 420 done_callback.Run(HResultToAsyncResult(hr)); |
420 } | 421 } |
421 | 422 |
422 } // namespace | 423 } // namespace |
423 | 424 |
424 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 425 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
425 return scoped_ptr<DaemonController>(new DaemonControllerWin()); | 426 return scoped_ptr<DaemonController>(new DaemonControllerWin()); |
426 } | 427 } |
427 | 428 |
428 } // namespace remoting | 429 } // namespace remoting |
OLD | NEW |