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

Side by Side Diff: content/renderer/media/buffered_data_source.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
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 CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_
6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ 6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // Report a buffered byte range [start,end] or queue it for later 132 // Report a buffered byte range [start,end] or queue it for later
133 // reporting if set_host() hasn't been called yet. 133 // reporting if set_host() hasn't been called yet.
134 void ReportOrQueueBufferedBytes(int64 start, int64 end); 134 void ReportOrQueueBufferedBytes(int64 start, int64 end);
135 135
136 void UpdateHostState_Locked(); 136 void UpdateHostState_Locked();
137 137
138 // Update |loader_|'s deferring strategy in response to a play/pause, or 138 // Update |loader_|'s deferring strategy in response to a play/pause, or
139 // change in playback rate. 139 // change in playback rate.
140 void UpdateDeferStrategy(bool paused); 140 void UpdateDeferStrategy(bool paused);
141 141
142 base::WeakPtr<BufferedDataSource> weak_this_;
143
144 // URL of the resource requested. 142 // URL of the resource requested.
145 GURL url_; 143 GURL url_;
146 // crossorigin attribute on the corresponding HTML media element, if any. 144 // crossorigin attribute on the corresponding HTML media element, if any.
147 BufferedResourceLoader::CORSMode cors_mode_; 145 BufferedResourceLoader::CORSMode cors_mode_;
148 146
149 // The total size of the resource. Set during StartCallback() if the size is 147 // The total size of the resource. Set during StartCallback() if the size is
150 // known, otherwise it will remain kPositionNotSpecified until the size is 148 // known, otherwise it will remain kPositionNotSpecified until the size is
151 // determined by reaching EOF. 149 // determined by reaching EOF.
152 int64 total_bytes_; 150 int64 total_bytes_;
153 151
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // Current playback rate. 207 // Current playback rate.
210 float playback_rate_; 208 float playback_rate_;
211 209
212 // Buffered byte ranges awaiting set_host() being called to report to host(). 210 // Buffered byte ranges awaiting set_host() being called to report to host().
213 media::Ranges<int64> queued_buffered_byte_ranges_; 211 media::Ranges<int64> queued_buffered_byte_ranges_;
214 212
215 scoped_refptr<media::MediaLog> media_log_; 213 scoped_refptr<media::MediaLog> media_log_;
216 214
217 DownloadingCB downloading_cb_; 215 DownloadingCB downloading_cb_;
218 216
217 // NOTE: Weak pointers must be invalidated before all other member variables.
219 base::WeakPtrFactory<BufferedDataSource> weak_factory_; 218 base::WeakPtrFactory<BufferedDataSource> weak_factory_;
220 219
221 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 220 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
222 }; 221 };
223 222
224 } // namespace content 223 } // namespace content
225 224
226 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ 225 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/buffered_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698