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.
5 #include "content/renderer/pepper/pepper_plugin_instance_throttler.h"
7 #include "base/message_loop/message_loop.h"
8 #include "base/time/time.h"
14 // When we give up waiting for a suitable preview frame, and simply suspend
15 // the plugin where it's at. In milliseconds.
16 const int kThrottleTimeout
= 5000;
19 PepperPluginInstanceThrottler::PepperPluginInstanceThrottler(
20 const base::Closure
& throttle_closure
) {
21 DCHECK(!throttle_closure
.is_null());
22 base::MessageLoop::current()->PostDelayedTask(
23 FROM_HERE
, throttle_closure
,
24 base::TimeDelta::FromMilliseconds(kThrottleTimeout
));
27 PepperPluginInstanceThrottler::~PepperPluginInstanceThrottler() {
30 } // namespace content