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

Side by Side Diff: media/blink/buffered_data_source.h

Issue 1029763002: Introduce CancelUponDeferral() to buffered media loaders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move cancelation. Created 5 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 5 #ifndef MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // object and never call it again. 96 // object and never call it again.
97 // 97 //
98 // Method called on the render thread. 98 // Method called on the render thread.
99 void Abort(); 99 void Abort();
100 100
101 // Notifies changes in playback state for controlling media buffering 101 // Notifies changes in playback state for controlling media buffering
102 // behavior. 102 // behavior.
103 void MediaPlaybackRateChanged(float playback_rate); 103 void MediaPlaybackRateChanged(float playback_rate);
104 void MediaIsPlaying(); 104 void MediaIsPlaying();
105 void MediaIsPaused(); 105 void MediaIsPaused();
106 bool media_has_played() const { return media_has_played_; }
106 107
107 // Returns true if the resource is local. 108 // Returns true if the resource is local.
108 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } 109 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); }
109 110
111 // Cancels any open network connections once reaching the deferred state. If
112 // the DataSource is already deferred connections will be immediately closed.
113 void CancelUponDeferral();
114
110 // DataSource implementation. 115 // DataSource implementation.
111 // Called from demuxer thread. 116 // Called from demuxer thread.
112 void Stop() override; 117 void Stop() override;
113 118
114 void Read(int64 position, 119 void Read(int64 position,
115 int size, 120 int size,
116 uint8* data, 121 uint8* data,
117 const DataSource::ReadCB& read_cb) override; 122 const DataSource::ReadCB& read_cb) override;
118 bool GetSize(int64* size_out) override; 123 bool GetSize(int64* size_out) override;
119 bool IsStreaming() override; 124 bool IsStreaming() override;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // reaching into this class from multiple threads to attain a WeakPtr. 242 // reaching into this class from multiple threads to attain a WeakPtr.
238 base::WeakPtr<BufferedDataSource> weak_ptr_; 243 base::WeakPtr<BufferedDataSource> weak_ptr_;
239 base::WeakPtrFactory<BufferedDataSource> weak_factory_; 244 base::WeakPtrFactory<BufferedDataSource> weak_factory_;
240 245
241 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 246 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
242 }; 247 };
243 248
244 } // namespace media 249 } // namespace media
245 250
246 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 251 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698