Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: chrome/browser/extensions/api/messaging/native_process_launcher.h

Issue 759903002: Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome build Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 16 matching lines...) Expand all
27 RESULT_INVALID_NAME, 27 RESULT_INVALID_NAME,
28 RESULT_NOT_FOUND, 28 RESULT_NOT_FOUND,
29 RESULT_FORBIDDEN, 29 RESULT_FORBIDDEN,
30 RESULT_FAILED_TO_START, 30 RESULT_FAILED_TO_START,
31 }; 31 };
32 32
33 // Callback that's called after the process has been launched. |result| is set 33 // Callback that's called after the process has been launched. |result| is set
34 // to false in case of a failure. Handler must take ownership of the IO 34 // to false in case of a failure. Handler must take ownership of the IO
35 // handles. 35 // handles.
36 typedef base::Callback<void(LaunchResult result, 36 typedef base::Callback<void(LaunchResult result,
37 base::ProcessHandle process_handle, 37 base::Process process,
38 base::File read_file, 38 base::File read_file,
39 base::File write_file)> LaunchedCallback; 39 base::File write_file)> LaunchedCallback;
40 40
41 static scoped_ptr<NativeProcessLauncher> CreateDefault( 41 static scoped_ptr<NativeProcessLauncher> CreateDefault(
42 bool allow_user_level_hosts, 42 bool allow_user_level_hosts,
43 gfx::NativeView native_view); 43 gfx::NativeView native_view);
44 44
45 NativeProcessLauncher() {} 45 NativeProcessLauncher() {}
46 virtual ~NativeProcessLauncher() {} 46 virtual ~NativeProcessLauncher() {}
47 47
(...skipping 13 matching lines...) Expand all
61 61
62 // Finds manifest file for the native messaging host |native_host_name|. 62 // Finds manifest file for the native messaging host |native_host_name|.
63 // |user_level| is set to true if the manifest is installed on user level. 63 // |user_level| is set to true if the manifest is installed on user level.
64 // Returns an empty path if the host with the specified name cannot be found. 64 // Returns an empty path if the host with the specified name cannot be found.
65 static base::FilePath FindManifest(const std::string& native_host_name, 65 static base::FilePath FindManifest(const std::string& native_host_name,
66 bool allow_user_level_hosts, 66 bool allow_user_level_hosts,
67 std::string* error_message); 67 std::string* error_message);
68 68
69 // Launches native messaging process. 69 // Launches native messaging process.
70 static bool LaunchNativeProcess(const base::CommandLine& command_line, 70 static bool LaunchNativeProcess(const base::CommandLine& command_line,
71 base::ProcessHandle* process_handle, 71 base::Process* process,
72 base::File* read_file, 72 base::File* read_file,
73 base::File* write_file); 73 base::File* write_file);
74 74
75 private: 75 private:
76 DISALLOW_COPY_AND_ASSIGN(NativeProcessLauncher); 76 DISALLOW_COPY_AND_ASSIGN(NativeProcessLauncher);
77 }; 77 };
78 78
79 } // namespace extensions 79 } // namespace extensions
80 80
81 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_ 81 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_PROCESS_LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698