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

Side by Side 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 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 "public/platform/WebMediaPlayer.h"
6
7 #ifndef EmptyWebMediaPlayer_h
8 #define EmptyWebMediaPlayer_h
9
10 namespace blink {
11
12 // An empty WebMediaPlayer used only for tests. This class defines the methods
13 // of WebMediaPlayer so that mock WebMediaPlayers don't need to redefine them if
14 // they don't care their behavior.
15 class EmptyWebMediaPlayer : public WebMediaPlayer {
16 public:
17 ~EmptyWebMediaPlayer() override {}
18
19 void load(LoadType, const WebMediaPlayerSource&, CORSMode) override {}
20 void play() override {}
21 void pause() override {}
22 bool supportsSave() const override { return false; }
23 void seek(double seconds) override {}
24 void setRate(double) override {}
25 void setVolume(double) override {}
26 WebTimeRanges buffered() const override;
27 WebTimeRanges seekable() const override;
28 void setSinkId(const WebString& sinkId,
29 const WebSecurityOrigin&,
30 WebSetSinkIdCallbacks*) override {}
31 bool hasVideo() const override { return false; }
32 bool hasAudio() const override { return false; }
33 WebSize naturalSize() const override;
34 bool paused() const override { return false; }
35 bool seeking() const override { return false; }
36 double duration() const override { return 0.0; }
37 double currentTime() const override { return 0.0; }
38 NetworkState getNetworkState() const override { return NetworkStateEmpty; }
39 ReadyState getReadyState() const override { return ReadyStateHaveNothing; }
40 WebString getErrorMessage() override { return WebString(); }
41 bool didLoadingProgress() override { return false; }
42 bool hasSingleSecurityOrigin() const override { return true; }
43 bool didPassCORSAccessCheck() const override { return true; }
44 double mediaTimeForTimeValue(double timeValue) const override {
45 return timeValue;
46 };
47 unsigned decodedFrameCount() const override { return 0; }
48 unsigned droppedFrameCount() const override { return 0; }
49 size_t audioDecodedByteCount() const override { return 0; }
50 size_t videoDecodedByteCount() const override { return 0; }
51 void paint(WebCanvas*, const WebRect&, cc::PaintFlags&) override {}
52 };
53
54 } // namespace blink
55
56 #endif // EmptyWebMediaPlayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698