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

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
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.cc ('k') | media/mojo/services/mojo_cdm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 DoLoad(load_type, url, cors_mode); 260 DoLoad(load_type, url, cors_mode);
260 } 261 }
261 262
262 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 263 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
263 const blink::WebURL& url, 264 const blink::WebURL& url,
264 CORSMode cors_mode) { 265 CORSMode cors_mode) {
265 DVLOG(1) << __FUNCTION__; 266 DVLOG(1) << __FUNCTION__;
266 DCHECK(main_task_runner_->BelongsToCurrentThread()); 267 DCHECK(main_task_runner_->BelongsToCurrentThread());
267 268
268 GURL gurl(url); 269 GURL gurl(url);
269 ReportMetrics(load_type, gurl, 270 ReportMetrics(
270 GURL(frame_->document().securityOrigin().toString())); 271 load_type, gurl,
272 blink::WebStringToGURL(frame_->document().securityOrigin().toString()));
271 273
272 // Set subresource URL for crash reporting. 274 // Set subresource URL for crash reporting.
273 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); 275 base::debug::SetCrashKeyValue("subresource_url", gurl.spec());
274 276
275 load_type_ = load_type; 277 load_type_ = load_type;
276 278
277 SetNetworkState(WebMediaPlayer::NetworkStateLoading); 279 SetNetworkState(WebMediaPlayer::NetworkStateLoading);
278 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing); 280 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing);
279 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8())); 281 media_log_->AddEvent(media_log_->CreateLoadEvent(url.string().utf8()));
280 282
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 << ", Video: " << stats.video_memory_usage << ", DataSource: " 1523 << ", Video: " << stats.video_memory_usage << ", DataSource: "
1522 << (data_source_ ? data_source_->GetMemoryUsage() : 0) 1524 << (data_source_ ? data_source_->GetMemoryUsage() : 0)
1523 << ", Demuxer: " << demuxer_memory_usage; 1525 << ", Demuxer: " << demuxer_memory_usage;
1524 1526
1525 const int64_t delta = current_memory_usage - last_reported_memory_usage_; 1527 const int64_t delta = current_memory_usage - last_reported_memory_usage_;
1526 last_reported_memory_usage_ = current_memory_usage; 1528 last_reported_memory_usage_ = current_memory_usage;
1527 adjust_allocated_memory_cb_.Run(delta); 1529 adjust_allocated_memory_cb_.Run(delta);
1528 } 1530 }
1529 1531
1530 } // namespace media 1532 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webencryptedmediaclient_impl.cc ('k') | media/mojo/services/mojo_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698