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

Side by Side Diff: components/cdm/renderer/widevine_key_systems.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 "components/cdm/renderer/widevine_key_systems.h" 5 #include "components/cdm/renderer/widevine_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "media/base/eme_constants.h" 11 #include "media/base/eme_constants.h"
12 12
13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
14 14
15 #if defined(WIDEVINE_CDM_AVAILABLE) 15 #if defined(WIDEVINE_CDM_AVAILABLE)
16 16
17 using media::KeySystemInfo; 17 using media::KeySystemInfo;
18 using media::SupportedCodecs; 18 using media::SupportedCodecs;
19 19
20 namespace cdm { 20 namespace cdm {
21 21
22 // Return |name|'s parent key system. 22 // Return |name|'s parent key system.
23 static std::string GetDirectParentName(std::string name) { 23 static std::string GetDirectParentName(const std::string& name) {
24 size_t last_period = name.find_last_of('.'); 24 size_t last_period = name.find_last_of('.');
25 DCHECK_GT(last_period, 0u); 25 DCHECK_GT(last_period, 0u);
26 return name.substr(0u, last_period); 26 return name.substr(0u, last_period);
27 } 27 }
28 28
29 void AddWidevineWithCodecs( 29 void AddWidevineWithCodecs(
30 WidevineCdmType widevine_cdm_type, 30 WidevineCdmType widevine_cdm_type,
31 SupportedCodecs supported_codecs, 31 SupportedCodecs supported_codecs,
32 #if defined(OS_ANDROID) 32 #if defined(OS_ANDROID)
33 SupportedCodecs supported_secure_codecs, 33 SupportedCodecs supported_secure_codecs,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #if defined(ENABLE_PEPPER_CDMS) 84 #if defined(ENABLE_PEPPER_CDMS)
85 info.pepper_type = kWidevineCdmPluginMimeType; 85 info.pepper_type = kWidevineCdmPluginMimeType;
86 #endif // defined(ENABLE_PEPPER_CDMS) 86 #endif // defined(ENABLE_PEPPER_CDMS)
87 87
88 concrete_key_systems->push_back(info); 88 concrete_key_systems->push_back(info);
89 } 89 }
90 90
91 } // namespace cdm 91 } // namespace cdm
92 92
93 #endif // defined(WIDEVINE_CDM_AVAILABLE) 93 #endif // defined(WIDEVINE_CDM_AVAILABLE)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698