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

Side by Side Diff: content/public/renderer/plugin_instance_throttler.h

Issue 863813002: Plugin Power Saver: Make Unthrottle metric collection more consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/renderer/plugin_instance_throttler.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 public: 63 public:
64 virtual void OnThrottleStateChange() = 0; 64 virtual void OnThrottleStateChange() = 0;
65 }; 65 };
66 66
67 // Returns a nullptr if no throttler needed based on |power_saver_mode|. 67 // Returns a nullptr if no throttler needed based on |power_saver_mode|.
68 static scoped_ptr<PluginInstanceThrottler> Get( 68 static scoped_ptr<PluginInstanceThrottler> Get(
69 RenderFrame* frame, 69 RenderFrame* frame,
70 const GURL& plugin_url, 70 const GURL& plugin_url,
71 PluginPowerSaverMode power_saver_mode); 71 PluginPowerSaverMode power_saver_mode);
72 72
73 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method);
74
73 virtual ~PluginInstanceThrottler() {} 75 virtual ~PluginInstanceThrottler() {}
74 76
75 virtual void AddObserver(Observer* observer) = 0; 77 virtual void AddObserver(Observer* observer) = 0;
76 virtual void RemoveObserver(Observer* observer) = 0; 78 virtual void RemoveObserver(Observer* observer) = 0;
77 79
78 virtual bool IsThrottled() const = 0; 80 virtual bool IsThrottled() const = 0;
79 81
80 // Marks the plugin as essential. Unthrottles the plugin if already throttled. 82 // Marks the plugin as essential. Unthrottles the plugin if already throttled.
81 virtual void MarkPluginEssential(PowerSaverUnthrottleMethod method) = 0; 83 virtual void MarkPluginEssential(PowerSaverUnthrottleMethod method) = 0;
82 84
83 protected: 85 protected:
84 PluginInstanceThrottler() {} 86 PluginInstanceThrottler() {}
85 87
86 private: 88 private:
87 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); 89 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler);
88 }; 90 };
89 } 91 }
90 92
91 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 93 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
OLDNEW
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/renderer/plugin_instance_throttler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698