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

Side by Side Diff: media/cdm/cdm_paths.cc

Issue 1989893004: media: Use platform specific folders for CDMs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: specify both paths in chrome.release Created 4 years, 7 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/cdm/cdm_paths.h"
6
7 #include <string>
8
9 #include "build/build_config.h"
10
11 namespace media {
12
13 // Note: This file must be in sync with cdm_paths.{gypi|gni}
14 // TODO(xhwang): Improve how we enable platform specific path. See
15 // http://crbug.com/468584
16 #if defined(OS_MACOSX) || defined(OS_WIN)
17 #define CDM_USE_PLATFORM_SPECIFIC_PATH
18 #endif
19
20 #if defined(CDM_USE_PLATFORM_SPECIFIC_PATH)
21
22 // Special path used in chrome components.
23 const char kPlatformSpecific[] = "_platform_specific";
24
25 // Name of the component platform in the manifest.
26 const char kComponentPlatform[] =
27 #if defined(OS_MACOSX)
28 "mac";
29 #elif defined(OS_WIN)
30 "win";
31 #elif defined(OS_CHROMEOS)
32 "chromeos";
33 #elif defined(OS_LINUX)
34 "linux";
35 #else
36 "unsupported_platform";
37 #endif
38
39 // Name of the component architecture in the manifest.
40 const char kComponentArch[] =
41 #if defined(ARCH_CPU_X86)
42 "x86";
43 #elif defined(ARCH_CPU_X86_64)
44 "x64";
45 #elif defined(ARCH_CPU_ARMEL)
46 "arm";
47 #else
48 "unsupported_arch";
49 #endif
50
51 base::FilePath GetPlatformSpecificDirectory(const std::string& cdm_base_path) {
52 base::FilePath path;
53 const std::string kPlatformArch =
54 std::string(kComponentPlatform) + "_" + kComponentArch;
55 return path.AppendASCII(cdm_base_path)
56 .AppendASCII(kPlatformSpecific)
57 .AppendASCII(kPlatformArch);
58 }
59
60 #else // defined(CDM_USE_PLATFORM_SPECIFIC_PATH)
61
62 base::FilePath GetPlatformSpecificDirectory(const std::string& cdm_base_path) {
63 return base::FilePath();
64 }
65
66 #endif // defined(CDM_USE_PLATFORM_SPECIFIC_PATH)
67
68 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698