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

Unified Diff: android_webview/common/aw_media_client_android.cc

Issue 2756333002: Rename MediaClientAndroid to MediaDrmBridgeClient (Closed)
Patch Set: Fix .h guards Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/common/aw_media_client_android.cc
diff --git a/android_webview/common/aw_media_client_android.cc b/android_webview/common/aw_media_client_android.cc
deleted file mode 100644
index 17cf3ce28fe9d022b71638178b899840e69dd5d7..0000000000000000000000000000000000000000
--- a/android_webview/common/aw_media_client_android.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "android_webview/common/aw_media_client_android.h"
-
-#include <utility>
-
-#include "base/logging.h"
-#include "base/stl_util.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-
-namespace android_webview {
-
-namespace {
-
-const size_t kGUIDLength = 36U;
-
-#define RCHECK(x) \
- if (!(x)) { \
- LOG(ERROR) << "Can't parse key-system mapping: " \
- << key_system_uuid_mapping; \
- return std::make_pair("", uuid); \
- }
-
-media::MediaClientAndroid::KeySystemUuidMap::value_type CreateMappingFromString(
- const std::string& key_system_uuid_mapping) {
- std::vector<uint8_t> uuid;
-
- std::vector<std::string> tokens =
- base::SplitString(key_system_uuid_mapping, ",", base::KEEP_WHITESPACE,
- base::SPLIT_WANT_NONEMPTY);
- RCHECK(tokens.size() == 2);
-
- std::string key_system;
- base::TrimWhitespaceASCII(tokens[0], base::TRIM_ALL, &key_system);
-
- std::string guid(tokens[1]);
- RCHECK(guid.length() == kGUIDLength);
- base::RemoveChars(guid, "-", &guid);
- RCHECK(base::HexStringToBytes(guid, &uuid));
-
- return std::make_pair(key_system, uuid);
-}
-
-} // namespace
-
-AwMediaClientAndroid::AwMediaClientAndroid(
- const std::vector<std::string>& key_system_uuid_mappings)
- : key_system_uuid_mappings_(key_system_uuid_mappings) {}
-
-AwMediaClientAndroid::~AwMediaClientAndroid() {}
-
-void AwMediaClientAndroid::AddKeySystemUUIDMappings(KeySystemUuidMap* map) {
- for (const std::string& key_system_uuid_mapping : key_system_uuid_mappings_) {
- auto mapping = CreateMappingFromString(key_system_uuid_mapping);
- if (!mapping.first.empty())
- map->insert(mapping);
- }
-}
-
-media::MediaDrmBridgeDelegate* AwMediaClientAndroid::GetMediaDrmBridgeDelegate(
- const media::UUID& scheme_uuid) {
- if (scheme_uuid == widevine_delegate_.GetUUID())
- return &widevine_delegate_;
- return nullptr;
-}
-
-} // namespace android_webview
« no previous file with comments | « android_webview/common/aw_media_client_android.h ('k') | android_webview/common/aw_media_drm_bridge_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698