| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ |
| 6 #define CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ | 6 #define CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "mojo/public/cpp/system/message_pipe.h" | |
| 14 | 13 |
| 15 namespace content { | 14 namespace content { |
| 16 | 15 |
| 17 // Tells ChildThreadImpl to run in in-process mode. There are a couple of | 16 // Tells ChildThreadImpl to run in in-process mode. There are a couple of |
| 18 // parameters to run in the mode: An emulated io task runner used by | 17 // parameters to run in the mode: An emulated io task runner used by |
| 19 // ChnanelMojo, an IPC channel name to open. | 18 // ChnanelMojo, an IPC channel name to open. |
| 20 class CONTENT_EXPORT InProcessChildThreadParams { | 19 class CONTENT_EXPORT InProcessChildThreadParams { |
| 21 public: | 20 public: |
| 22 InProcessChildThreadParams( | 21 InProcessChildThreadParams( |
| 23 const std::string& channel_name, | 22 const std::string& channel_name, |
| 24 scoped_refptr<base::SequencedTaskRunner> io_runner, | 23 scoped_refptr<base::SequencedTaskRunner> io_runner, |
| 25 mojo::MessagePipeHandle handle = mojo::MessagePipeHandle(), | 24 const std::string& ipc_token = std::string(), |
| 26 const std::string& application_token = std::string()); | 25 const std::string& application_token = std::string()); |
| 27 InProcessChildThreadParams(const InProcessChildThreadParams& other); | 26 InProcessChildThreadParams(const InProcessChildThreadParams& other); |
| 28 ~InProcessChildThreadParams(); | 27 ~InProcessChildThreadParams(); |
| 29 | 28 |
| 30 const std::string& channel_name() const { return channel_name_; } | 29 const std::string& channel_name() const { return channel_name_; } |
| 31 scoped_refptr<base::SequencedTaskRunner> io_runner() const { | 30 scoped_refptr<base::SequencedTaskRunner> io_runner() const { |
| 32 return io_runner_; | 31 return io_runner_; |
| 33 } | 32 } |
| 34 mojo::MessagePipeHandle handle() const { return handle_; } | 33 const std::string& ipc_token() const { return ipc_token_; } |
| 35 const std::string& application_token() const { | 34 const std::string& application_token() const { |
| 36 return application_token_; | 35 return application_token_; |
| 37 } | 36 } |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 std::string channel_name_; | 39 std::string channel_name_; |
| 41 scoped_refptr<base::SequencedTaskRunner> io_runner_; | 40 scoped_refptr<base::SequencedTaskRunner> io_runner_; |
| 42 mojo::MessagePipeHandle handle_; | 41 std::string ipc_token_; |
| 43 std::string application_token_; | 42 std::string application_token_; |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 } // namespace content | 45 } // namespace content |
| 47 | 46 |
| 48 #endif // CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ | 47 #endif // CONTENT_COMMON_IN_PROCESS_CHILD_THREAD_PARAMS_H_ |
| OLD | NEW |