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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 904913003: Plugin Power Saver: Fix implicitly sized and below the fold plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 if (is_flash_plugin_ && RenderThread::Get()) { 809 if (is_flash_plugin_ && RenderThread::Get()) {
810 RenderThread::Get()->RecordAction( 810 RenderThread::Get()->RecordAction(
811 base::UserMetricsAction("Flash.PluginInstanceCreated")); 811 base::UserMetricsAction("Flash.PluginInstanceCreated"));
812 blink::WebRect bounds = container()->element().boundsInViewportSpace(); 812 blink::WebRect bounds = container()->element().boundsInViewportSpace();
813 RecordFlashSizeMetric(bounds.width, bounds.height); 813 RecordFlashSizeMetric(bounds.width, bounds.height);
814 } 814 }
815 815
816 if (throttler) { 816 if (throttler) {
817 throttler_ = throttler.Pass(); 817 throttler_ = throttler.Pass();
818 throttler_->AddObserver(this); 818 throttler_->AddObserver(this);
819 throttler_->Initialize(render_frame_, plugin_url_.GetOrigin(),
820 module()->name(),
821 container()->element().boundsInViewportSpace());
819 } 822 }
820 823
821 message_channel_ = MessageChannel::Create(this, &message_channel_object_); 824 message_channel_ = MessageChannel::Create(this, &message_channel_object_);
822 825
823 full_frame_ = full_frame; 826 full_frame_ = full_frame;
824 827
825 UpdateTouchEventRequest(); 828 UpdateTouchEventRequest();
826 container_->setWantsWheelEvents(IsAcceptingWheelEvents()); 829 container_->setWantsWheelEvents(IsAcceptingWheelEvents());
827 830
828 SetGPUHistogram(ppapi::Preferences(PpapiPreferencesBuilder::Build( 831 SetGPUHistogram(ppapi::Preferences(PpapiPreferencesBuilder::Build(
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
3289 3292
3290 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { 3293 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() {
3291 if (initialized_ && !javascript_used_ && is_flash_plugin_) { 3294 if (initialized_ && !javascript_used_ && is_flash_plugin_) {
3292 javascript_used_ = true; 3295 javascript_used_ = true;
3293 RenderThread::Get()->RecordAction( 3296 RenderThread::Get()->RecordAction(
3294 base::UserMetricsAction("Flash.JavaScriptUsed")); 3297 base::UserMetricsAction("Flash.JavaScriptUsed"));
3295 } 3298 }
3296 } 3299 }
3297 3300
3298 } // namespace content 3301 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/render_frame.h ('k') | content/renderer/pepper/plugin_instance_throttler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698