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

Unified Diff: third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h

Issue 2782373002: Remove MediaControls methods needed for the Cast button (Closed)
Patch Set: Fixed MediaControlsImplTest Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h
diff --git a/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..efc039a0a68d4d8def18728b426fb53b6c71edf9
--- /dev/null
+++ b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h
@@ -0,0 +1,46 @@
+// Copyright 2017 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 AvailabilityCallbackWrapper_h
+#define AvailabilityCallbackWrapper_h
+
+#include <memory>
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "bindings/core/v8/TraceWrapperMember.h"
+#include "platform/heap/GarbageCollected.h"
+#include "platform/wtf/Compiler.h"
+#include "platform/wtf/Functional.h"
+
+namespace blink {
+
+class RemotePlaybackAvailabilityCallback;
+class RemotePlayback;
+
+// Wraps either a WTF::Closure or RemotePlaybackAvailabilityCallback object
+// to be kept in the RemotePlayback's |availability_callbacks_| map.
+class AvailabilityCallbackWrapper final
+ : public GarbageCollectedFinalized<AvailabilityCallbackWrapper>,
+ public TraceWrapperBase {
+ WTF_MAKE_NONCOPYABLE(AvailabilityCallbackWrapper);
+
+ public:
+ explicit AvailabilityCallbackWrapper(RemotePlaybackAvailabilityCallback*);
+ explicit AvailabilityCallbackWrapper(std::unique_ptr<WTF::Closure>);
+ ~AvailabilityCallbackWrapper() = default;
+
+ void Run(RemotePlayback*, bool new_availability);
+
+ DECLARE_VIRTUAL_TRACE();
+ DECLARE_VIRTUAL_TRACE_WRAPPERS();
+
+ private:
+ // Only one of these callbacks must be set.
+ TraceWrapperMember<RemotePlaybackAvailabilityCallback> bindings_cb_;
+ std::unique_ptr<WTF::Closure> internal_cb_;
+};
+
+} // namespace blink
+
+#endif // AvailabilityCallbackWrapper_h

Powered by Google App Engine
This is Rietveld 408576698