| 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 #ifndef CONTENT_PLUGIN_PLUGIN_THREAD_H_ | 5 #ifndef CONTENT_PLUGIN_PLUGIN_THREAD_H_ |
| 6 #define CONTENT_PLUGIN_PLUGIN_THREAD_H_ | 6 #define CONTENT_PLUGIN_PLUGIN_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "content/child/child_thread.h" | 11 #include "content/child/child_thread.h" |
| 12 #include "content/child/npapi/plugin_lib.h" | 12 #include "content/child/npapi/plugin_lib.h" |
| 13 #include "content/plugin/plugin_channel.h" | 13 #include "content/plugin/plugin_channel.h" |
| 14 | 14 |
| 15 #if defined(OS_POSIX) | 15 #if defined(OS_POSIX) |
| 16 #include "base/file_descriptor_posix.h" | 16 #include "base/file_descriptor_posix.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BlinkPlatformImpl; | 20 class BlinkPlatformImpl; |
| 21 | 21 |
| 22 // The PluginThread class represents a background thread where plugin instances | 22 // The PluginThread class represents a background thread where plugin instances |
| 23 // live. Communication occurs between WebPluginDelegateProxy in the renderer | 23 // live. Communication occurs between WebPluginDelegateProxy in the renderer |
| 24 // process and WebPluginDelegateStub in this thread through IPC messages. | 24 // process and WebPluginDelegateStub in this thread through IPC messages. |
| 25 class PluginThread : public ChildThread { | 25 class PluginThread : public ChildThread { |
| 26 public: | 26 public: |
| 27 PluginThread(); | 27 PluginThread(); |
| 28 virtual ~PluginThread(); | 28 virtual ~PluginThread(); |
| 29 virtual void Shutdown() OVERRIDE; | 29 virtual void Shutdown() override; |
| 30 | 30 |
| 31 // Returns the one plugin thread. | 31 // Returns the one plugin thread. |
| 32 static PluginThread* current(); | 32 static PluginThread* current(); |
| 33 | 33 |
| 34 // Tells the plugin thread to terminate the process forcefully instead of | 34 // Tells the plugin thread to terminate the process forcefully instead of |
| 35 // exiting cleanly. | 35 // exiting cleanly. |
| 36 void SetForcefullyTerminatePluginProcess(); | 36 void SetForcefullyTerminatePluginProcess(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 39 virtual bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 40 | 40 |
| 41 // Callback for when a channel has been created. | 41 // Callback for when a channel has been created. |
| 42 void OnCreateChannel(int renderer_id, bool incognito); | 42 void OnCreateChannel(int renderer_id, bool incognito); |
| 43 void OnPluginMessage(const std::vector<uint8> &data); | 43 void OnPluginMessage(const std::vector<uint8> &data); |
| 44 void OnNotifyRenderersOfPendingShutdown(); | 44 void OnNotifyRenderersOfPendingShutdown(); |
| 45 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 46 void OnAppActivated(); | 46 void OnAppActivated(); |
| 47 void OnPluginFocusNotify(uint32 instance_id); | 47 void OnPluginFocusNotify(uint32 instance_id); |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 // The plugin module which is preloaded in Init | 50 // The plugin module which is preloaded in Init |
| 51 base::NativeLibrary preloaded_plugin_module_; | 51 base::NativeLibrary preloaded_plugin_module_; |
| 52 | 52 |
| 53 bool forcefully_terminate_plugin_process_; | 53 bool forcefully_terminate_plugin_process_; |
| 54 | 54 |
| 55 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_; | 55 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(PluginThread); | 57 DISALLOW_COPY_AND_ASSIGN(PluginThread); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace content | 60 } // namespace content |
| 61 | 61 |
| 62 #endif // CONTENT_PLUGIN_PLUGIN_THREAD_H_ | 62 #endif // CONTENT_PLUGIN_PLUGIN_THREAD_H_ |
| OLD | NEW |