OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_thread.h" | 5 #include "chrome/plugin/plugin_thread.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (webkit_glue::ShouldForcefullyTerminatePluginProcess()) | 121 if (webkit_glue::ShouldForcefullyTerminatePluginProcess()) |
122 base::KillProcess(base::GetCurrentProcessHandle(), 0, /* wait= */ false); | 122 base::KillProcess(base::GetCurrentProcessHandle(), 0, /* wait= */ false); |
123 | 123 |
124 lazy_tls.Pointer()->Set(NULL); | 124 lazy_tls.Pointer()->Set(NULL); |
125 } | 125 } |
126 | 126 |
127 PluginThread* PluginThread::current() { | 127 PluginThread* PluginThread::current() { |
128 return lazy_tls.Pointer()->Get(); | 128 return lazy_tls.Pointer()->Get(); |
129 } | 129 } |
130 | 130 |
131 void PluginThread::OnControlMessageReceived(const IPC::Message& msg) { | 131 bool PluginThread::OnControlMessageReceived(const IPC::Message& msg) { |
| 132 bool handled = true; |
132 IPC_BEGIN_MESSAGE_MAP(PluginThread, msg) | 133 IPC_BEGIN_MESSAGE_MAP(PluginThread, msg) |
133 IPC_MESSAGE_HANDLER(PluginProcessMsg_CreateChannel, OnCreateChannel) | 134 IPC_MESSAGE_HANDLER(PluginProcessMsg_CreateChannel, OnCreateChannel) |
134 IPC_MESSAGE_HANDLER(PluginProcessMsg_PluginMessage, OnPluginMessage) | 135 IPC_MESSAGE_HANDLER(PluginProcessMsg_PluginMessage, OnPluginMessage) |
135 IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown, | 136 IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown, |
136 OnNotifyRenderersOfPendingShutdown) | 137 OnNotifyRenderersOfPendingShutdown) |
| 138 IPC_MESSAGE_UNHANDLED(handled = false) |
137 IPC_END_MESSAGE_MAP() | 139 IPC_END_MESSAGE_MAP() |
| 140 return handled; |
138 } | 141 } |
139 | 142 |
140 void PluginThread::OnCreateChannel(int renderer_id, | 143 void PluginThread::OnCreateChannel(int renderer_id, |
141 bool off_the_record) { | 144 bool off_the_record) { |
142 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( | 145 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( |
143 renderer_id, ChildProcess::current()->io_message_loop())); | 146 renderer_id, ChildProcess::current()->io_message_loop())); |
144 IPC::ChannelHandle channel_handle; | 147 IPC::ChannelHandle channel_handle; |
145 if (channel.get()) { | 148 if (channel.get()) { |
146 channel_handle.name = channel->channel_handle().name; | 149 channel_handle.name = channel->channel_handle().name; |
147 #if defined(OS_POSIX) | 150 #if defined(OS_POSIX) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 228 } |
226 | 229 |
227 if (!result || net_error != net::OK) | 230 if (!result || net_error != net::OK) |
228 return false; | 231 return false; |
229 | 232 |
230 *proxy_list = proxy_result; | 233 *proxy_list = proxy_result; |
231 return true; | 234 return true; |
232 } | 235 } |
233 | 236 |
234 } // namespace webkit_glue | 237 } // namespace webkit_glue |
OLD | NEW |