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/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #include "printing/metafile_skia_wrapper.h" | 94 #include "printing/metafile_skia_wrapper.h" |
95 #include "printing/pdf_metafile_skia.h" | 95 #include "printing/pdf_metafile_skia.h" |
96 #include "skia/ext/platform_canvas.h" | 96 #include "skia/ext/platform_canvas.h" |
97 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 97 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
98 #include "third_party/WebKit/public/platform/WebGamepads.h" | 98 #include "third_party/WebKit/public/platform/WebGamepads.h" |
99 #include "third_party/WebKit/public/platform/WebRect.h" | 99 #include "third_party/WebKit/public/platform/WebRect.h" |
100 #include "third_party/WebKit/public/platform/WebString.h" | 100 #include "third_party/WebKit/public/platform/WebString.h" |
101 #include "third_party/WebKit/public/platform/WebURL.h" | 101 #include "third_party/WebKit/public/platform/WebURL.h" |
102 #include "third_party/WebKit/public/platform/WebURLError.h" | 102 #include "third_party/WebKit/public/platform/WebURLError.h" |
103 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 103 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
104 #include "third_party/WebKit/public/web/WebBindings.h" | |
105 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 104 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
106 #include "third_party/WebKit/public/web/WebDataSource.h" | 105 #include "third_party/WebKit/public/web/WebDataSource.h" |
107 #include "third_party/WebKit/public/web/WebDocument.h" | 106 #include "third_party/WebKit/public/web/WebDocument.h" |
108 #include "third_party/WebKit/public/web/WebInputEvent.h" | 107 #include "third_party/WebKit/public/web/WebInputEvent.h" |
109 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 108 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
110 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 109 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
111 #include "third_party/WebKit/public/web/WebPluginScriptForbiddenScope.h" | 110 #include "third_party/WebKit/public/web/WebPluginScriptForbiddenScope.h" |
112 #include "third_party/WebKit/public/web/WebPrintParams.h" | 111 #include "third_party/WebKit/public/web/WebPrintParams.h" |
113 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" | 112 #include "third_party/WebKit/public/web/WebPrintPresetOptions.h" |
114 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 113 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
(...skipping 26 matching lines...) Expand all Loading... |
141 using ppapi::TrackedCallback; | 140 using ppapi::TrackedCallback; |
142 using ppapi::thunk::EnterResourceNoLock; | 141 using ppapi::thunk::EnterResourceNoLock; |
143 using ppapi::thunk::PPB_Buffer_API; | 142 using ppapi::thunk::PPB_Buffer_API; |
144 using ppapi::thunk::PPB_Gamepad_API; | 143 using ppapi::thunk::PPB_Gamepad_API; |
145 using ppapi::thunk::PPB_Graphics2D_API; | 144 using ppapi::thunk::PPB_Graphics2D_API; |
146 using ppapi::thunk::PPB_Graphics3D_API; | 145 using ppapi::thunk::PPB_Graphics3D_API; |
147 using ppapi::thunk::PPB_ImageData_API; | 146 using ppapi::thunk::PPB_ImageData_API; |
148 using ppapi::Var; | 147 using ppapi::Var; |
149 using ppapi::ArrayBufferVar; | 148 using ppapi::ArrayBufferVar; |
150 using ppapi::ViewData; | 149 using ppapi::ViewData; |
151 using blink::WebBindings; | |
152 using blink::WebCanvas; | 150 using blink::WebCanvas; |
153 using blink::WebCursorInfo; | 151 using blink::WebCursorInfo; |
154 using blink::WebDocument; | 152 using blink::WebDocument; |
155 using blink::WebElement; | 153 using blink::WebElement; |
156 using blink::WebFrame; | 154 using blink::WebFrame; |
157 using blink::WebInputEvent; | 155 using blink::WebInputEvent; |
158 using blink::WebLocalFrame; | 156 using blink::WebLocalFrame; |
159 using blink::WebPlugin; | 157 using blink::WebPlugin; |
160 using blink::WebPluginContainer; | 158 using blink::WebPluginContainer; |
161 using blink::WebPrintParams; | 159 using blink::WebPrintParams; |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, | 2321 PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, |
2324 PP_Var script_var, | 2322 PP_Var script_var, |
2325 PP_Var* exception) { | 2323 PP_Var* exception) { |
2326 if (!container_) | 2324 if (!container_) |
2327 return PP_MakeUndefined(); | 2325 return PP_MakeUndefined(); |
2328 if (is_deleted_ && blink::WebPluginScriptForbiddenScope::isForbidden()) | 2326 if (is_deleted_ && blink::WebPluginScriptForbiddenScope::isForbidden()) |
2329 return PP_MakeUndefined(); | 2327 return PP_MakeUndefined(); |
2330 RecordFlashJavaScriptUse(); | 2328 RecordFlashJavaScriptUse(); |
2331 | 2329 |
2332 // Executing the script may remove the plugin from the DOM, so we need to keep | 2330 // Executing the script may remove the plugin from the DOM, so we need to keep |
2333 // a reference to ourselves so that we can still process the result after the | 2331 // a reference to ourselves so that we can still process the result after |
2334 // WebBindings::evaluate() below. | 2332 // running the script below. |
2335 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 2333 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
2336 V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); | 2334 V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); |
2337 PepperTryCatchVar try_catch(this, &converter, exception); | 2335 PepperTryCatchVar try_catch(this, &converter, exception); |
2338 | 2336 |
2339 // Check for an exception due to the context being destroyed. | 2337 // Check for an exception due to the context being destroyed. |
2340 if (try_catch.HasException()) | 2338 if (try_catch.HasException()) |
2341 return PP_MakeUndefined(); | 2339 return PP_MakeUndefined(); |
2342 | 2340 |
2343 WebLocalFrame* frame = container_->element().document().frame(); | 2341 WebLocalFrame* frame = container_->element().document().frame(); |
2344 if (!frame) { | 2342 if (!frame) { |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3277 | 3275 |
3278 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3276 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
3279 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3277 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
3280 javascript_used_ = true; | 3278 javascript_used_ = true; |
3281 RenderThread::Get()->RecordAction( | 3279 RenderThread::Get()->RecordAction( |
3282 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3280 base::UserMetricsAction("Flash.JavaScriptUsed")); |
3283 } | 3281 } |
3284 } | 3282 } |
3285 | 3283 |
3286 } // namespace content | 3284 } // namespace content |
OLD | NEW |