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

Side by Side Diff: chrome/browser/extensions/api/messaging/native_message_process_host.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_MESSAGE_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 private: 65 private:
66 NativeMessageProcessHost(const std::string& source_extension_id, 66 NativeMessageProcessHost(const std::string& source_extension_id,
67 const std::string& native_host_name, 67 const std::string& native_host_name,
68 scoped_ptr<NativeProcessLauncher> launcher); 68 scoped_ptr<NativeProcessLauncher> launcher);
69 69
70 // Starts the host process. 70 // Starts the host process.
71 void LaunchHostProcess(); 71 void LaunchHostProcess();
72 72
73 // Callback for NativeProcessLauncher::Launch(). 73 // Callback for NativeProcessLauncher::Launch().
74 void OnHostProcessLaunched(NativeProcessLauncher::LaunchResult result, 74 void OnHostProcessLaunched(NativeProcessLauncher::LaunchResult result,
75 base::ProcessHandle process_handle, 75 base::Process process,
76 base::File read_file, 76 base::File read_file,
77 base::File write_file); 77 base::File write_file);
78 78
79 // Helper methods to read incoming messages. 79 // Helper methods to read incoming messages.
80 void WaitRead(); 80 void WaitRead();
81 void DoRead(); 81 void DoRead();
82 void OnRead(int result); 82 void OnRead(int result);
83 void HandleReadResult(int result); 83 void HandleReadResult(int result);
84 void ProcessIncomingData(const char* data, int data_size); 84 void ProcessIncomingData(const char* data, int data_size);
85 85
(...skipping 15 matching lines...) Expand all
101 // Name of the native messaging host. 101 // Name of the native messaging host.
102 std::string native_host_name_; 102 std::string native_host_name_;
103 103
104 // Launcher used to launch the native process. 104 // Launcher used to launch the native process.
105 scoped_ptr<NativeProcessLauncher> launcher_; 105 scoped_ptr<NativeProcessLauncher> launcher_;
106 106
107 // Set to true after the native messaging connection has been stopped, e.g. 107 // Set to true after the native messaging connection has been stopped, e.g.
108 // due to an error. 108 // due to an error.
109 bool closed_; 109 bool closed_;
110 110
111 base::ProcessHandle process_handle_; 111 base::Process process_;
112 112
113 // Input stream reader. 113 // Input stream reader.
114 scoped_ptr<net::FileStream> read_stream_; 114 scoped_ptr<net::FileStream> read_stream_;
115 115
116 #if defined(OS_POSIX) 116 #if defined(OS_POSIX)
117 base::PlatformFile read_file_; 117 base::PlatformFile read_file_;
118 base::MessageLoopForIO::FileDescriptorWatcher read_watcher_; 118 base::MessageLoopForIO::FileDescriptorWatcher read_watcher_;
119 #endif // !defined(OS_POSIX) 119 #endif // !defined(OS_POSIX)
120 120
121 // Write stream. 121 // Write stream.
(...skipping 20 matching lines...) Expand all
142 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 142 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
143 143
144 base::WeakPtrFactory<NativeMessageProcessHost> weak_factory_; 144 base::WeakPtrFactory<NativeMessageProcessHost> weak_factory_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); 146 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost);
147 }; 147 };
148 148
149 } // namespace extensions 149 } // namespace extensions
150 150
151 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H _ 151 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H _
OLDNEW
« no previous file with comments | « base/process/process_util_unittest.cc ('k') | chrome/browser/extensions/api/messaging/native_message_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698