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 "chrome/browser/extensions/api/messaging/native_message_process_host.h" | 5 #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/pickle.h" | 11 #include "base/pickle.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 14 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
18 #include "chrome/common/extensions/features/feature.h" | 18 #include "chrome/common/extensions/features/feature.h" |
19 #include "content/public/common/result_codes.h" | 19 #include "content/public/common/result_codes.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 const int kExitTimeoutMS = 5000; | 23 const int kExitTimeoutMS = 5000; |
24 const uint32 kMaxMessageDataLength = 10 * 1024 * 1024; | 24 const uint32 kMaxMessageDataLength = 10 * 1024 * 1024; |
25 const char kNativeHostsDirectoryName[] = "Native Hosts"; | 25 const char kNativeHostsDirectoryName[] = "native_hosts"; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 namespace extensions { | 29 namespace extensions { |
30 | 30 |
31 NativeMessageProcessHost::NativeMessageProcessHost( | 31 NativeMessageProcessHost::NativeMessageProcessHost( |
32 base::WeakPtr<Client> weak_client_ui, | 32 base::WeakPtr<Client> weak_client_ui, |
33 int destination_port, | 33 int destination_port, |
34 base::ProcessHandle native_process_handle, | 34 base::ProcessHandle native_process_handle, |
35 FileHandle read_file, | 35 FileHandle read_file, |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 message->resize(data_length, '\0'); | 218 message->resize(data_length, '\0'); |
219 if (!ReadData(read_file_, &(*message)[0], data_length)) { | 219 if (!ReadData(read_file_, &(*message)[0], data_length)) { |
220 LOG(ERROR) << "Error reading the json data."; | 220 LOG(ERROR) << "Error reading the json data."; |
221 return false; | 221 return false; |
222 } | 222 } |
223 | 223 |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 } // namespace extensions | 227 } // namespace extensions |
OLD | NEW |