| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "mojo/system/platform_channel.h" | 5 #include "mojo/system/platform_channel.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 *handle = PlatformChannelHandle(); | 25 *handle = PlatformChannelHandle(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 class PlatformServerChannelPosix : public PlatformServerChannel { | 28 class PlatformServerChannelPosix : public PlatformServerChannel { |
| 29 public: | 29 public: |
| 30 PlatformServerChannelPosix(const std::string& name); | 30 PlatformServerChannelPosix(const std::string& name); |
| 31 virtual ~PlatformServerChannelPosix(); | 31 virtual ~PlatformServerChannelPosix(); |
| 32 | 32 |
| 33 // |PlatformServerChannel| implementation: | 33 // |PlatformServerChannel| implementation: |
| 34 virtual scoped_ptr<PlatformClientChannel> CreateClientChannel() OVERRIDE; | 34 virtual scoped_ptr<PlatformClientChannel> CreateClientChannel() OVERRIDE; |
| 35 virtual void PrepareToPassClientChannelToChildProcess( | 35 virtual void GetDataNeededToPassClientChannelToChildProcess( |
| 36 CommandLine* command_line, | 36 CommandLine* command_line, |
| 37 base::FileHandleMappingVector* file_handle_mapping) OVERRIDE; | 37 base::FileHandleMappingVector* file_handle_mapping) const OVERRIDE; |
| 38 virtual void ChildProcessLaunched() OVERRIDE; | 38 virtual void ChildProcessLaunched() OVERRIDE; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 PlatformChannelHandle client_handle_; | 41 PlatformChannelHandle client_handle_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(PlatformServerChannelPosix); | 43 DISALLOW_COPY_AND_ASSIGN(PlatformServerChannelPosix); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 PlatformServerChannelPosix::PlatformServerChannelPosix( | 46 PlatformServerChannelPosix::PlatformServerChannelPosix( |
| 47 const std::string& name) | 47 const std::string& name) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 72 return scoped_ptr<PlatformClientChannel>(); | 72 return scoped_ptr<PlatformClientChannel>(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 scoped_ptr<PlatformClientChannel> rv = | 75 scoped_ptr<PlatformClientChannel> rv = |
| 76 PlatformClientChannel::CreateFromHandle(client_handle_); | 76 PlatformClientChannel::CreateFromHandle(client_handle_); |
| 77 DCHECK(rv->is_valid()); | 77 DCHECK(rv->is_valid()); |
| 78 client_handle_ = PlatformChannelHandle(); | 78 client_handle_ = PlatformChannelHandle(); |
| 79 return rv.Pass(); | 79 return rv.Pass(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void PlatformServerChannelPosix::PrepareToPassClientChannelToChildProcess( | 82 void PlatformServerChannelPosix::GetDataNeededToPassClientChannelToChildProcess( |
| 83 CommandLine* command_line, | 83 CommandLine* command_line, |
| 84 base::FileHandleMappingVector* file_handle_mapping) { | 84 base::FileHandleMappingVector* file_handle_mapping) const { |
| 85 // TODO(vtl) | 85 // TODO(vtl) |
| 86 NOTIMPLEMENTED(); | 86 NOTIMPLEMENTED(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void PlatformServerChannelPosix::ChildProcessLaunched() { | 89 void PlatformServerChannelPosix::ChildProcessLaunched() { |
| 90 // TODO(vtl) | 90 // TODO(vtl) |
| 91 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| (...skipping 15 matching lines...) Expand all Loading... |
| 110 scoped_ptr<PlatformClientChannel> | 110 scoped_ptr<PlatformClientChannel> |
| 111 PlatformClientChannel::CreateFromParentProcess( | 111 PlatformClientChannel::CreateFromParentProcess( |
| 112 const CommandLine& command_line) { | 112 const CommandLine& command_line) { |
| 113 // TODO(vtl) | 113 // TODO(vtl) |
| 114 NOTIMPLEMENTED(); | 114 NOTIMPLEMENTED(); |
| 115 return scoped_ptr<PlatformClientChannel>(); | 115 return scoped_ptr<PlatformClientChannel>(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace system | 118 } // namespace system |
| 119 } // namespace mojo | 119 } // namespace mojo |
| OLD | NEW |