OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/plugin/plugin_channel.h" | 5 #include "chrome/plugin/plugin_channel.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lock.h" | 8 #include "base/lock.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 PluginChannel::PluginChannel() | 155 PluginChannel::PluginChannel() |
156 : renderer_handle_(0), | 156 : renderer_handle_(0), |
157 renderer_id_(-1), | 157 renderer_id_(-1), |
158 #if defined(OS_POSIX) | 158 #if defined(OS_POSIX) |
159 renderer_fd_(-1), | 159 renderer_fd_(-1), |
160 #endif | 160 #endif |
161 in_send_(0), | 161 in_send_(0), |
162 off_the_record_(false), | 162 off_the_record_(false), |
163 filter_(new MessageFilter()) { | 163 filter_(new MessageFilter()) { |
164 SendUnblockingOnlyDuringDispatch(); | 164 SendUnblockingOnlyDuringSyncDispatch(); |
165 ChildProcess::current()->AddRefProcess(); | 165 ChildProcess::current()->AddRefProcess(); |
166 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 166 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
167 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 167 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
168 } | 168 } |
169 | 169 |
170 PluginChannel::~PluginChannel() { | 170 PluginChannel::~PluginChannel() { |
171 if (renderer_handle_) | 171 if (renderer_handle_) |
172 base::CloseProcessHandle(renderer_handle_); | 172 base::CloseProcessHandle(renderer_handle_); |
173 #if defined(OS_POSIX) | 173 #if defined(OS_POSIX) |
174 // If we still have the renderer FD, close it. | 174 // If we still have the renderer FD, close it. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 int plugin_fd; | 296 int plugin_fd; |
297 IPC::SocketPair(&plugin_fd, &renderer_fd_); | 297 IPC::SocketPair(&plugin_fd, &renderer_fd_); |
298 IPC::AddChannelSocket(channel_name(), plugin_fd); | 298 IPC::AddChannelSocket(channel_name(), plugin_fd); |
299 #endif | 299 #endif |
300 if (!PluginChannelBase::Init(ipc_message_loop, create_pipe_now)) | 300 if (!PluginChannelBase::Init(ipc_message_loop, create_pipe_now)) |
301 return false; | 301 return false; |
302 | 302 |
303 channel_->AddFilter(filter_.get()); | 303 channel_->AddFilter(filter_.get()); |
304 return true; | 304 return true; |
305 } | 305 } |
OLD | NEW |