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

Unified Diff: third_party/WebKit/Source/platform/testing/EmptyWebMediaPlayer.h

Issue 2729613007: Fixing a crash in MediaCustomControlsFullscreenDetector when the page is destroyed (Closed)
Patch Set: rebased Created 3 years, 9 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/platform/testing/EmptyWebMediaPlayer.h
diff --git a/third_party/WebKit/Source/platform/testing/EmptyWebMediaPlayer.h b/third_party/WebKit/Source/platform/testing/EmptyWebMediaPlayer.h
new file mode 100644
index 0000000000000000000000000000000000000000..83e1af5fb80ddbf968d0f4e73673e10f5f35de38
--- /dev/null
+++ b/third_party/WebKit/Source/platform/testing/EmptyWebMediaPlayer.h
@@ -0,0 +1,56 @@
+// 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.
+
+#include "public/platform/WebMediaPlayer.h"
+
+#ifndef EmptyWebMediaPlayer_h
+#define EmptyWebMediaPlayer_h
+
+namespace blink {
+
+// An empty WebMediaPlayer used only for tests. This class defines the methods
+// of WebMediaPlayer so that mock WebMediaPlayers don't need to redefine them if
+// they don't care their behavior.
+class EmptyWebMediaPlayer : public WebMediaPlayer {
+ public:
+ ~EmptyWebMediaPlayer() override {}
+
+ void load(LoadType, const WebMediaPlayerSource&, CORSMode) override {}
+ void play() override {}
+ void pause() override {}
+ bool supportsSave() const override { return false; }
+ void seek(double seconds) override {}
+ void setRate(double) override {}
+ void setVolume(double) override {}
+ WebTimeRanges buffered() const override;
+ WebTimeRanges seekable() const override;
+ void setSinkId(const WebString& sinkId,
+ const WebSecurityOrigin&,
+ WebSetSinkIdCallbacks*) override {}
+ bool hasVideo() const override { return false; }
+ bool hasAudio() const override { return false; }
+ WebSize naturalSize() const override;
+ bool paused() const override { return false; }
+ bool seeking() const override { return false; }
+ double duration() const override { return 0.0; }
+ double currentTime() const override { return 0.0; }
+ NetworkState getNetworkState() const override { return NetworkStateEmpty; }
+ ReadyState getReadyState() const override { return ReadyStateHaveNothing; }
+ WebString getErrorMessage() override { return WebString(); }
+ bool didLoadingProgress() override { return false; }
+ bool hasSingleSecurityOrigin() const override { return true; }
+ bool didPassCORSAccessCheck() const override { return true; }
+ double mediaTimeForTimeValue(double timeValue) const override {
+ return timeValue;
+ };
+ unsigned decodedFrameCount() const override { return 0; }
+ unsigned droppedFrameCount() const override { return 0; }
+ size_t audioDecodedByteCount() const override { return 0; }
+ size_t videoDecodedByteCount() const override { return 0; }
+ void paint(WebCanvas*, const WebRect&, cc::PaintFlags&) override {}
+};
+
+} // namespace blink
+
+#endif // EmptyWebMediaPlayer_h

Powered by Google App Engine
This is Rietveld 408576698