Skip to content

Commit

Permalink
media: Move key_system_names to media/base/
Browse files Browse the repository at this point in the history
This file is already used from media/base/ and should be there to
clean up some dependency issues (as noted by gn check).

BUG=599578
TEST=compiles with gn and gyp

Review-Url: https://codereview.chromium.org/1921823003
Cr-Commit-Position: refs/heads/master@{#390276}
  • Loading branch information
jrummell-chromium authored and Commit bot committed Apr 28, 2016
1 parent 9dff30e commit abc3d79
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 23 deletions.
4 changes: 2 additions & 2 deletions chromecast/media/base/key_systems_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <cstddef>

#include "media/cdm/key_system_names.h"
#include "media/base/key_system_names.h"

#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.

Expand All @@ -30,7 +30,7 @@ CastKeySystem GetKeySystemByName(const std::string& key_system_name) {
}
#endif // defined(PLAYREADY_CDM_AVAILABLE)

if (key_system_name.compare(::media::kClearKey) == 0) {
if (::media::IsClearKey(key_system_name)) {
return KEY_SYSTEM_CLEAR_KEY;
}

Expand Down
2 changes: 0 additions & 2 deletions media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ component("media") {
"cdm/default_cdm_factory.h",
"cdm/json_web_key.cc",
"cdm/json_web_key.h",
"cdm/key_system_names.cc",
"cdm/key_system_names.h",
"cdm/player_tracker_impl.cc",
"cdm/player_tracker_impl.h",
"cdm/supported_cdm_versions.cc",
Expand Down
3 changes: 2 additions & 1 deletion media/base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ source_set("base") {
"encryption_scheme.h",
"key_system_info.cc",
"key_system_info.h",
"key_system_names.cc",
"key_system_names.h",
"key_system_properties.cc",
"key_system_properties.h",
"key_systems.cc",
"key_systems.h",
"key_systems.h",
"loopback_audio_converter.cc",
"loopback_audio_converter.h",
"media.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/cdm/key_system_names.h"
#include "media/base/key_system_names.h"

namespace media {

Expand Down
15 changes: 5 additions & 10 deletions media/cdm/key_system_names.h → media/base/key_system_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_CDM_KEY_SYSTEM_NAMES_H_
#define MEDIA_CDM_KEY_SYSTEM_NAMES_H_
#ifndef MEDIA_BASE_KEY_SYSTEM_NAMES_H_
#define MEDIA_BASE_KEY_SYSTEM_NAMES_H_

#include <string>

#include "media/base/media_export.h"

namespace media {

// TODO(jrummell): Change other uses of Clear Key to use this common value.

// The key system name for Clear Key.
MEDIA_EXPORT extern const char kClearKey[];

// The key system name for External Clear Key.
MEDIA_EXPORT extern const char kExternalClearKey[];
// TODO(jrummell): This file should be folded into key_systems.cc as that is
// the primary user of these functions. http://crbug.com/606579.

// Returns true if |key_system| is Clear Key, false otherwise.
MEDIA_EXPORT bool IsClearKey(const std::string& key_system);
Expand All @@ -31,4 +26,4 @@ MEDIA_EXPORT bool IsExternalClearKey(const std::string& key_system);

} // namespace media

#endif // MEDIA_CDM_KEY_SYSTEM_NAMES_H_
#endif // MEDIA_BASE_KEY_SYSTEM_NAMES_H_
4 changes: 2 additions & 2 deletions media/base/key_systems.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/key_system_info.h"
#include "media/base/key_system_names.h"
#include "media/base/key_system_properties.h"
#include "media/base/media.h"
#include "media/base/media_client.h"
#include "media/cdm/key_system_names.h"
#include "media/media_features.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h"

Expand Down Expand Up @@ -169,7 +169,7 @@ static bool IsPotentiallySupportedKeySystem(const std::string& key_system) {
// Known and supported key systems.
if (key_system == kWidevineKeySystem)
return true;
if (key_system == kClearKey)
if (key_system == kClearKeyKeySystem)
return true;

// External Clear Key is known and supports suffixes for testing.
Expand Down
2 changes: 1 addition & 1 deletion media/blink/webcontentdecryptionmodulesession_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
#include "base/strings/utf_string_conversions.h"
#include "media/base/cdm_key_information.h"
#include "media/base/cdm_promise.h"
#include "media/base/key_system_names.h"
#include "media/base/key_systems.h"
#include "media/base/limits.h"
#include "media/base/media_keys.h"
#include "media/blink/cdm_result_promise.h"
#include "media/blink/cdm_session_adapter.h"
#include "media/blink/webmediaplayer_util.h"
#include "media/cdm/json_web_key.h"
#include "media/cdm/key_system_names.h"
#include "third_party/WebKit/public/platform/WebData.h"
#include "third_party/WebKit/public/platform/WebEncryptedMediaKeyInformation.h"
#include "third_party/WebKit/public/platform/WebString.h"
Expand Down
4 changes: 2 additions & 2 deletions media/media.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@
'base/encryption_scheme.h',
'base/key_system_info.cc',
'base/key_system_info.h',
'base/key_system_names.cc',
'base/key_system_names.h',
'base/key_system_properties.cc',
'base/key_system_properties.h',
'base/key_systems.cc',
Expand Down Expand Up @@ -483,8 +485,6 @@
'cdm/default_cdm_factory.h',
'cdm/json_web_key.cc',
'cdm/json_web_key.h',
'cdm/key_system_names.cc',
'cdm/key_system_names.h',
'cdm/player_tracker_impl.cc',
'cdm/player_tracker_impl.h',
'cdm/supported_cdm_versions.cc',
Expand Down
4 changes: 2 additions & 2 deletions media/mojo/services/media_apptest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "media/base/cdm_config.h"
#include "media/base/mock_filters.h"
#include "media/base/test_helpers.h"
#include "media/cdm/key_system_names.h"
#include "media/mojo/common/media_type_converters.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
#include "media/mojo/interfaces/decryptor.mojom.h"
Expand All @@ -33,6 +32,7 @@ namespace media {
namespace {

#if defined(ENABLE_MOJO_CDM)
const char kClearKeyKeySystem[] = "org.w3.clearkey";
const char kInvalidKeySystem[] = "invalid.key.system";
#endif
const char kSecurityOrigin[] = "http://foo.com";
Expand Down Expand Up @@ -140,7 +140,7 @@ class MediaAppTest : public shell::test::ApplicationTestBase {

#if defined(ENABLE_MOJO_CDM)
TEST_F(MediaAppTest, InitializeCdm_Success) {
InitializeCdm(kClearKey, true, 1);
InitializeCdm(kClearKeyKeySystem, true, 1);
run_loop_->Run();
}

Expand Down

0 comments on commit abc3d79

Please sign in to comment.