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 CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 bool RouteMessage(const IPC::Message& msg) override; | 214 bool RouteMessage(const IPC::Message& msg) override; |
215 | 215 |
216 private: | 216 private: |
217 IPC::Sender* const sender_; | 217 IPC::Sender* const sender_; |
218 }; | 218 }; |
219 | 219 |
220 void Init(const Options& options); | 220 void Init(const Options& options); |
221 | 221 |
222 // We create the channel first without connecting it so we can add filters | 222 // We create the channel first without connecting it so we can add filters |
223 // prior to any messages being received, then connect it afterwards. | 223 // prior to any messages being received, then connect it afterwards. |
224 void ConnectChannel(bool use_mojo_channel, const std::string& ipc_token); | 224 void ConnectChannel(bool use_mojo_channel, |
| 225 mojo::ScopedMessagePipeHandle handle); |
225 | 226 |
226 // IPC message handlers. | 227 // IPC message handlers. |
227 void OnShutdown(); | 228 void OnShutdown(); |
228 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 229 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
229 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 230 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
230 void OnProfilingPhaseCompleted(int profiling_phase); | 231 void OnProfilingPhaseCompleted(int profiling_phase); |
231 #ifdef IPC_MESSAGE_LOG_ENABLED | 232 #ifdef IPC_MESSAGE_LOG_ENABLED |
232 void OnSetIPCLoggingEnabled(bool enable); | 233 void OnSetIPCLoggingEnabled(bool enable); |
233 #endif | 234 #endif |
234 | 235 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 struct ChildThreadImpl::Options { | 298 struct ChildThreadImpl::Options { |
298 Options(const Options& other); | 299 Options(const Options& other); |
299 ~Options(); | 300 ~Options(); |
300 | 301 |
301 class Builder; | 302 class Builder; |
302 | 303 |
303 std::string channel_name; | 304 std::string channel_name; |
304 bool use_mojo_channel; | 305 bool use_mojo_channel; |
305 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; | 306 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; |
306 std::vector<IPC::MessageFilter*> startup_filters; | 307 std::vector<IPC::MessageFilter*> startup_filters; |
307 std::string in_process_ipc_token; | 308 mojo::MessagePipeHandle in_process_message_pipe_handle; |
308 std::string in_process_application_token; | 309 std::string in_process_application_token; |
309 | 310 |
310 private: | 311 private: |
311 Options(); | 312 Options(); |
312 }; | 313 }; |
313 | 314 |
314 class ChildThreadImpl::Options::Builder { | 315 class ChildThreadImpl::Options::Builder { |
315 public: | 316 public: |
316 Builder(); | 317 Builder(); |
317 | 318 |
318 Builder& InBrowserProcess(const InProcessChildThreadParams& params); | 319 Builder& InBrowserProcess(const InProcessChildThreadParams& params); |
319 Builder& UseMojoChannel(bool use_mojo_channel); | 320 Builder& UseMojoChannel(bool use_mojo_channel); |
320 Builder& WithChannelName(const std::string& channel_name); | 321 Builder& WithChannelName(const std::string& channel_name); |
321 Builder& AddStartupFilter(IPC::MessageFilter* filter); | 322 Builder& AddStartupFilter(IPC::MessageFilter* filter); |
322 | 323 |
323 Options Build(); | 324 Options Build(); |
324 | 325 |
325 private: | 326 private: |
326 struct Options options_; | 327 struct Options options_; |
327 | 328 |
328 DISALLOW_COPY_AND_ASSIGN(Builder); | 329 DISALLOW_COPY_AND_ASSIGN(Builder); |
329 }; | 330 }; |
330 | 331 |
331 } // namespace content | 332 } // namespace content |
332 | 333 |
333 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 334 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |