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

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

Issue 879403002: Plugin Power Saver: Mute throttled 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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 scoped_ptr<cc::SingleReleaseCallback>* release_callback, 2032 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
2033 bool use_shared_memory) { 2033 bool use_shared_memory) {
2034 if (!bound_graphics_2d_platform_) 2034 if (!bound_graphics_2d_platform_)
2035 return false; 2035 return false;
2036 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox, 2036 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox,
2037 release_callback); 2037 release_callback);
2038 } 2038 }
2039 2039
2040 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; } 2040 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; }
2041 2041
2042 void PepperPluginInstanceImpl::OnThrottleStateChange() { 2042 void PepperPluginInstanceImpl::OnPowerSaverStateChange(
2043 PluginInstanceThrottler::PowerSaverState state) {
2043 SendDidChangeView(); 2044 SendDidChangeView();
2044 } 2045 }
2045 2046
2046 void PepperPluginInstanceImpl::AddLatencyInfo( 2047 void PepperPluginInstanceImpl::AddLatencyInfo(
2047 const std::vector<ui::LatencyInfo>& latency_info) { 2048 const std::vector<ui::LatencyInfo>& latency_info) {
2048 if (render_frame_ && render_frame_->GetRenderWidget()) { 2049 if (render_frame_ && render_frame_->GetRenderWidget()) {
2049 RenderWidgetCompositor* compositor = 2050 RenderWidgetCompositor* compositor =
2050 render_frame_->GetRenderWidget()->compositor(); 2051 render_frame_->GetRenderWidget()->compositor();
2051 if (compositor) { 2052 if (compositor) {
2052 for (size_t i = 0; i < latency_info.size(); i++) { 2053 for (size_t i = 0; i < latency_info.size(); i++) {
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
3277 3278
3278 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { 3279 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() {
3279 if (!javascript_used_ && is_flash_plugin_) { 3280 if (!javascript_used_ && is_flash_plugin_) {
3280 javascript_used_ = true; 3281 javascript_used_ = true;
3281 RenderThread::Get()->RecordAction( 3282 RenderThread::Get()->RecordAction(
3282 base::UserMetricsAction("Flash.JavaScriptUsed")); 3283 base::UserMetricsAction("Flash.JavaScriptUsed"));
3283 } 3284 }
3284 } 3285 }
3285 3286
3286 } // namespace content 3287 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698