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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/strings/utf_offset_string_conversions.h" | 16 #include "base/strings/utf_offset_string_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "cc/base/latency_info_swap_promise.h" | 19 #include "cc/base/latency_info_swap_promise.h" |
20 #include "cc/layers/texture_layer.h" | 20 #include "cc/layers/texture_layer.h" |
21 #include "cc/trees/layer_tree_host.h" | 21 #include "cc/trees/layer_tree_host.h" |
22 #include "content/common/content_constants_internal.h" | 22 #include "content/common/content_constants_internal.h" |
23 #include "content/common/input/web_input_event_traits.h" | 23 #include "content/common/input/web_input_event_traits.h" |
24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/page_zoom.h" | 25 #include "content/public/common/page_zoom.h" |
26 #include "content/public/renderer/content_renderer_client.h" | 26 #include "content/public/renderer/content_renderer_client.h" |
27 #include "content/renderer/compositor_bindings/web_layer_impl.h" | 27 #include "content/renderer/compositor_bindings/web_layer_impl.h" |
28 #include "content/renderer/gpu/render_widget_compositor.h" | 28 #include "content/renderer/gpu/render_widget_compositor.h" |
29 #include "content/renderer/pepper/common.h" | |
30 #include "content/renderer/pepper/content_decryptor_delegate.h" | 29 #include "content/renderer/pepper/content_decryptor_delegate.h" |
31 #include "content/renderer/pepper/event_conversion.h" | 30 #include "content/renderer/pepper/event_conversion.h" |
32 #include "content/renderer/pepper/fullscreen_container.h" | 31 #include "content/renderer/pepper/fullscreen_container.h" |
33 #include "content/renderer/pepper/gfx_conversion.h" | 32 #include "content/renderer/pepper/gfx_conversion.h" |
34 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 33 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
35 #include "content/renderer/pepper/host_globals.h" | 34 #include "content/renderer/pepper/host_globals.h" |
36 #include "content/renderer/pepper/message_channel.h" | 35 #include "content/renderer/pepper/message_channel.h" |
37 #include "content/renderer/pepper/npapi_glue.h" | 36 #include "content/renderer/pepper/npapi_glue.h" |
38 #include "content/renderer/pepper/pepper_browser_connection.h" | 37 #include "content/renderer/pepper/pepper_browser_connection.h" |
39 #include "content/renderer/pepper/pepper_compositor_host.h" | 38 #include "content/renderer/pepper/pepper_compositor_host.h" |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 return PP_FALSE; | 2840 return PP_FALSE; |
2842 | 2841 |
2843 blink::WebSecurityOrigin security_origin; | 2842 blink::WebSecurityOrigin security_origin; |
2844 if (!SecurityOriginForInstance(instance, &security_origin)) | 2843 if (!SecurityOriginForInstance(instance, &security_origin)) |
2845 return PP_FALSE; | 2844 return PP_FALSE; |
2846 | 2845 |
2847 GURL gurl(url_string->value()); | 2846 GURL gurl(url_string->value()); |
2848 if (!gurl.is_valid()) | 2847 if (!gurl.is_valid()) |
2849 return PP_FALSE; | 2848 return PP_FALSE; |
2850 | 2849 |
2851 return BoolToPPBool(security_origin.canRequest(gurl)); | 2850 return PP_FromBool(security_origin.canRequest(gurl)); |
2852 } | 2851 } |
2853 | 2852 |
2854 PP_Bool PepperPluginInstanceImpl::DocumentCanAccessDocument( | 2853 PP_Bool PepperPluginInstanceImpl::DocumentCanAccessDocument( |
2855 PP_Instance instance, | 2854 PP_Instance instance, |
2856 PP_Instance target) { | 2855 PP_Instance target) { |
2857 blink::WebSecurityOrigin our_origin; | 2856 blink::WebSecurityOrigin our_origin; |
2858 if (!SecurityOriginForInstance(instance, &our_origin)) | 2857 if (!SecurityOriginForInstance(instance, &our_origin)) |
2859 return PP_FALSE; | 2858 return PP_FALSE; |
2860 | 2859 |
2861 blink::WebSecurityOrigin target_origin; | 2860 blink::WebSecurityOrigin target_origin; |
2862 if (!SecurityOriginForInstance(instance, &target_origin)) | 2861 if (!SecurityOriginForInstance(instance, &target_origin)) |
2863 return PP_FALSE; | 2862 return PP_FALSE; |
2864 | 2863 |
2865 return BoolToPPBool(our_origin.canAccess(target_origin)); | 2864 return PP_FromBool(our_origin.canAccess(target_origin)); |
2866 } | 2865 } |
2867 | 2866 |
2868 PP_Var PepperPluginInstanceImpl::GetDocumentURL( | 2867 PP_Var PepperPluginInstanceImpl::GetDocumentURL( |
2869 PP_Instance instance, | 2868 PP_Instance instance, |
2870 PP_URLComponents_Dev* components) { | 2869 PP_URLComponents_Dev* components) { |
2871 blink::WebDocument document = container()->element().document(); | 2870 blink::WebDocument document = container()->element().document(); |
2872 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), | 2871 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), |
2873 components); | 2872 components); |
2874 } | 2873 } |
2875 | 2874 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 // Running out-of-process. Initiate an IPC call to notify the plugin | 3305 // Running out-of-process. Initiate an IPC call to notify the plugin |
3307 // process. | 3306 // process. |
3308 ppapi::proxy::HostDispatcher* dispatcher = | 3307 ppapi::proxy::HostDispatcher* dispatcher = |
3309 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3308 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3310 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3309 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3311 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3310 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3312 } | 3311 } |
3313 } | 3312 } |
3314 | 3313 |
3315 } // namespace content | 3314 } // namespace content |
OLD | NEW |