Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: mojo/system/embedder/platform_channel_pair.h

Issue 196413016: Move CommandLine to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/shell/child_process.h ('k') | net/test/python_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 5 #ifndef MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
6 #define MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 6 #define MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/process/launch.h" 10 #include "base/process/launch.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "mojo/system/embedder/scoped_platform_handle.h" 12 #include "mojo/system/embedder/scoped_platform_handle.h"
13 #include "mojo/system/system_impl_export.h" 13 #include "mojo/system/system_impl_export.h"
14 14
15 namespace base {
15 class CommandLine; 16 class CommandLine;
17 }
16 18
17 namespace mojo { 19 namespace mojo {
18 namespace embedder { 20 namespace embedder {
19 21
20 // It would be nice to refactor base/process/launch.h to have a more platform- 22 // It would be nice to refactor base/process/launch.h to have a more platform-
21 // independent way of representing handles that are passed to child processes. 23 // independent way of representing handles that are passed to child processes.
22 #if defined(OS_WIN) 24 #if defined(OS_WIN)
23 typedef base::HandlesToInheritVector HandlePassingInformation; 25 typedef base::HandlesToInheritVector HandlePassingInformation;
24 #elif defined(OS_POSIX) 26 #elif defined(OS_POSIX)
25 typedef base::FileHandleMappingVector HandlePassingInformation; 27 typedef base::FileHandleMappingVector HandlePassingInformation;
(...skipping 25 matching lines...) Expand all
51 ScopedPlatformHandle PassServerHandle(); 53 ScopedPlatformHandle PassServerHandle();
52 54
53 // For in-process use (e.g., in tests or to pass over another channel). 55 // For in-process use (e.g., in tests or to pass over another channel).
54 ScopedPlatformHandle PassClientHandle(); 56 ScopedPlatformHandle PassClientHandle();
55 57
56 // To be called in the child process, after the parent process called 58 // To be called in the child process, after the parent process called
57 // |PrepareToPassClientHandleToChildProcess()| and launched the child (using 59 // |PrepareToPassClientHandleToChildProcess()| and launched the child (using
58 // the provided data), to create a client handle connected to the server 60 // the provided data), to create a client handle connected to the server
59 // handle (in the parent process). 61 // handle (in the parent process).
60 static ScopedPlatformHandle PassClientHandleFromParentProcess( 62 static ScopedPlatformHandle PassClientHandleFromParentProcess(
61 const CommandLine& command_line); 63 const base::CommandLine& command_line);
62 64
63 // Prepares to pass the client channel to a new child process, to be launched 65 // Prepares to pass the client channel to a new child process, to be launched
64 // using |LaunchProcess()| (from base/launch.h). Modifies |*command_line| and 66 // using |LaunchProcess()| (from base/launch.h). Modifies |*command_line| and
65 // |*handle_passing_info| as needed. 67 // |*handle_passing_info| as needed.
66 // Note: For Windows, this method only works on Vista and later. 68 // Note: For Windows, this method only works on Vista and later.
67 void PrepareToPassClientHandleToChildProcess( 69 void PrepareToPassClientHandleToChildProcess(
68 CommandLine* command_line, 70 base::CommandLine* command_line,
69 HandlePassingInformation* handle_passing_info) const; 71 HandlePassingInformation* handle_passing_info) const;
70 72
71 // To be called once the child process has been successfully launched, to do 73 // To be called once the child process has been successfully launched, to do
72 // any cleanup necessary. 74 // any cleanup necessary.
73 void ChildProcessLaunched(); 75 void ChildProcessLaunched();
74 76
75 private: 77 private:
76 static const char kMojoPlatformChannelHandleSwitch[]; 78 static const char kMojoPlatformChannelHandleSwitch[];
77 79
78 ScopedPlatformHandle server_handle_; 80 ScopedPlatformHandle server_handle_;
79 ScopedPlatformHandle client_handle_; 81 ScopedPlatformHandle client_handle_;
80 82
81 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair); 83 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair);
82 }; 84 };
83 85
84 } // namespace embedder 86 } // namespace embedder
85 } // namespace mojo 87 } // namespace mojo
86 88
87 #endif // MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 89 #endif // MOJO_SYSTEM_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
OLDNEW
« no previous file with comments | « mojo/shell/child_process.h ('k') | net/test/python_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698