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

Side by Side Diff: chrome/plugin/plugin_channel.cc

Issue 155174: linux: fix renderer/plugin crash when loading multiple pages with plugins (Closed)
Patch Set: Created 11 years, 5 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
« no previous file with comments | « chrome/common/ipc_channel_posix.cc ('k') | chrome/renderer/plugin_channel_host.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/process_util.h" 8 #include "base/process_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 30 matching lines...) Expand all
41 SendUnblockingOnlyDuringDispatch(); 41 SendUnblockingOnlyDuringDispatch();
42 ChildProcess::current()->AddRefProcess(); 42 ChildProcess::current()->AddRefProcess();
43 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 43 const CommandLine* command_line = CommandLine::ForCurrentProcess();
44 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); 44 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
45 } 45 }
46 46
47 PluginChannel::~PluginChannel() { 47 PluginChannel::~PluginChannel() {
48 if (renderer_handle_) 48 if (renderer_handle_)
49 base::CloseProcessHandle(renderer_handle_); 49 base::CloseProcessHandle(renderer_handle_);
50 #if defined(OS_POSIX) 50 #if defined(OS_POSIX)
51 // If we still have the FD, close it. 51 IPC::RemoveAndCloseChannelSocket(channel_name());
52 // If we still have the renderer FD, close it.
52 if (renderer_fd_ != -1) { 53 if (renderer_fd_ != -1) {
53 close(renderer_fd_); 54 close(renderer_fd_);
54 } 55 }
55 #endif 56 #endif
56 ChildProcess::current()->ReleaseProcess(); 57 ChildProcess::current()->ReleaseProcess();
57 } 58 }
58 59
59 bool PluginChannel::Send(IPC::Message* msg) { 60 bool PluginChannel::Send(IPC::Message* msg) {
60 in_send_++; 61 in_send_++;
61 if (log_messages_) { 62 if (log_messages_) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // This gets called when the PluginChannel is initially created. At this 155 // This gets called when the PluginChannel is initially created. At this
155 // point, create the socketpair and assign the plugin side FD to the channel 156 // point, create the socketpair and assign the plugin side FD to the channel
156 // name. Keep the renderer side FD as a member variable in the PluginChannel 157 // name. Keep the renderer side FD as a member variable in the PluginChannel
157 // to be able to transmit it through IPC. 158 // to be able to transmit it through IPC.
158 int plugin_fd; 159 int plugin_fd;
159 IPC::SocketPair(&plugin_fd, &renderer_fd_); 160 IPC::SocketPair(&plugin_fd, &renderer_fd_);
160 IPC::AddChannelSocket(channel_name(), plugin_fd); 161 IPC::AddChannelSocket(channel_name(), plugin_fd);
161 #endif 162 #endif
162 return PluginChannelBase::Init(ipc_message_loop, create_pipe_now); 163 return PluginChannelBase::Init(ipc_message_loop, create_pipe_now);
163 } 164 }
OLDNEW
« no previous file with comments | « chrome/common/ipc_channel_posix.cc ('k') | chrome/renderer/plugin_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698