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

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

Issue 849723002: Plugin Power Saver: Make PepperPluginInstanceThrottler interface public. (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
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 COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_ 5 #include "content/public/renderer/plugin_instance_throttler.h"
6 #define COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_
7 6
8 #include "components/history/core/browser/history_context.h" 7 #include "content/renderer/pepper/plugin_instance_throttler_impl.h"
9 8
10 namespace content { 9 namespace content {
11 class WebContents; 10
11 // static
12 scoped_ptr<PluginInstanceThrottler> PluginInstanceThrottler::Get(
13 RenderFrame* frame,
14 const GURL& plugin_url,
15 PluginPowerSaverMode power_saver_mode) {
16 if (power_saver_mode == PluginPowerSaverMode::POWER_SAVER_MODE_ESSENTIAL)
17 return nullptr;
18
19 bool power_saver_enabled =
20 power_saver_mode ==
21 PluginPowerSaverMode::POWER_SAVER_MODE_PERIPHERAL_THROTTLED;
22 return make_scoped_ptr(
23 new PluginInstanceThrottlerImpl(frame, plugin_url, power_saver_enabled));
24 }
25
12 } // namespace content 26 } // namespace content
13
14 namespace history {
15
16 // Helper function that associates a ContextID to a content::WebContents. The
17 // ContextID will become invalid once the content::WebContents is destroyed.
18 ContextID ContextIDForWebContents(content::WebContents* web_contents);
19
20 } // namespace history
21
22 #endif // COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698