| 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" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_offset_string_conversions.h" | 18 #include "base/strings/utf_offset_string_conversions.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/trace_event/trace_event.h" | 22 #include "base/trace_event/trace_event.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "cc/blink/web_layer_impl.h" | 24 #include "cc/blink/web_layer_impl.h" |
| 25 #include "cc/layers/texture_layer.h" | 25 #include "cc/layers/texture_layer.h" |
| 26 #include "content/common/content_constants_internal.h" | 26 #include "content/common/content_constants_internal.h" |
| 27 #include "content/common/frame_messages.h" | 27 #include "content/common/frame_messages.h" |
| 28 #include "content/public/child/url_conversion.h" |
| 28 #include "content/public/common/content_constants.h" | 29 #include "content/public/common/content_constants.h" |
| 29 #include "content/public/renderer/content_renderer_client.h" | 30 #include "content/public/renderer/content_renderer_client.h" |
| 30 #include "content/renderer/pepper/content_decryptor_delegate.h" | 31 #include "content/renderer/pepper/content_decryptor_delegate.h" |
| 31 #include "content/renderer/pepper/event_conversion.h" | 32 #include "content/renderer/pepper/event_conversion.h" |
| 32 #include "content/renderer/pepper/fullscreen_container.h" | 33 #include "content/renderer/pepper/fullscreen_container.h" |
| 33 #include "content/renderer/pepper/gfx_conversion.h" | 34 #include "content/renderer/pepper/gfx_conversion.h" |
| 34 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 35 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
| 35 #include "content/renderer/pepper/host_globals.h" | 36 #include "content/renderer/pepper/host_globals.h" |
| 36 #include "content/renderer/pepper/message_channel.h" | 37 #include "content/renderer/pepper/message_channel.h" |
| 37 #include "content/renderer/pepper/pepper_browser_connection.h" | 38 #include "content/renderer/pepper/pepper_browser_connection.h" |
| (...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 if (!full_frame_) | 2857 if (!full_frame_) |
| 2857 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), | 2858 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), |
| 2858 components); | 2859 components); |
| 2859 WebLocalFrame* frame = document.frame(); | 2860 WebLocalFrame* frame = document.frame(); |
| 2860 if (!frame) | 2861 if (!frame) |
| 2861 return PP_MakeUndefined(); | 2862 return PP_MakeUndefined(); |
| 2862 const WebURLRequest& request = frame->dataSource()->originalRequest(); | 2863 const WebURLRequest& request = frame->dataSource()->originalRequest(); |
| 2863 WebString referer = request.httpHeaderField("Referer"); | 2864 WebString referer = request.httpHeaderField("Referer"); |
| 2864 if (referer.isEmpty()) | 2865 if (referer.isEmpty()) |
| 2865 return PP_MakeUndefined(); | 2866 return PP_MakeUndefined(); |
| 2866 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(GURL(referer), | 2867 return ppapi::PPB_URLUtil_Shared::GenerateURLReturn(WebStringToGURL(referer), |
| 2867 components); | 2868 components); |
| 2868 } | 2869 } |
| 2869 | 2870 |
| 2870 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( | 2871 PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( |
| 2871 scoped_refptr<PluginModule> module) { | 2872 scoped_refptr<PluginModule> module) { |
| 2872 // Save the original module and switch over to the new one now that this | 2873 // Save the original module and switch over to the new one now that this |
| 2873 // plugin is using the IPC-based proxy. | 2874 // plugin is using the IPC-based proxy. |
| 2874 original_module_ = module_; | 2875 original_module_ = module_; |
| 2875 module_ = module; | 2876 module_ = module; |
| 2876 | 2877 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3290 | 3291 |
| 3291 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3292 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
| 3292 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3293 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
| 3293 javascript_used_ = true; | 3294 javascript_used_ = true; |
| 3294 RenderThread::Get()->RecordAction( | 3295 RenderThread::Get()->RecordAction( |
| 3295 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3296 base::UserMetricsAction("Flash.JavaScriptUsed")); |
| 3296 } | 3297 } |
| 3297 } | 3298 } |
| 3298 | 3299 |
| 3299 } // namespace content | 3300 } // namespace content |
| OLD | NEW |