[content shell] hook up testRunner.dumpEditingCallbacks
[chromium-blink-merge.git] / content / plugin / plugin_thread.h
bloba8750aa69823c16fc04ce784bf7281bd6262c573
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PLUGIN_PLUGIN_THREAD_H_
6 #define CONTENT_PLUGIN_PLUGIN_THREAD_H_
8 #include "base/file_path.h"
9 #include "base/native_library.h"
10 #include "build/build_config.h"
11 #include "content/common/child_thread.h"
12 #include "content/plugin/plugin_channel.h"
13 #include "webkit/plugins/npapi/plugin_lib.h"
15 #if defined(OS_POSIX)
16 #include "base/file_descriptor_posix.h"
17 #endif
19 namespace content {
21 // The PluginThread class represents a background thread where plugin instances
22 // live. Communication occurs between WebPluginDelegateProxy in the renderer
23 // process and WebPluginDelegateStub in this thread through IPC messages.
24 class PluginThread : public ChildThread {
25 public:
26 PluginThread();
27 virtual ~PluginThread();
29 // Returns the one plugin thread.
30 static PluginThread* current();
32 private:
33 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
35 // Callback for when a channel has been created.
36 void OnCreateChannel(int renderer_id, bool incognito);
37 void OnPluginMessage(const std::vector<uint8> &data);
38 void OnNotifyRenderersOfPendingShutdown();
39 #if defined(OS_MACOSX)
40 void OnAppActivated();
41 void OnPluginFocusNotify(uint32 instance_id);
42 #endif
44 // The plugin module which is preloaded in Init
45 base::NativeLibrary preloaded_plugin_module_;
47 DISALLOW_COPY_AND_ASSIGN(PluginThread);
50 } // namespace content
52 #endif // CONTENT_PLUGIN_PLUGIN_THREAD_H_