| 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(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls = | 66 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls = |
| 67 LAZY_INSTANCE_INITIALIZER; | 67 LAZY_INSTANCE_INITIALIZER; |
| 68 | 68 |
| 69 PluginThread::PluginThread() | 69 PluginThread::PluginThread() |
| 70 : preloaded_plugin_module_(NULL), | 70 : preloaded_plugin_module_(NULL), |
| 71 forcefully_terminate_plugin_process_(false) { | 71 forcefully_terminate_plugin_process_(false) { |
| 72 base::FilePath plugin_path = | 72 base::FilePath plugin_path = |
| 73 CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 73 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 74 switches::kPluginPath); | 74 switches::kPluginPath); |
| 75 | 75 |
| 76 lazy_tls.Pointer()->Set(this); | 76 lazy_tls.Pointer()->Set(this); |
| 77 | 77 |
| 78 PatchNPNFunctions(); | 78 PatchNPNFunctions(); |
| 79 | 79 |
| 80 // Preload the library to avoid loading, unloading then reloading | 80 // Preload the library to avoid loading, unloading then reloading |
| 81 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path, NULL); | 81 preloaded_plugin_module_ = base::LoadNativeLibrary(plugin_path, NULL); |
| 82 | 82 |
| 83 scoped_refptr<PluginLib> plugin(PluginLib::CreatePluginLib(plugin_path)); | 83 scoped_refptr<PluginLib> plugin(PluginLib::CreatePluginLib(plugin_path)); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 154 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 157 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
| 158 PluginChannel::NotifyRenderersOfPendingShutdown(); | 158 PluginChannel::NotifyRenderersOfPendingShutdown(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace content | 161 } // namespace content |
| OLD | NEW |