Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2013)

Unified Diff: content/renderer/pepper/plugin_instance_throttler_impl.cc

Issue 1341563002: Plugin Power Saver: Improve origin handling esp. with OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/plugin_instance_throttler_impl.cc
diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc
index 00eecbb80dc94f9a8ba0b3b53f54bb5d2b5f3471..7f2bb14a6d9ad85b614a44c9d4562087df4f9d5b 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -15,10 +15,12 @@
#include "ppapi/shared_impl/ppapi_constants.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
+#include "third_party/WebKit/public/web/WebView.h"
#include "ui/gfx/color_utils.h"
-#include "url/gurl.h"
+#include "url/origin.h"
namespace content {
@@ -158,7 +160,7 @@ void PluginInstanceThrottlerImpl::SetWebPlugin(
void PluginInstanceThrottlerImpl::Initialize(
RenderFrameImpl* frame,
- const GURL& content_origin,
+ const url::Origin& content_origin,
const std::string& plugin_module_name,
const gfx::Size& unobscured_size) {
DCHECK(unobscured_size_.IsEmpty());
@@ -170,6 +172,7 @@ void PluginInstanceThrottlerImpl::Initialize(
bool cross_origin_main_content = false;
float zoom_factor = GetWebPlugin()->container()->pageZoomFactor();
if (!helper->ShouldThrottleContent(
+ frame->GetWebFrame()->view()->mainFrame()->securityOrigin(),
piman 2015/09/14 23:58:23 Should this be frame->GetWebFrame()->top()->securi
tommycli 2015/09/15 00:38:19 Done. I think this should be equivalent.
content_origin, plugin_module_name,
roundf(unobscured_size.width() / zoom_factor),
roundf(unobscured_size.height() / zoom_factor),

Powered by Google App Engine
This is Rietveld 408576698