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_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
14 #include "content/public/renderer/render_frame.h" | |
15 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
16 #include "third_party/WebKit/public/web/WebPlugin.h" | 15 #include "third_party/WebKit/public/web/WebPlugin.h" |
17 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
18 | 17 |
19 struct _NPP; | 18 struct _NPP; |
20 | 19 |
21 namespace blink { | 20 namespace blink { |
22 struct WebPluginParams; | 21 struct WebPluginParams; |
23 struct WebPrintParams; | 22 struct WebPrintParams; |
24 } | 23 } |
25 | 24 |
26 namespace content { | 25 namespace content { |
27 | 26 |
28 class PepperPluginInstanceImpl; | 27 class PepperPluginInstanceImpl; |
| 28 class PluginInstanceThrottlerImpl; |
29 class PluginModule; | 29 class PluginModule; |
30 class PPB_URLLoader_Impl; | 30 class PPB_URLLoader_Impl; |
31 class RenderFrameImpl; | 31 class RenderFrameImpl; |
32 | 32 |
33 class PepperWebPluginImpl : public blink::WebPlugin { | 33 class PepperWebPluginImpl : public blink::WebPlugin { |
34 public: | 34 public: |
35 PepperWebPluginImpl(PluginModule* module, | 35 PepperWebPluginImpl(PluginModule* module, |
36 const blink::WebPluginParams& params, | 36 const blink::WebPluginParams& params, |
37 RenderFrameImpl* render_frame, | 37 RenderFrameImpl* render_frame, |
38 RenderFrame::PluginPowerSaverMode power_saver_mode); | 38 scoped_ptr<PluginInstanceThrottlerImpl> throttler); |
39 | 39 |
40 PepperPluginInstanceImpl* instance() { return instance_.get(); } | 40 PepperPluginInstanceImpl* instance() { return instance_.get(); } |
41 | 41 |
42 // blink::WebPlugin implementation. | 42 // blink::WebPlugin implementation. |
43 virtual blink::WebPluginContainer* container() const; | 43 virtual blink::WebPluginContainer* container() const; |
44 virtual bool initialize(blink::WebPluginContainer* container); | 44 virtual bool initialize(blink::WebPluginContainer* container); |
45 virtual void destroy(); | 45 virtual void destroy(); |
46 virtual v8::Local<v8::Object> v8ScriptableObject( | 46 virtual v8::Local<v8::Object> v8ScriptableObject( |
47 v8::Isolate* isolate) override; | 47 v8::Isolate* isolate) override; |
48 virtual bool getFormValue(blink::WebString& value); | 48 virtual bool getFormValue(blink::WebString& value); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 private: | 92 private: |
93 friend class base::DeleteHelper<PepperWebPluginImpl>; | 93 friend class base::DeleteHelper<PepperWebPluginImpl>; |
94 | 94 |
95 virtual ~PepperWebPluginImpl(); | 95 virtual ~PepperWebPluginImpl(); |
96 struct InitData; | 96 struct InitData; |
97 | 97 |
98 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. | 98 scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. |
99 // True if the instance represents the entire document in a frame instead of | 99 // True if the instance represents the entire document in a frame instead of |
100 // being an embedded resource. | 100 // being an embedded resource. |
101 bool full_frame_; | 101 bool full_frame_; |
102 RenderFrame::PluginPowerSaverMode power_saver_mode_; | 102 scoped_ptr<PluginInstanceThrottlerImpl> throttler_; |
103 scoped_refptr<PepperPluginInstanceImpl> instance_; | 103 scoped_refptr<PepperPluginInstanceImpl> instance_; |
104 gfx::Rect plugin_rect_; | 104 gfx::Rect plugin_rect_; |
105 PP_Var instance_object_; | 105 PP_Var instance_object_; |
106 blink::WebPluginContainer* container_; | 106 blink::WebPluginContainer* container_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl); | 108 DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl); |
109 }; | 109 }; |
110 | 110 |
111 } // namespace content | 111 } // namespace content |
112 | 112 |
113 #endif // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ | 113 #endif // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ |
OLD | NEW |