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

Side by Side Diff: ipc/mojo/ipc_mojo_bootstrap.h

Issue 942933005: ChannelMojo should use PID from the bootstrap Channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_ 5 #ifndef IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_
6 #define IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_ 6 #define IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "ipc/ipc_channel.h" 10 #include "ipc/ipc_channel.h"
(...skipping 28 matching lines...) Expand all
39 static scoped_ptr<MojoBootstrap> Create(ChannelHandle handle, 39 static scoped_ptr<MojoBootstrap> Create(ChannelHandle handle,
40 Channel::Mode mode, 40 Channel::Mode mode,
41 Delegate* delegate); 41 Delegate* delegate);
42 42
43 MojoBootstrap(); 43 MojoBootstrap();
44 ~MojoBootstrap() override; 44 ~MojoBootstrap() override;
45 45
46 // Start the handshake over the underlying platform channel. 46 // Start the handshake over the underlying platform channel.
47 bool Connect(); 47 bool Connect();
48 48
49 // Ask its own process ID to |channel_|.
agl 2015/02/25 02:45:29 This is wrong, but I'm not sure what it should be.
Hajime Morrita 2015/02/25 19:13:06 Done.
50 base::ProcessId GetSelfPID() const;
51
49 // Each client should call this once the process handle becomes known. 52 // Each client should call this once the process handle becomes known.
50 virtual void OnClientLaunched(base::ProcessHandle process) = 0; 53 virtual void OnClientLaunched(base::ProcessHandle process) = 0;
51 54
52 #if defined(OS_POSIX) && !defined(OS_NACL) 55 #if defined(OS_POSIX) && !defined(OS_NACL)
53 int GetClientFileDescriptor() const; 56 int GetClientFileDescriptor() const;
54 base::ScopedFD TakeClientFileDescriptor(); 57 base::ScopedFD TakeClientFileDescriptor();
55 #endif // defined(OS_POSIX) && !defined(OS_NACL) 58 #endif // defined(OS_POSIX) && !defined(OS_NACL)
56 59
57 protected: 60 protected:
58 // On MojoServerBootstrap: INITIALIZED -> WAITING_ACK -> READY 61 // On MojoServerBootstrap: INITIALIZED -> WAITING_ACK -> READY
(...skipping 19 matching lines...) Expand all
78 scoped_ptr<Channel> channel_; 81 scoped_ptr<Channel> channel_;
79 Delegate* delegate_; 82 Delegate* delegate_;
80 State state_; 83 State state_;
81 84
82 DISALLOW_COPY_AND_ASSIGN(MojoBootstrap); 85 DISALLOW_COPY_AND_ASSIGN(MojoBootstrap);
83 }; 86 };
84 87
85 } // namespace IPC 88 } // namespace IPC
86 89
87 #endif // IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_ 90 #endif // IPC_MOJO_IPC_MOJO_BOOTSTRAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698