| 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_process_launcher.h" | 5 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest
.h" | 12 #include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest
.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 const char kNativeMessagingDirectory[] = | 18 const char kNativeMessagingDirectory[] = |
| 19 #if defined(OS_MAXOSX) | 19 #if defined(OS_MACOSX) |
| 20 "/Library/Chrome/NativeMessagingHosts"; | 20 "/Library/Chrome/NativeMessagingHosts"; |
| 21 #else | 21 #else |
| 22 "/etc/opt/chrome/native-messaging-hosts"; | 22 "/etc/opt/chrome/native-messaging-hosts"; |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 scoped_ptr<NativeMessagingHostManifest> | 28 scoped_ptr<NativeMessagingHostManifest> |
| 29 NativeProcessLauncher::FindAndLoadManifest( | 29 NativeProcessLauncher::FindAndLoadManifest( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 write_pipe_read_fd.reset(); | 72 write_pipe_read_fd.reset(); |
| 73 read_pipe_write_fd.reset(); | 73 read_pipe_write_fd.reset(); |
| 74 | 74 |
| 75 *read_file = *read_pipe_read_fd.release(); | 75 *read_file = *read_pipe_read_fd.release(); |
| 76 *write_file = *write_pipe_write_fd.release(); | 76 *write_file = *write_pipe_write_fd.release(); |
| 77 | 77 |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace extensions | 81 } // namespace extensions |
| OLD | NEW |