OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/setup/daemon_controller_delegate_win.h" | 5 #include "remoting/host/setup/daemon_controller_delegate_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" |
13 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 #include "base/win/scoped_bstr.h" | 16 #include "base/win/scoped_bstr.h" |
16 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
17 #include "remoting/base/scoped_sc_handle_win.h" | 18 #include "remoting/base/scoped_sc_handle_win.h" |
18 #include "remoting/host/branding.h" | 19 #include "remoting/host/branding.h" |
19 #include "remoting/host/host_config.h" | 20 #include "remoting/host/host_config.h" |
20 #include "remoting/host/usage_stats_consent.h" | 21 #include "remoting/host/usage_stats_consent.h" |
21 #include "remoting/host/win/security_descriptor.h" | 22 #include "remoting/host/win/security_descriptor.h" |
22 | 23 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Parse the JSON configuration, expecting it to contain a dictionary. | 75 // Parse the JSON configuration, expecting it to contain a dictionary. |
75 scoped_ptr<base::Value> value = | 76 scoped_ptr<base::Value> value = |
76 base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS); | 77 base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS); |
77 | 78 |
78 base::DictionaryValue* dictionary; | 79 base::DictionaryValue* dictionary; |
79 if (!value || !value->GetAsDictionary(&dictionary)) { | 80 if (!value || !value->GetAsDictionary(&dictionary)) { |
80 LOG(ERROR) << "Failed to parse '" << filename.value() << "'."; | 81 LOG(ERROR) << "Failed to parse '" << filename.value() << "'."; |
81 return false; | 82 return false; |
82 } | 83 } |
83 | 84 |
84 value.release(); | 85 ignore_result(value.release()); |
85 config_out->reset(dictionary); | 86 config_out->reset(dictionary); |
86 return true; | 87 return true; |
87 } | 88 } |
88 | 89 |
89 base::FilePath GetTempLocationFor(const base::FilePath& filename) { | 90 base::FilePath GetTempLocationFor(const base::FilePath& filename) { |
90 return filename.ReplaceExtension(kTempFileExtension); | 91 return filename.ReplaceExtension(kTempFileExtension); |
91 } | 92 } |
92 | 93 |
93 // Writes a config file to a temporary location. | 94 // Writes a config file to a temporary location. |
94 bool WriteConfigFileToTemp(const base::FilePath& filename, | 95 bool WriteConfigFileToTemp(const base::FilePath& filename, |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 InvokeCompletionCallback(done, StartDaemon()); | 467 InvokeCompletionCallback(done, StartDaemon()); |
467 } | 468 } |
468 | 469 |
469 scoped_refptr<DaemonController> DaemonController::Create() { | 470 scoped_refptr<DaemonController> DaemonController::Create() { |
470 scoped_ptr<DaemonController::Delegate> delegate( | 471 scoped_ptr<DaemonController::Delegate> delegate( |
471 new DaemonControllerDelegateWin()); | 472 new DaemonControllerDelegateWin()); |
472 return new DaemonController(delegate.Pass()); | 473 return new DaemonController(delegate.Pass()); |
473 } | 474 } |
474 | 475 |
475 } // namespace remoting | 476 } // namespace remoting |
OLD | NEW |