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 #ifndef COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ |
6 #define COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ | 6 #define COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 NaClBrokerHost(); | 25 NaClBrokerHost(); |
26 ~NaClBrokerHost() override; | 26 ~NaClBrokerHost() override; |
27 | 27 |
28 // This function starts the broker process. It needs to be called | 28 // This function starts the broker process. It needs to be called |
29 // before loaders can be launched. | 29 // before loaders can be launched. |
30 bool Init(); | 30 bool Init(); |
31 | 31 |
32 // Send a message to the broker process, causing it to launch | 32 // Send a message to the broker process, causing it to launch |
33 // a Native Client loader process. | 33 // a Native Client loader process. |
34 bool LaunchLoader(const std::string& loader_channel_id); | 34 bool LaunchLoader(const std::string& loader_channel_token); |
35 | 35 |
36 bool LaunchDebugExceptionHandler(int32_t pid, | 36 bool LaunchDebugExceptionHandler(int32_t pid, |
37 base::ProcessHandle process_handle, | 37 base::ProcessHandle process_handle, |
38 const std::string& startup_info); | 38 const std::string& startup_info); |
39 | 39 |
40 // Stop the broker process. | 40 // Stop the broker process. |
41 void StopBroker(); | 41 void StopBroker(); |
42 | 42 |
43 // Returns true if the process has been asked to terminate. If true, this | 43 // Returns true if the process has been asked to terminate. If true, this |
44 // object should no longer be used; it will eventually be destroyed by | 44 // object should no longer be used; it will eventually be destroyed by |
45 // BrowserChildProcessHostImpl::OnChildDisconnected() | 45 // BrowserChildProcessHostImpl::OnChildDisconnected() |
46 bool IsTerminating() { return is_terminating_; } | 46 bool IsTerminating() { return is_terminating_; } |
47 | 47 |
48 private: | 48 private: |
49 // Handler for NaClProcessMsg_LoaderLaunched message | 49 // Handler for NaClProcessMsg_LoaderLaunched message |
50 void OnLoaderLaunched(const std::string& loader_channel_id, | 50 void OnLoaderLaunched(const std::string& loader_channel_token, |
51 base::ProcessHandle handle); | 51 base::ProcessHandle handle); |
52 // Handler for NaClProcessMsg_DebugExceptionHandlerLaunched message | 52 // Handler for NaClProcessMsg_DebugExceptionHandlerLaunched message |
53 void OnDebugExceptionHandlerLaunched(int32_t pid, bool success); | 53 void OnDebugExceptionHandlerLaunched(int32_t pid, bool success); |
54 | 54 |
55 // BrowserChildProcessHostDelegate implementation: | 55 // BrowserChildProcessHostDelegate implementation: |
56 bool OnMessageReceived(const IPC::Message& msg) override; | 56 bool OnMessageReceived(const IPC::Message& msg) override; |
57 | 57 |
58 std::unique_ptr<content::BrowserChildProcessHost> process_; | 58 std::unique_ptr<content::BrowserChildProcessHost> process_; |
59 bool is_terminating_; | 59 bool is_terminating_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(NaClBrokerHost); | 61 DISALLOW_COPY_AND_ASSIGN(NaClBrokerHost); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace nacl | 64 } // namespace nacl |
65 | 65 |
66 #endif // COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ | 66 #endif // COMPONENTS_NACL_BROWSER_NACL_BROKER_HOST_WIN_H_ |
OLD | NEW |