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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 bool RouteMessage(const IPC::Message& msg) override; | 236 bool RouteMessage(const IPC::Message& msg) override; |
237 | 237 |
238 private: | 238 private: |
239 IPC::Sender* const sender_; | 239 IPC::Sender* const sender_; |
240 }; | 240 }; |
241 | 241 |
242 void Init(const Options& options); | 242 void Init(const Options& options); |
243 | 243 |
244 // We create the channel first without connecting it so we can add filters | 244 // We create the channel first without connecting it so we can add filters |
245 // prior to any messages being received, then connect it afterwards. | 245 // prior to any messages being received, then connect it afterwards. |
246 void ConnectChannel(bool use_mojo_channel, const std::string& ipc_token); | 246 void ConnectChannel(bool use_mojo_channel); |
247 | 247 |
248 // IPC message handlers. | 248 // IPC message handlers. |
249 void OnShutdown(); | 249 void OnShutdown(); |
250 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 250 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
251 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 251 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
252 void OnProfilingPhaseCompleted(int profiling_phase); | 252 void OnProfilingPhaseCompleted(int profiling_phase); |
253 #ifdef IPC_MESSAGE_LOG_ENABLED | 253 #ifdef IPC_MESSAGE_LOG_ENABLED |
254 void OnSetIPCLoggingEnabled(bool enable); | 254 void OnSetIPCLoggingEnabled(bool enable); |
255 #endif | 255 #endif |
256 | 256 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 ~Options(); | 327 ~Options(); |
328 | 328 |
329 class Builder; | 329 class Builder; |
330 | 330 |
331 std::string channel_name; | 331 std::string channel_name; |
332 bool use_mojo_channel; | 332 bool use_mojo_channel; |
333 bool auto_start_mojo_shell_connection; | 333 bool auto_start_mojo_shell_connection; |
334 bool connect_to_browser; | 334 bool connect_to_browser; |
335 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; | 335 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; |
336 std::vector<IPC::MessageFilter*> startup_filters; | 336 std::vector<IPC::MessageFilter*> startup_filters; |
337 std::string in_process_ipc_token; | |
338 std::string in_process_application_token; | 337 std::string in_process_application_token; |
339 | 338 |
340 private: | 339 private: |
341 Options(); | 340 Options(); |
342 }; | 341 }; |
343 | 342 |
344 class ChildThreadImpl::Options::Builder { | 343 class ChildThreadImpl::Options::Builder { |
345 public: | 344 public: |
346 Builder(); | 345 Builder(); |
347 | 346 |
348 Builder& InBrowserProcess(const InProcessChildThreadParams& params); | 347 Builder& InBrowserProcess(const InProcessChildThreadParams& params); |
349 Builder& UseMojoChannel(bool use_mojo_channel); | 348 Builder& UseMojoChannel(bool use_mojo_channel); |
350 Builder& AutoStartMojoShellConnection(bool auto_start); | 349 Builder& AutoStartMojoShellConnection(bool auto_start); |
351 Builder& ConnectToBrowser(bool connect_to_browser); | 350 Builder& ConnectToBrowser(bool connect_to_browser); |
352 Builder& WithChannelName(const std::string& channel_name); | 351 Builder& WithChannelName(const std::string& channel_name); |
353 Builder& AddStartupFilter(IPC::MessageFilter* filter); | 352 Builder& AddStartupFilter(IPC::MessageFilter* filter); |
354 | 353 |
355 Options Build(); | 354 Options Build(); |
356 | 355 |
357 private: | 356 private: |
358 struct Options options_; | 357 struct Options options_; |
359 | 358 |
360 DISALLOW_COPY_AND_ASSIGN(Builder); | 359 DISALLOW_COPY_AND_ASSIGN(Builder); |
361 }; | 360 }; |
362 | 361 |
363 } // namespace content | 362 } // namespace content |
364 | 363 |
365 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 364 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |