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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 #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 26 matching lines...) Expand all
37 #include "media/base/video_frame.h" 37 #include "media/base/video_frame.h"
38 #include "media/blink/texttrack_impl.h" 38 #include "media/blink/texttrack_impl.h"
39 #include "media/blink/webaudiosourceprovider_impl.h" 39 #include "media/blink/webaudiosourceprovider_impl.h"
40 #include "media/blink/webcontentdecryptionmodule_impl.h" 40 #include "media/blink/webcontentdecryptionmodule_impl.h"
41 #include "media/blink/webinbandtexttrack_impl.h" 41 #include "media/blink/webinbandtexttrack_impl.h"
42 #include "media/blink/webmediaplayer_delegate.h" 42 #include "media/blink/webmediaplayer_delegate.h"
43 #include "media/blink/webmediaplayer_util.h" 43 #include "media/blink/webmediaplayer_util.h"
44 #include "media/blink/webmediasource_impl.h" 44 #include "media/blink/webmediasource_impl.h"
45 #include "media/filters/chunk_demuxer.h" 45 #include "media/filters/chunk_demuxer.h"
46 #include "media/filters/ffmpeg_demuxer.h" 46 #include "media/filters/ffmpeg_demuxer.h"
47 #include "third_party/WebKit/public/platform/URLConversion.h"
47 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" 48 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
48 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 49 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
49 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h" 50 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient. h"
50 #include "third_party/WebKit/public/platform/WebMediaSource.h" 51 #include "third_party/WebKit/public/platform/WebMediaSource.h"
51 #include "third_party/WebKit/public/platform/WebRect.h" 52 #include "third_party/WebKit/public/platform/WebRect.h"
52 #include "third_party/WebKit/public/platform/WebSize.h" 53 #include "third_party/WebKit/public/platform/WebSize.h"
53 #include "third_party/WebKit/public/platform/WebString.h" 54 #include "third_party/WebKit/public/platform/WebString.h"
54 #include "third_party/WebKit/public/platform/WebURL.h" 55 #include "third_party/WebKit/public/platform/WebURL.h"
55 #include "third_party/WebKit/public/web/WebDocument.h" 56 #include "third_party/WebKit/public/web/WebDocument.h"
56 #include "third_party/WebKit/public/web/WebFrame.h" 57 #include "third_party/WebKit/public/web/WebFrame.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 DoLoad(load_type, url, cors_mode); 256 DoLoad(load_type, url, cors_mode);
256 } 257 }
257 258
258 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 259 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
259 const blink::WebURL& url, 260 const blink::WebURL& url,
260 CORSMode cors_mode) { 261 CORSMode cors_mode) {
261 DVLOG(1) << __FUNCTION__; 262 DVLOG(1) << __FUNCTION__;
262 DCHECK(main_task_runner_->BelongsToCurrentThread()); 263 DCHECK(main_task_runner_->BelongsToCurrentThread());
263 264
264 GURL gurl(url); 265 GURL gurl(url);
265 ReportMetrics(load_type, gurl, 266 ReportMetrics(
266 GURL(frame_->document().securityOrigin().toString())); 267 load_type, gurl,
268 blink::WebStringToGURL(frame_->document().securityOrigin().toString()));
267 269
268 // Set subresource URL for crash reporting. 270 // Set subresource URL for crash reporting.
269 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); 271 base::debug::SetCrashKeyValue("subresource_url", gurl.spec());
270 272
271 load_type_ = load_type; 273 load_type_ = load_type;
272 274
273 SetNetworkState(WebMediaPlayer::NetworkStateLoading); 275 SetNetworkState(WebMediaPlayer::NetworkStateLoading);
274 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing); 276 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing);
275 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8())); 277 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8()));
276 278
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 << ", Video: " << stats.video_memory_usage << ", DataSource: " 1379 << ", Video: " << stats.video_memory_usage << ", DataSource: "
1378 << (data_source_ ? data_source_->GetMemoryUsage() : 0) 1380 << (data_source_ ? data_source_->GetMemoryUsage() : 0)
1379 << ", Demuxer: " << demuxer_memory_usage; 1381 << ", Demuxer: " << demuxer_memory_usage;
1380 1382
1381 const int64_t delta = current_memory_usage - last_reported_memory_usage_; 1383 const int64_t delta = current_memory_usage - last_reported_memory_usage_;
1382 last_reported_memory_usage_ = current_memory_usage; 1384 last_reported_memory_usage_ = current_memory_usage;
1383 adjust_allocated_memory_cb_.Run(delta); 1385 adjust_allocated_memory_cb_.Run(delta);
1384 } 1386 }
1385 1387
1386 } // namespace media 1388 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698