Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 #include "skia/ext/platform_canvas.h" | 86 #include "skia/ext/platform_canvas.h" |
| 87 #include "skia/ext/platform_device.h" | 87 #include "skia/ext/platform_device.h" |
| 88 #include "third_party/WebKit/public/platform/WebGamepads.h" | 88 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 89 #include "third_party/WebKit/public/platform/WebString.h" | 89 #include "third_party/WebKit/public/platform/WebString.h" |
| 90 #include "third_party/WebKit/public/platform/WebURL.h" | 90 #include "third_party/WebKit/public/platform/WebURL.h" |
| 91 #include "third_party/WebKit/public/platform/WebURLError.h" | 91 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 92 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 92 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 93 #include "third_party/WebKit/public/web/WebBindings.h" | 93 #include "third_party/WebKit/public/web/WebBindings.h" |
| 94 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 94 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 95 #include "third_party/WebKit/public/web/WebCursorInfo.h" | 95 #include "third_party/WebKit/public/web/WebCursorInfo.h" |
| 96 #include "third_party/WebKit/public/web/WebDataSource.h" | |
| 96 #include "third_party/WebKit/public/web/WebDocument.h" | 97 #include "third_party/WebKit/public/web/WebDocument.h" |
| 97 #include "third_party/WebKit/public/web/WebElement.h" | 98 #include "third_party/WebKit/public/web/WebElement.h" |
| 98 #include "third_party/WebKit/public/web/WebFrame.h" | 99 #include "third_party/WebKit/public/web/WebFrame.h" |
| 99 #include "third_party/WebKit/public/web/WebInputEvent.h" | 100 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 100 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 101 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 101 #include "third_party/WebKit/public/web/WebPrintParams.h" | 102 #include "third_party/WebKit/public/web/WebPrintParams.h" |
| 102 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 103 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
| 103 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 104 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
| 104 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 105 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
| 105 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 106 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| (...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2491 components); | 2492 components); |
| 2492 } | 2493 } |
| 2493 | 2494 |
| 2494 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( | 2495 PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( |
| 2495 PP_Instance instance, | 2496 PP_Instance instance, |
| 2496 PP_URLComponents_Dev* components) { | 2497 PP_URLComponents_Dev* components) { |
| 2497 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, | 2498 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, |
| 2498 components); | 2499 components); |
| 2499 } | 2500 } |
| 2500 | 2501 |
| 2502 PP_Var PepperPluginInstanceImpl::GetPluginReferrerURL( | |
| 2503 PP_Instance instance, | |
| 2504 PP_URLComponents_Dev* components) { | |
| 2505 WebKit::WebDocument document = container()->element().document(); | |
| 2506 if (!full_frame_) | |
| 2507 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), | |
|
Tom Sepez
2013/08/29 20:07:56
Does this leak info that would have otherwise been
bbudge
2013/09/06 20:35:45
It's a Dev interface, so can't be used by apps fro
| |
| 2508 components); | |
| 2509 WebFrame* frame = document.frame(); | |
| 2510 if (!frame) | |
| 2511 return PP_MakeUndefined(); | |
| 2512 const WebURLRequest& request = frame->dataSource()->originalRequest(); | |
| 2513 WebString referer = request.httpHeaderField("Referer"); | |
| 2514 if (referer.isEmpty()) | |
| 2515 return PP_MakeUndefined(); | |
| 2516 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(GURL(referer), | |
| 2517 components); | |
| 2518 } | |
| 2519 | |
| 2501 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( | 2520 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( |
| 2502 scoped_refptr<PluginModule> module) { | 2521 scoped_refptr<PluginModule> module) { |
| 2503 // Save the original module and switch over to the new one now that this | 2522 // Save the original module and switch over to the new one now that this |
| 2504 // plugin is using the IPC-based proxy. | 2523 // plugin is using the IPC-based proxy. |
| 2505 original_module_ = module_; | 2524 original_module_ = module_; |
| 2506 module_ = module; | 2525 module_ = module; |
| 2507 | 2526 |
| 2508 // Don't send any messages to the plugin until DidCreate() has finished. | 2527 // Don't send any messages to the plugin until DidCreate() has finished. |
| 2509 message_channel_->QueueJavaScriptMessages(); | 2528 message_channel_->QueueJavaScriptMessages(); |
| 2510 | 2529 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2900 // Running out-of-process. Initiate an IPC call to notify the plugin | 2919 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 2901 // process. | 2920 // process. |
| 2902 ppapi::proxy::HostDispatcher* dispatcher = | 2921 ppapi::proxy::HostDispatcher* dispatcher = |
| 2903 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2922 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 2904 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2923 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 2905 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2924 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 2906 } | 2925 } |
| 2907 } | 2926 } |
| 2908 | 2927 |
| 2909 } // namespace content | 2928 } // namespace content |
| OLD | NEW |