summaryrefslogtreecommitdiffstats
path: root/chromecast/renderer/cast_media_load_deferrer.cc
blob: 0f84657ce70ae5db3db51360a715a31dd2b97079 (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
// 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.

#include "chromecast/renderer/cast_media_load_deferrer.h"

#include "base/callback_helpers.h"
#include "base/logging.h"

namespace chromecast {

CastMediaLoadDeferrer::CastMediaLoadDeferrer(
    content::RenderFrame* render_frame,
    const base::Closure& continue_loading_cb)
    : content::RenderFrameObserver(render_frame),
      continue_loading_cb_(continue_loading_cb) {
  DCHECK(!continue_loading_cb_.is_null());
}

CastMediaLoadDeferrer::~CastMediaLoadDeferrer() {}

void CastMediaLoadDeferrer::WasShown() {
  continue_loading_cb_.Run();
  delete this;
}

}  // namespace chromecast