summaryrefslogtreecommitdiffstats
path: root/content/renderer/pepper/pepper_plugin_instance_throttler.h
blob: 515799c83916303e9d528a579998cfd108230d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_
#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_

#include "base/callback.h"
#include "base/macros.h"

namespace content {

// Throttles Pepper Plugin instances in Power Saver mode. Currently just a
// stub implementation that engages throttling after a fixed timeout.
// In the future, will examine plugin frames to find a suitable preview
// image before engaging throttling.
class PepperPluginInstanceThrottler {
 public:
  // |throttle_closure| is called to engage throttling.
  PepperPluginInstanceThrottler(const base::Closure& throttle_closure);

  virtual ~PepperPluginInstanceThrottler();

 private:
  DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceThrottler);
};
}

#endif  // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_THROTTLER_H_