Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / content / renderer / pepper / pepper_plugin_instance_throttler.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
7
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10
11 namespace content {
12
13 // Throttles Pepper Plugin instances in Power Saver mode. Currently just a
14 // stub implementation that engages throttling after a fixed timeout.
15 // In the future, will examine plugin frames to find a suitable preview
16 // image before engaging throttling.
17 class PepperPluginInstanceThrottler {
18  public:
19   // |throttle_closure| is called to engage throttling.
20   explicit PepperPluginInstanceThrottler(const base::Closure& throttle_closure);
21
22   virtual ~PepperPluginInstanceThrottler();
23
24  private:
25   DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceThrottler);
26 };
27 }
28
29 #endif  // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_