| OLD | NEW |
| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <objbase.h> | 6 #include <objbase.h> |
| 7 | 7 |
| 8 #include "chrome/plugin/plugin_thread.h" | 8 #include "chrome/plugin/plugin_thread.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if (plugin.get()) { | 62 if (plugin.get()) { |
| 63 plugin->NP_Initialize(); | 63 plugin->NP_Initialize(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Certain plugins, such as flash, steal the unhandled exception filter | 66 // Certain plugins, such as flash, steal the unhandled exception filter |
| 67 // thus we never get crash reports when they fault. This call fixes it. | 67 // thus we never get crash reports when they fault. This call fixes it. |
| 68 message_loop()->set_exception_restoration(true); | 68 message_loop()->set_exception_restoration(true); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void PluginThread::CleanUp() { | 71 void PluginThread::CleanUp() { |
| 72 ChildThread::CleanUp(); | |
| 73 if (preloaded_plugin_module_) { | 72 if (preloaded_plugin_module_) { |
| 74 FreeLibrary(preloaded_plugin_module_); | 73 FreeLibrary(preloaded_plugin_module_); |
| 75 preloaded_plugin_module_ = NULL; | 74 preloaded_plugin_module_ = NULL; |
| 76 } | 75 } |
| 77 PluginChannelBase::CleanupChannels(); | 76 PluginChannelBase::CleanupChannels(); |
| 78 NPAPI::PluginLib::UnloadAllPlugins(); | 77 NPAPI::PluginLib::UnloadAllPlugins(); |
| 79 ChromePluginLib::UnloadAllPlugins(); | 78 ChromePluginLib::UnloadAllPlugins(); |
| 80 notification_service_.reset(); | 79 notification_service_.reset(); |
| 81 CoUninitialize(); | 80 CoUninitialize(); |
| 82 | 81 |
| 83 if (webkit_glue::ShouldForcefullyTerminatePluginProcess()) | 82 if (webkit_glue::ShouldForcefullyTerminatePluginProcess()) |
| 84 TerminateProcess(GetCurrentProcess(), 0); | 83 TerminateProcess(GetCurrentProcess(), 0); |
| 84 |
| 85 // Call this last because it deletes the ResourceDispatcher, which is used |
| 86 // in some of the above cleanup. |
| 87 // See http://code.google.com/p/chromium/issues/detail?id=8980 |
| 88 ChildThread::CleanUp(); |
| 85 } | 89 } |
| 86 | 90 |
| 87 void PluginThread::OnCreateChannel() { | 91 void PluginThread::OnCreateChannel() { |
| 88 std::wstring channel_name; | 92 std::wstring channel_name; |
| 89 scoped_refptr<PluginChannel> channel = | 93 scoped_refptr<PluginChannel> channel = |
| 90 PluginChannel::GetPluginChannel(owner_loop()); | 94 PluginChannel::GetPluginChannel(owner_loop()); |
| 91 if (channel.get()) | 95 if (channel.get()) |
| 92 channel_name = channel->channel_name(); | 96 channel_name = channel->channel_name(); |
| 93 | 97 |
| 94 Send(new PluginProcessHostMsg_ChannelCreated(channel_name)); | 98 Send(new PluginProcessHostMsg_ChannelCreated(channel_name)); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 172 } |
| 169 | 173 |
| 170 if (!result || net_error != net::OK) | 174 if (!result || net_error != net::OK) |
| 171 return false; | 175 return false; |
| 172 | 176 |
| 173 *proxy_list = proxy_result; | 177 *proxy_list = proxy_result; |
| 174 return true; | 178 return true; |
| 175 } | 179 } |
| 176 | 180 |
| 177 } // namespace webkit_glue | 181 } // namespace webkit_glue |
| OLD | NEW |