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

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

Issue 1777153002: Improve retry support for media network loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed, tests updated Created 4 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 }; 115 };
116 116
117 // A data source capable of loading URLs and buffering the data using an 117 // A data source capable of loading URLs and buffering the data using an
118 // in-memory sliding window. 118 // in-memory sliding window.
119 // 119 //
120 // BufferedDataSource must be created and destroyed on the thread associated 120 // BufferedDataSource must be created and destroyed on the thread associated
121 // with the |task_runner| passed in the constructor. 121 // with the |task_runner| passed in the constructor.
122 class MEDIA_BLINK_EXPORT BufferedDataSource 122 class MEDIA_BLINK_EXPORT BufferedDataSource
123 : NON_EXPORTED_BASE(public BufferedDataSourceInterface) { 123 : NON_EXPORTED_BASE(public BufferedDataSourceInterface) {
124 public: 124 public:
125 // Number of times we retry before erroring out.
DaleCurtis 2016/03/11 16:36:32 Static const on an interface is odd. Enum is prefe
hubbe 2016/03/11 18:15:55 This is not an interface, but regardless, enums pr
126 static const int kLoaderRetries;
125 typedef base::Callback<void(bool)> DownloadingCB; 127 typedef base::Callback<void(bool)> DownloadingCB;
126 128
127 // |url| and |cors_mode| are passed to the object. Buffered byte range changes 129 // |url| and |cors_mode| are passed to the object. Buffered byte range changes
128 // will be reported to |host|. |downloading_cb| will be called whenever the 130 // will be reported to |host|. |downloading_cb| will be called whenever the
129 // downloading/paused state of the source changes. 131 // downloading/paused state of the source changes.
130 BufferedDataSource( 132 BufferedDataSource(
131 const GURL& url, 133 const GURL& url,
132 BufferedResourceLoader::CORSMode cors_mode, 134 BufferedResourceLoader::CORSMode cors_mode,
133 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 135 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
134 blink::WebFrame* frame, 136 blink::WebFrame* frame,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // reaching into this class from multiple threads to attain a WeakPtr. 328 // reaching into this class from multiple threads to attain a WeakPtr.
327 base::WeakPtr<BufferedDataSource> weak_ptr_; 329 base::WeakPtr<BufferedDataSource> weak_ptr_;
328 base::WeakPtrFactory<BufferedDataSource> weak_factory_; 330 base::WeakPtrFactory<BufferedDataSource> weak_factory_;
329 331
330 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 332 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
331 }; 333 };
332 334
333 } // namespace media 335 } // namespace media
334 336
335 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 337 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/buffered_data_source.cc » ('j') | media/blink/buffered_data_source_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698