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, | 224 void ConnectChannel(bool use_mojo_channel, const std::string& ipc_token); |
225 mojo::ScopedMessagePipeHandle handle); | |
226 | 225 |
227 // IPC message handlers. | 226 // IPC message handlers. |
228 void OnShutdown(); | 227 void OnShutdown(); |
229 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 228 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
230 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 229 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
231 void OnProfilingPhaseCompleted(int profiling_phase); | 230 void OnProfilingPhaseCompleted(int profiling_phase); |
232 #ifdef IPC_MESSAGE_LOG_ENABLED | 231 #ifdef IPC_MESSAGE_LOG_ENABLED |
233 void OnSetIPCLoggingEnabled(bool enable); | 232 void OnSetIPCLoggingEnabled(bool enable); |
234 #endif | 233 #endif |
235 | 234 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 struct ChildThreadImpl::Options { | 297 struct ChildThreadImpl::Options { |
299 Options(const Options& other); | 298 Options(const Options& other); |
300 ~Options(); | 299 ~Options(); |
301 | 300 |
302 class Builder; | 301 class Builder; |
303 | 302 |
304 std::string channel_name; | 303 std::string channel_name; |
305 bool use_mojo_channel; | 304 bool use_mojo_channel; |
306 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; | 305 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; |
307 std::vector<IPC::MessageFilter*> startup_filters; | 306 std::vector<IPC::MessageFilter*> startup_filters; |
308 mojo::MessagePipeHandle in_process_message_pipe_handle; | 307 std::string in_process_ipc_token; |
309 std::string in_process_application_token; | 308 std::string in_process_application_token; |
310 | 309 |
311 private: | 310 private: |
312 Options(); | 311 Options(); |
313 }; | 312 }; |
314 | 313 |
315 class ChildThreadImpl::Options::Builder { | 314 class ChildThreadImpl::Options::Builder { |
316 public: | 315 public: |
317 Builder(); | 316 Builder(); |
318 | 317 |
319 Builder& InBrowserProcess(const InProcessChildThreadParams& params); | 318 Builder& InBrowserProcess(const InProcessChildThreadParams& params); |
320 Builder& UseMojoChannel(bool use_mojo_channel); | 319 Builder& UseMojoChannel(bool use_mojo_channel); |
321 Builder& WithChannelName(const std::string& channel_name); | 320 Builder& WithChannelName(const std::string& channel_name); |
322 Builder& AddStartupFilter(IPC::MessageFilter* filter); | 321 Builder& AddStartupFilter(IPC::MessageFilter* filter); |
323 | 322 |
324 Options Build(); | 323 Options Build(); |
325 | 324 |
326 private: | 325 private: |
327 struct Options options_; | 326 struct Options options_; |
328 | 327 |
329 DISALLOW_COPY_AND_ASSIGN(Builder); | 328 DISALLOW_COPY_AND_ASSIGN(Builder); |
330 }; | 329 }; |
331 | 330 |
332 } // namespace content | 331 } // namespace content |
333 | 332 |
334 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 333 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |