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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_throttler.h

Issue 727073002: Plugin Power Saver: Force SW rendering for peripheral plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0192-plugin-power-saver-implement-basic-stop-frame-heuristic
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class CONTENT_EXPORT PepperPluginInstanceThrottler { 45 class CONTENT_EXPORT PepperPluginInstanceThrottler {
46 public: 46 public:
47 PepperPluginInstanceThrottler(PluginPowerSaverHelper* power_saver_helper, 47 PepperPluginInstanceThrottler(PluginPowerSaverHelper* power_saver_helper,
48 const blink::WebRect& bounds, 48 const blink::WebRect& bounds,
49 const std::string& module_name, 49 const std::string& module_name,
50 const GURL& plugin_url, 50 const GURL& plugin_url,
51 const base::Closure& throttle_change_callback); 51 const base::Closure& throttle_change_callback);
52 52
53 virtual ~PepperPluginInstanceThrottler(); 53 virtual ~PepperPluginInstanceThrottler();
54 54
55 bool needs_representative_keyframe() const {
56 return needs_representative_keyframe_;
57 }
58
55 // Called when the plugin flushes it's graphics context. Supplies the 59 // Called when the plugin flushes it's graphics context. Supplies the
56 // throttler with a candidate to use as the representative keyframe. 60 // throttler with a candidate to use as the representative keyframe.
57 void OnImageFlush(const SkBitmap* bitmap); 61 void OnImageFlush(const SkBitmap* bitmap);
58 62
59 bool is_throttled() const { return plugin_throttled_; } 63 bool is_throttled() const { return plugin_throttled_; }
60 const ppapi::ViewData& throttled_view_data() const { 64 const ppapi::ViewData& throttled_view_data() const {
61 return empty_view_data_; 65 return empty_view_data_;
62 } 66 }
63 67
64 // Returns true if |event| was handled and shouldn't be further processed. 68 // Returns true if |event| was handled and shouldn't be further processed.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Fake view data used by the Power Saver feature to throttle plugins. 106 // Fake view data used by the Power Saver feature to throttle plugins.
103 const ppapi::ViewData empty_view_data_; 107 const ppapi::ViewData empty_view_data_;
104 108
105 base::WeakPtrFactory<PepperPluginInstanceThrottler> weak_factory_; 109 base::WeakPtrFactory<PepperPluginInstanceThrottler> weak_factory_;
106 110
107 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceThrottler); 111 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceThrottler);
108 }; 112 };
109 } 113 }
110 114
111 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_ 115 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698