| OLD | NEW |
| 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 #include "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 DoLoad(load_type, url, cors_mode); | 254 DoLoad(load_type, url, cors_mode); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 257 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
| 258 const blink::WebURL& url, | 258 const blink::WebURL& url, |
| 259 CORSMode cors_mode) { | 259 CORSMode cors_mode) { |
| 260 DVLOG(1) << __FUNCTION__; | 260 DVLOG(1) << __FUNCTION__; |
| 261 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 261 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 262 | 262 |
| 263 GURL gurl(url); | 263 GURL gurl(url); |
| 264 ReportMetrics(load_type, gurl, | 264 ReportMetrics( |
| 265 GURL(frame_->document().securityOrigin().toString())); | 265 load_type, gurl, |
| 266 GURL(base::string16(frame_->document().securityOrigin().toString()))); |
| 266 | 267 |
| 267 // Set subresource URL for crash reporting. | 268 // Set subresource URL for crash reporting. |
| 268 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); | 269 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); |
| 269 | 270 |
| 270 load_type_ = load_type; | 271 load_type_ = load_type; |
| 271 | 272 |
| 272 SetNetworkState(WebMediaPlayer::NetworkStateLoading); | 273 SetNetworkState(WebMediaPlayer::NetworkStateLoading); |
| 273 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing); | 274 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing); |
| 274 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8())); | 275 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8())); |
| 275 | 276 |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 << ", Video: " << stats.video_memory_usage << ", DataSource: " | 1374 << ", Video: " << stats.video_memory_usage << ", DataSource: " |
| 1374 << (data_source_ ? data_source_->GetMemoryUsage() : 0) | 1375 << (data_source_ ? data_source_->GetMemoryUsage() : 0) |
| 1375 << ", Demuxer: " << demuxer_memory_usage; | 1376 << ", Demuxer: " << demuxer_memory_usage; |
| 1376 | 1377 |
| 1377 const int64_t delta = current_memory_usage - last_reported_memory_usage_; | 1378 const int64_t delta = current_memory_usage - last_reported_memory_usage_; |
| 1378 last_reported_memory_usage_ = current_memory_usage; | 1379 last_reported_memory_usage_ = current_memory_usage; |
| 1379 adjust_allocated_memory_cb_.Run(delta); | 1380 adjust_allocated_memory_cb_.Run(delta); |
| 1380 } | 1381 } |
| 1381 | 1382 |
| 1382 } // namespace media | 1383 } // namespace media |
| OLD | NEW |