From a7ee9fee8ac9bef44e7906153785f91abc56d20e Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Fri, 20 May 2016 16:11:29 +1200 Subject: [PATCH] Bug 1271169 - Move all device binding code into librlz and remove static runtime requirement. r=glandium I want the EME device binding/nodeId code to be callable from gtests, as well as in plugin-container. I need this because I want to add a gtest that ensures that we don't regress the EME/GMP device binding code. I want to call the GMP device binding code in the gtest and in the GMP process, and compare the result. So we need to make it possible to link the device binding code into the gtests as well as plugin-container. So move all code that device binding calls into librlz, to make it easier to link against all the code required. Note: the device binding code needs to be statically linked into plugin-container so that it's covered by the Adobe CDM's voucher tool. MozReview-Commit-ID: AvBAe1dh49Z --HG-- rename : ipc/app/sha256.c => dom/media/gmp/rlz/sha256.c rename : ipc/app/sha256.h => dom/media/gmp/rlz/sha256.h extra : rebase_source : f60f1e68649fa90cbe1f2fe09f5f69948444b1df --- dom/media/gmp/moz.build | 10 ++++++---- dom/media/gmp/rlz/moz.build | 14 ++++++++++++-- {ipc/app => dom/media/gmp/rlz}/sha256.c | 0 {ipc/app => dom/media/gmp/rlz}/sha256.h | 0 dom/media/gtest/moz.build | 4 ++++ ipc/app/moz.build | 17 +++-------------- 6 files changed, 25 insertions(+), 20 deletions(-) rename {ipc/app => dom/media/gmp/rlz}/sha256.c (100%) rename {ipc/app => dom/media/gmp/rlz}/sha256.h (100%) diff --git a/dom/media/gmp/moz.build b/dom/media/gmp/moz.build index 91eb2fb42a9b..77b51ff927a2 100644 --- a/dom/media/gmp/moz.build +++ b/dom/media/gmp/moz.build @@ -79,6 +79,9 @@ if CONFIG['OS_TARGET'] == 'Android': SOURCES += [ 'GMPLoader.cpp', ] + USE_LIBS += [ + 'rlz', + ] UNIFIED_SOURCES += [ 'GMPAudioDecoderChild.cpp', @@ -115,10 +118,9 @@ UNIFIED_SOURCES += [ 'GMPVideoPlaneImpl.cpp', ] -if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin'): - DIRS += [ - 'rlz', - ] +DIRS += [ + 'rlz', +] if 'widevine' in CONFIG['MOZ_EME_MODULES']: DIRS += [ diff --git a/dom/media/gmp/rlz/moz.build b/dom/media/gmp/rlz/moz.build index 258551053228..5df6b7840806 100644 --- a/dom/media/gmp/rlz/moz.build +++ b/dom/media/gmp/rlz/moz.build @@ -8,12 +8,18 @@ # Chromium IPC's headers used in the moz.build of the parent file. Library('rlz') -FORCE_STATIC_LIB = True UNIFIED_SOURCES += [ - 'lib/string_utils.cc', + 'GMPDeviceBinding.cpp', ] +if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] in ['WINNT', 'Darwin']: + DEFINES['HASH_NODE_ID_WITH_DEVICE_ID'] = 1; + UNIFIED_SOURCES += [ + 'lib/string_utils.cc', + 'sha256.c', + ] + if CONFIG['OS_TARGET'] == 'WINNT': UNIFIED_SOURCES += [ 'win/lib/machine_id_win.cc', @@ -30,3 +36,7 @@ if CONFIG['OS_TARGET'] == 'Darwin': LOCAL_INCLUDES += [ '..', ] + +EXPORTS += [ + 'GMPDeviceBinding.h', +] diff --git a/ipc/app/sha256.c b/dom/media/gmp/rlz/sha256.c similarity index 100% rename from ipc/app/sha256.c rename to dom/media/gmp/rlz/sha256.c diff --git a/ipc/app/sha256.h b/dom/media/gmp/rlz/sha256.h similarity index 100% rename from ipc/app/sha256.h rename to dom/media/gmp/rlz/sha256.h diff --git a/dom/media/gtest/moz.build b/dom/media/gtest/moz.build index b702959249f3..8b9e06144d54 100644 --- a/dom/media/gtest/moz.build +++ b/dom/media/gtest/moz.build @@ -75,3 +75,7 @@ FINAL_LIBRARY = 'xul-gtest' if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wno-error=shadow'] + +USE_LIBS += [ + 'rlz', +] diff --git a/ipc/app/moz.build b/ipc/app/moz.build index cf68b0881edc..55fdf6fc07c0 100644 --- a/ipc/app/moz.build +++ b/ipc/app/moz.build @@ -33,6 +33,9 @@ if CONFIG['OS_TARGET'] != 'Android': SOURCES += [ '../../dom/media/gmp/GMPLoader.cpp', ] + USE_LIBS += [ + 'rlz', + ] if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT': # For sandbox includes and the include dependencies those have @@ -40,19 +43,11 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT': '/security/sandbox/chromium', '/security/sandbox/chromium-shim', ] - USE_LIBS += [ - 'rlz', - ] USE_LIBS += [ 'sandbox_s', ] - DEFINES['HASH_NODE_ID_WITH_DEVICE_ID'] = 1; - SOURCES += [ - 'sha256.c', - ] - if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] in ('Linux', 'Android'): USE_LIBS += [ 'mozsandbox', @@ -72,12 +67,6 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin': ] USE_LIBS += [ 'mozsandbox', - 'rlz', - ] - - DEFINES['HASH_NODE_ID_WITH_DEVICE_ID'] = 1; - SOURCES += [ - 'sha256.c', ] if CONFIG['_MSC_VER']: