OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/process_util.h" | 6 #include "base/process_util.h" |
7 #include "media/base/filter_host.h" | 7 #include "media/base/filter_host.h" |
8 #include "net/base/load_flags.h" | 8 #include "net/base/load_flags.h" |
9 #include "net/base/data_url.h" | 9 #include "net/base/data_url.h" |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // If we don't get a content length or the request has failed, report it | 154 // If we don't get a content length or the request has failed, report it |
155 // as a network error. | 155 // as a network error. |
156 DCHECK(size_ == -1 || static_cast<size_t>(size_) == data_.length()); | 156 DCHECK(size_ == -1 || static_cast<size_t>(size_) == data_.length()); |
157 if (size_ == -1) { | 157 if (size_ == -1) { |
158 size_ = data_.length(); | 158 size_ = data_.length(); |
159 } | 159 } |
160 | 160 |
161 DoneInitialization_Locked(status.is_success()); | 161 DoneInitialization_Locked(status.is_success()); |
162 } | 162 } |
163 | 163 |
164 std::string SimpleDataSource::GetURLForDebugging() { | 164 GURL SimpleDataSource::GetURLForDebugging() const { |
165 return url_.spec(); | 165 return url_; |
166 } | 166 } |
167 | 167 |
168 void SimpleDataSource::SetURL(const GURL& url) { | 168 void SimpleDataSource::SetURL(const GURL& url) { |
169 url_ = url; | 169 url_ = url; |
170 media_format_.Clear(); | 170 media_format_.Clear(); |
171 media_format_.SetAsString(media::MediaFormat::kMimeType, | 171 media_format_.SetAsString(media::MediaFormat::kMimeType, |
172 media::mime_type::kApplicationOctetStream); | 172 media::mime_type::kApplicationOctetStream); |
173 media_format_.SetAsString(media::MediaFormat::kURL, url.spec()); | 173 media_format_.SetAsString(media::MediaFormat::kURL, url.spec()); |
174 } | 174 } |
175 | 175 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // If scheme is file or data, say we are loaded. | 219 // If scheme is file or data, say we are loaded. |
220 host()->SetLoaded(url_.SchemeIsFile() || IsDataProtocol(url_)); | 220 host()->SetLoaded(url_.SchemeIsFile() || IsDataProtocol(url_)); |
221 } else { | 221 } else { |
222 host()->SetError(media::PIPELINE_ERROR_NETWORK); | 222 host()->SetError(media::PIPELINE_ERROR_NETWORK); |
223 } | 223 } |
224 initialize_callback_->Run(); | 224 initialize_callback_->Run(); |
225 initialize_callback_.reset(); | 225 initialize_callback_.reset(); |
226 } | 226 } |
227 | 227 |
228 } // namespace webkit_glue | 228 } // namespace webkit_glue |
OLD | NEW |