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

Side by Side Diff: third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp

Issue 2782373002: Remove MediaControls methods needed for the Cast button (Closed)
Patch Set: Fixed MediaControlsImplTest Created 3 years, 7 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
(Empty)
1 // Copyright 2017 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 #include "modules/remoteplayback/AvailabilityCallbackWrapper.h"
6
7 #include "bindings/modules/v8/RemotePlaybackAvailabilityCallback.h"
8 #include "modules/remoteplayback/RemotePlayback.h"
9
10 namespace blink {
11
12 AvailabilityCallbackWrapper::AvailabilityCallbackWrapper(
13 RemotePlaybackAvailabilityCallback* callback)
14 : bindings_cb_(this, callback) {}
15
16 AvailabilityCallbackWrapper::AvailabilityCallbackWrapper(
17 std::unique_ptr<WTF::Closure> callback)
18 : bindings_cb_(nullptr, nullptr), internal_cb_(std::move(callback)) {}
19
20 void AvailabilityCallbackWrapper::Run(RemotePlayback* remote_playback,
21 bool new_availability) {
22 if (internal_cb_) {
23 DCHECK(!bindings_cb_);
24 (*internal_cb_.get())();
25 return;
26 }
27
28 bindings_cb_->call(remote_playback, new_availability);
29 }
30
31 DEFINE_TRACE(AvailabilityCallbackWrapper) {
32 visitor->Trace(bindings_cb_);
33 }
34
35 DEFINE_TRACE_WRAPPERS(AvailabilityCallbackWrapper) {
36 visitor->TraceWrappers(bindings_cb_);
37 }
38
39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698