| 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/file_path.h" | 8 #include "base/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/common/child_thread.h" | 11 #include "content/common/child_thread.h" |
| 12 #include "content/plugin/plugin_channel.h" | 12 #include "content/plugin/plugin_channel.h" |
| 13 #include "webkit/plugins/npapi/plugin_lib.h" | 13 #include "webkit/plugins/npapi/plugin_lib.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 { |
| 20 |
| 19 // The PluginThread class represents a background thread where plugin instances | 21 // The PluginThread class represents a background thread where plugin instances |
| 20 // live. Communication occurs between WebPluginDelegateProxy in the renderer | 22 // live. Communication occurs between WebPluginDelegateProxy in the renderer |
| 21 // process and WebPluginDelegateStub in this thread through IPC messages. | 23 // process and WebPluginDelegateStub in this thread through IPC messages. |
| 22 class PluginThread : public ChildThread { | 24 class PluginThread : public ChildThread { |
| 23 public: | 25 public: |
| 24 PluginThread(); | 26 PluginThread(); |
| 25 virtual ~PluginThread(); | 27 virtual ~PluginThread(); |
| 26 | 28 |
| 27 // Returns the one plugin thread. | 29 // Returns the one plugin thread. |
| 28 static PluginThread* current(); | 30 static PluginThread* current(); |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 33 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 32 | 34 |
| 33 // Callback for when a channel has been created. | 35 // Callback for when a channel has been created. |
| 34 void OnCreateChannel(int renderer_id, bool incognito); | 36 void OnCreateChannel(int renderer_id, bool incognito); |
| 35 void OnPluginMessage(const std::vector<uint8> &data); | 37 void OnPluginMessage(const std::vector<uint8> &data); |
| 36 void OnNotifyRenderersOfPendingShutdown(); | 38 void OnNotifyRenderersOfPendingShutdown(); |
| 37 #if defined(OS_MACOSX) | 39 #if defined(OS_MACOSX) |
| 38 void OnAppActivated(); | 40 void OnAppActivated(); |
| 39 void OnPluginFocusNotify(uint32 instance_id); | 41 void OnPluginFocusNotify(uint32 instance_id); |
| 40 #endif | 42 #endif |
| 41 | 43 |
| 42 // The plugin module which is preloaded in Init | 44 // The plugin module which is preloaded in Init |
| 43 base::NativeLibrary preloaded_plugin_module_; | 45 base::NativeLibrary preloaded_plugin_module_; |
| 44 | 46 |
| 45 DISALLOW_COPY_AND_ASSIGN(PluginThread); | 47 DISALLOW_COPY_AND_ASSIGN(PluginThread); |
| 46 }; | 48 }; |
| 47 | 49 |
| 50 } // namespace content |
| 51 |
| 48 #endif // CONTENT_PLUGIN_PLUGIN_THREAD_H_ | 52 #endif // CONTENT_PLUGIN_PLUGIN_THREAD_H_ |
| OLD | NEW |