| OLD | NEW |
| 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 "content/plugin/plugin_thread.h" | 5 #include "content/plugin/plugin_thread.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(TOOLKIT_GTK) | 9 #if defined(TOOLKIT_GTK) |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 32 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 33 | 33 |
| 34 #if defined(TOOLKIT_GTK) | 34 #if defined(TOOLKIT_GTK) |
| 35 #include "ui/gfx/gtk_util.h" | 35 #include "ui/gfx/gtk_util.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(USE_X11) | 38 #if defined(USE_X11) |
| 39 #include "ui/base/x/x11_util.h" | 39 #include "ui/base/x/x11_util.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 namespace content { |
| 43 |
| 42 namespace { | 44 namespace { |
| 43 | 45 |
| 44 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { | 46 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { |
| 45 public: | 47 public: |
| 46 EnsureTerminateMessageFilter() {} | 48 EnsureTerminateMessageFilter() {} |
| 47 | 49 |
| 48 protected: | 50 protected: |
| 49 virtual ~EnsureTerminateMessageFilter() {} | 51 virtual ~EnsureTerminateMessageFilter() {} |
| 50 | 52 |
| 51 // IPC::ChannelProxy::MessageFilter: | 53 // IPC::ChannelProxy::MessageFilter: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 116 |
| 115 scoped_refptr<webkit::npapi::PluginLib> plugin( | 117 scoped_refptr<webkit::npapi::PluginLib> plugin( |
| 116 webkit::npapi::PluginLib::CreatePluginLib(plugin_path)); | 118 webkit::npapi::PluginLib::CreatePluginLib(plugin_path)); |
| 117 if (plugin.get()) { | 119 if (plugin.get()) { |
| 118 plugin->NP_Initialize(); | 120 plugin->NP_Initialize(); |
| 119 // For OOP plugins the plugin dll will be unloaded during process shutdown | 121 // For OOP plugins the plugin dll will be unloaded during process shutdown |
| 120 // time. | 122 // time. |
| 121 plugin->set_defer_unload(true); | 123 plugin->set_defer_unload(true); |
| 122 } | 124 } |
| 123 | 125 |
| 124 content::GetContentClient()->plugin()->PluginProcessStarted( | 126 GetContentClient()->plugin()->PluginProcessStarted( |
| 125 plugin.get() ? plugin->plugin_info().name : string16()); | 127 plugin.get() ? plugin->plugin_info().name : string16()); |
| 126 | 128 |
| 127 content::GetContentClient()->AddNPAPIPlugins( | 129 GetContentClient()->AddNPAPIPlugins( |
| 128 webkit::npapi::PluginList::Singleton()); | 130 webkit::npapi::PluginList::Singleton()); |
| 129 | 131 |
| 130 // Certain plugins, such as flash, steal the unhandled exception filter | 132 // Certain plugins, such as flash, steal the unhandled exception filter |
| 131 // thus we never get crash reports when they fault. This call fixes it. | 133 // thus we never get crash reports when they fault. This call fixes it. |
| 132 message_loop()->set_exception_restoration(true); | 134 message_loop()->set_exception_restoration(true); |
| 133 channel()->AddFilter(new EnsureTerminateMessageFilter()); | 135 channel()->AddFilter(new EnsureTerminateMessageFilter()); |
| 134 } | 136 } |
| 135 | 137 |
| 136 PluginThread::~PluginThread() { | 138 PluginThread::~PluginThread() { |
| 137 if (preloaded_plugin_module_) { | 139 if (preloaded_plugin_module_) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 #endif | 178 #endif |
| 177 channel->set_incognito(incognito); | 179 channel->set_incognito(incognito); |
| 178 } | 180 } |
| 179 | 181 |
| 180 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 182 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
| 181 } | 183 } |
| 182 | 184 |
| 183 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 185 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
| 184 PluginChannel::NotifyRenderersOfPendingShutdown(); | 186 PluginChannel::NotifyRenderersOfPendingShutdown(); |
| 185 } | 187 } |
| 188 |
| 189 } // namespace content |
| OLD | NEW |