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

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

Issue 2445993003: Make sure we get at least one progress callback (Closed)
Patch Set: fix tests Created 4 years, 1 month 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_MULTIBUFFER_DATA_SOURCE_H_ 5 #ifndef MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_
6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ 6 #define MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // BufferedResourceLoader::Start() callback for initial load. 156 // BufferedResourceLoader::Start() callback for initial load.
157 void StartCallback(); 157 void StartCallback();
158 158
159 // Check if we've moved to a new url and update has_signgle_origin_. 159 // Check if we've moved to a new url and update has_signgle_origin_.
160 void UpdateSingleOrigin(); 160 void UpdateSingleOrigin();
161 161
162 // MultiBufferReader progress callback. 162 // MultiBufferReader progress callback.
163 void ProgressCallback(int64_t begin, int64_t end); 163 void ProgressCallback(int64_t begin, int64_t end);
164 164
165 // Update progress based on current reader state.
166 void UpdateProgress();
167
165 // call downloading_cb_ if needed. 168 // call downloading_cb_ if needed.
166 // If |force_loading| is true, we call downloading_cb_ and tell it that 169 // If |force_loading| is true, we call downloading_cb_ and tell it that
167 // we are currently loading, regardless of what reader_->IsLoading() says. 170 // we are currently loading, regardless of what reader_->IsLoading() says.
168 // Caller must hold |lock_|. 171 // Caller must hold |lock_|.
169 void UpdateLoadingState_Locked(bool force_loading); 172 void UpdateLoadingState_Locked(bool force_loading);
170 void UpdateLoadingState();
171 173
172 // Update |reader_|'s preload and buffer settings. 174 // Update |reader_|'s preload and buffer settings.
173 void UpdateBufferSizes(); 175 void UpdateBufferSizes();
174 176
175 // crossorigin attribute on the corresponding HTML media element, if any. 177 // crossorigin attribute on the corresponding HTML media element, if any.
176 UrlData::CORSMode cors_mode_; 178 UrlData::CORSMode cors_mode_;
177 179
178 // URL of the resource requested. 180 // URL of the resource requested.
179 scoped_refptr<UrlData> url_data_; 181 scoped_refptr<UrlData> url_data_;
180 182
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // reaching into this class from multiple threads to attain a WeakPtr. 266 // reaching into this class from multiple threads to attain a WeakPtr.
265 base::WeakPtr<MultibufferDataSource> weak_ptr_; 267 base::WeakPtr<MultibufferDataSource> weak_ptr_;
266 base::WeakPtrFactory<MultibufferDataSource> weak_factory_; 268 base::WeakPtrFactory<MultibufferDataSource> weak_factory_;
267 269
268 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource); 270 DISALLOW_COPY_AND_ASSIGN(MultibufferDataSource);
269 }; 271 };
270 272
271 } // namespace media 273 } // namespace media
272 274
273 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_ 275 #endif // MEDIA_BLINK_MULTIBUFFER_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/multibuffer_data_source.cc » ('j') | media/blink/multibuffer_data_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698