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

Side by Side Diff: media/blink/webencryptedmediaclient_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/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webmediaplayer_impl.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/webencryptedmediaclient_impl.h" 5 #include "media/blink/webencryptedmediaclient_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "media/base/key_systems.h" 13 #include "media/base/key_systems.h"
14 #include "media/base/media_client.h" 14 #include "media/base/media_client.h"
15 #include "media/base/media_permission.h" 15 #include "media/base/media_permission.h"
16 #include "media/blink/webcontentdecryptionmodule_impl.h" 16 #include "media/blink/webcontentdecryptionmodule_impl.h"
17 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h" 17 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h"
18 #include "third_party/WebKit/public/platform/URLConversion.h"
18 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 19 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
19 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" 20 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h"
20 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" 21 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h"
21 #include "third_party/WebKit/public/platform/WebString.h" 22 #include "third_party/WebKit/public/platform/WebString.h"
22 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" 23 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
23 24
24 namespace media { 25 namespace media {
25 26
26 namespace { 27 namespace {
27 28
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 94 }
94 95
95 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { 96 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() {
96 } 97 }
97 98
98 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( 99 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess(
99 blink::WebEncryptedMediaRequest request) { 100 blink::WebEncryptedMediaRequest request) {
100 GetReporter(request.keySystem())->ReportRequested(); 101 GetReporter(request.keySystem())->ReportRequested();
101 102
102 if (GetMediaClient()) { 103 if (GetMediaClient()) {
103 GURL security_origin(request.securityOrigin().toString()); 104 GURL security_origin(
105 blink::WebStringToGURL(request.securityOrigin().toString()));
104 106
105 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); 107 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin);
106 108
107 blink::WebString error_message; 109 blink::WebString error_message;
108 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { 110 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) {
109 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", 111 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure",
110 security_origin); 112 security_origin);
111 } 113 }
112 } 114 }
113 115
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); 161 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
160 Reporter* reporter = reporters_.get(uma_name); 162 Reporter* reporter = reporters_.get(uma_name);
161 if (!reporter) { 163 if (!reporter) {
162 reporter = new Reporter(uma_name); 164 reporter = new Reporter(uma_name);
163 reporters_.add(uma_name, make_scoped_ptr(reporter)); 165 reporters_.add(uma_name, make_scoped_ptr(reporter));
164 } 166 }
165 return reporter; 167 return reporter;
166 } 168 }
167 169
168 } // namespace media 170 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webcontentdecryptionmodule_impl.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698