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

Side by Side Diff: chrome/nacl/nacl_listener.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/renderer/mock_printer.cc » ('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 (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 #include "chrome/nacl/nacl_listener.h" 5 #include "chrome/nacl/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } else { 165 } else {
166 // This thread does not own the channel. 166 // This thread does not own the channel.
167 return filter_->Send(msg); 167 return filter_->Send(msg);
168 } 168 }
169 } 169 }
170 170
171 void NaClListener::Listen() { 171 void NaClListener::Listen() {
172 std::string channel_name = 172 std::string channel_name =
173 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 173 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
174 switches::kProcessChannelID); 174 switches::kProcessChannelID);
175 channel_.reset(new IPC::SyncChannel(this, io_thread_.message_loop_proxy(), 175 channel_.reset(
176 &shutdown_event_)); 176 new IPC::SyncChannel(this, io_thread_.message_loop_proxy().get(),
177 &shutdown_event_));
177 filter_ = new IPC::SyncMessageFilter(&shutdown_event_); 178 filter_ = new IPC::SyncMessageFilter(&shutdown_event_);
178 channel_->AddFilter(filter_.get()); 179 channel_->AddFilter(filter_.get());
179 channel_->Init(channel_name, IPC::Channel::MODE_CLIENT, true); 180 channel_->Init(channel_name, IPC::Channel::MODE_CLIENT, true);
180 main_loop_ = MessageLoop::current(); 181 main_loop_ = MessageLoop::current();
181 main_loop_->Run(); 182 main_loop_->Run();
182 } 183 }
183 184
184 bool NaClListener::OnMessageReceived(const IPC::Message& msg) { 185 bool NaClListener::OnMessageReceived(const IPC::Message& msg) {
185 bool handled = true; 186 bool handled = true;
186 IPC_BEGIN_MESSAGE_MAP(NaClListener, msg) 187 IPC_BEGIN_MESSAGE_MAP(NaClListener, msg)
(...skipping 10 matching lines...) Expand all
197 return; 198 return;
198 } 199 }
199 200
200 if (params.enable_ipc_proxy) { 201 if (params.enable_ipc_proxy) {
201 // Create the initial PPAPI IPC channel between the NaCl IRT and the 202 // Create the initial PPAPI IPC channel between the NaCl IRT and the
202 // browser process. The IRT uses this channel to communicate with the 203 // browser process. The IRT uses this channel to communicate with the
203 // browser and to create additional IPC channels to renderer processes. 204 // browser and to create additional IPC channels to renderer processes.
204 IPC::ChannelHandle handle = 205 IPC::ChannelHandle handle =
205 IPC::Channel::GenerateVerifiedChannelID("nacl"); 206 IPC::Channel::GenerateVerifiedChannelID("nacl");
206 scoped_refptr<NaClIPCAdapter> ipc_adapter( 207 scoped_refptr<NaClIPCAdapter> ipc_adapter(
207 new NaClIPCAdapter(handle, io_thread_.message_loop_proxy())); 208 new NaClIPCAdapter(handle, io_thread_.message_loop_proxy().get()));
208 // Pass a NaClDesc to the untrusted side. This will hold a ref to the 209 // Pass a NaClDesc to the untrusted side. This will hold a ref to the
209 // NaClIPCAdapter. 210 // NaClIPCAdapter.
210 args->initial_ipc_desc = ipc_adapter->MakeNaClDesc(); 211 args->initial_ipc_desc = ipc_adapter->MakeNaClDesc();
211 #if defined(OS_POSIX) 212 #if defined(OS_POSIX)
212 handle.socket = base::FileDescriptor( 213 handle.socket = base::FileDescriptor(
213 ipc_adapter->TakeClientFileDescriptor(), true); 214 ipc_adapter->TakeClientFileDescriptor(), true);
214 #endif 215 #endif
215 if (!Send(new NaClProcessHostMsg_PpapiChannelCreated(handle))) 216 if (!Send(new NaClProcessHostMsg_PpapiChannelCreated(handle)))
216 LOG(ERROR) << "Failed to send IPC channel handle to NaClProcessHost."; 217 LOG(ERROR) << "Failed to send IPC channel handle to NaClProcessHost.";
217 } 218 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 #if defined(OS_WIN) 268 #if defined(OS_WIN)
268 args->broker_duplicate_handle_func = BrokerDuplicateHandle; 269 args->broker_duplicate_handle_func = BrokerDuplicateHandle;
269 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; 270 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler;
270 #endif 271 #endif
271 #if defined(OS_LINUX) 272 #if defined(OS_LINUX)
272 args->prereserved_sandbox_size = prereserved_sandbox_size_; 273 args->prereserved_sandbox_size = prereserved_sandbox_size_;
273 #endif 274 #endif
274 NaClChromeMainStart(args); 275 NaClChromeMainStart(args);
275 NOTREACHED(); 276 NOTREACHED();
276 } 277 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/renderer/mock_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698