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

Side by Side Diff: media/mojo/services/mojo_cdm_service.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 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/mojo/services/mojo_cdm_service.h" 5 #include "media/mojo/services/mojo_cdm_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void MojoCdmService::Initialize(const mojo::String& key_system, 107 void MojoCdmService::Initialize(const mojo::String& key_system,
108 const mojo::String& security_origin, 108 const mojo::String& security_origin,
109 interfaces::CdmConfigPtr cdm_config, 109 interfaces::CdmConfigPtr cdm_config,
110 const InitializeCallback& callback) { 110 const InitializeCallback& callback) {
111 DVLOG(1) << __FUNCTION__ << ": " << key_system; 111 DVLOG(1) << __FUNCTION__ << ": " << key_system;
112 DCHECK(!cdm_); 112 DCHECK(!cdm_);
113 113
114 auto weak_this = weak_factory_.GetWeakPtr(); 114 auto weak_this = weak_factory_.GetWeakPtr();
115 cdm_factory_->Create( 115 cdm_factory_->Create(
116 key_system, GURL(security_origin), cdm_config.To<CdmConfig>(), 116 key_system, GURL(security_origin.get()), cdm_config.To<CdmConfig>(),
117 base::Bind(&MojoCdmService::OnSessionMessage, weak_this), 117 base::Bind(&MojoCdmService::OnSessionMessage, weak_this),
118 base::Bind(&MojoCdmService::OnSessionClosed, weak_this), 118 base::Bind(&MojoCdmService::OnSessionClosed, weak_this),
119 base::Bind(&MojoCdmService::OnLegacySessionError, weak_this), 119 base::Bind(&MojoCdmService::OnLegacySessionError, weak_this),
120 base::Bind(&MojoCdmService::OnSessionKeysChange, weak_this), 120 base::Bind(&MojoCdmService::OnSessionKeysChange, weak_this),
121 base::Bind(&MojoCdmService::OnSessionExpirationUpdate, weak_this), 121 base::Bind(&MojoCdmService::OnSessionExpirationUpdate, weak_this),
122 base::Bind(&MojoCdmService::OnCdmCreated, weak_this, callback)); 122 base::Bind(&MojoCdmService::OnCdmCreated, weak_this, callback));
123 } 123 }
124 124
125 void MojoCdmService::SetServerCertificate( 125 void MojoCdmService::SetServerCertificate(
126 mojo::Array<uint8_t> certificate_data, 126 mojo::Array<uint8_t> certificate_data,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 void MojoCdmService::OnDecryptorConnectionError() { 277 void MojoCdmService::OnDecryptorConnectionError() {
278 DVLOG(2) << __FUNCTION__; 278 DVLOG(2) << __FUNCTION__;
279 279
280 // MojoDecryptorService has lost connectivity to it's client, so it can be 280 // MojoDecryptorService has lost connectivity to it's client, so it can be
281 // freed. 281 // freed.
282 decryptor_.reset(); 282 decryptor_.reset();
283 } 283 }
284 284
285 } // namespace media 285 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698