summaryrefslogtreecommitdiffstats
path: root/media/blink
diff options
context:
space:
mode:
authorhubbe <hubbe@chromium.org>2015-11-06 17:26:10 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-07 01:26:59 +0000
commit08fb799636968bc14629b4c24e0ce5834dac0f71 (patch)
tree78ce9eb0f2a70ddb434ef911c17acbdfa019a6e1 /media/blink
parent0ec8554e1a22927413b0c27b980d128b194894ba (diff)
downloadchromium_src-08fb799636968bc14629b4c24e0ce5834dac0f71.zip
chromium_src-08fb799636968bc14629b4c24e0ce5834dac0f71.tar.gz
chromium_src-08fb799636968bc14629b4c24e0ce5834dac0f71.tar.bz2
use MEDIA_BLINK_EXPORT in media/blink
media/blink is a separate module from media/, and needs it's own export macro. Currently everything works, but mostly because of happy accidents. When adding new code and tests to media/blink I discovered that some symbols were not available on component builds because they were imported rather than exported. This fixes that. Unfortunately I do not remember which symbols I had a problem with. Review URL: https://codereview.chromium.org/1430063003 Cr-Commit-Position: refs/heads/master@{#358485}
Diffstat (limited to 'media/blink')
-rw-r--r--media/blink/BUILD.gn3
-rw-r--r--media/blink/active_loader.h4
-rw-r--r--media/blink/buffered_data_source.h6
-rw-r--r--media/blink/buffered_data_source_host_impl.h4
-rw-r--r--media/blink/buffered_resource_loader.h4
-rw-r--r--media/blink/cache_util.h6
-rw-r--r--media/blink/cdm_result_promise_helper.h14
-rw-r--r--media/blink/key_system_config_selector.h4
-rw-r--r--media/blink/media_blink.gyp3
-rw-r--r--media/blink/media_blink_export.h32
-rw-r--r--media/blink/new_session_cdm_result_promise.h4
-rw-r--r--media/blink/video_frame_compositor.h4
-rw-r--r--media/blink/webaudiosourceprovider_impl.h4
-rw-r--r--media/blink/webcontentdecryptionmodule_impl.h4
-rw-r--r--media/blink/webencryptedmediaclient_impl.h4
-rw-r--r--media/blink/webmediaplayer_impl.h4
-rw-r--r--media/blink/webmediaplayer_params.h4
-rw-r--r--media/blink/webmediaplayer_util.h24
-rw-r--r--media/blink/webmediasource_impl.h4
19 files changed, 85 insertions, 51 deletions
diff --git a/media/blink/BUILD.gn b/media/blink/BUILD.gn
index 8819fb7..f53b422 100644
--- a/media/blink/BUILD.gn
+++ b/media/blink/BUILD.gn
@@ -23,7 +23,7 @@ component("blink") {
"//url",
]
- defines = [ "MEDIA_IMPLEMENTATION" ]
+ defines = [ "MEDIA_BLINK_IMPLEMENTATION" ]
sources = [
"active_loader.cc",
@@ -43,6 +43,7 @@ component("blink") {
"cdm_session_adapter.h",
"key_system_config_selector.cc",
"key_system_config_selector.h",
+ "media_blink_export.h",
"new_session_cdm_result_promise.cc",
"new_session_cdm_result_promise.h",
"texttrack_impl.cc",
diff --git a/media/blink/active_loader.h b/media/blink/active_loader.h
index d8c60df..171ad450 100644
--- a/media/blink/active_loader.h
+++ b/media/blink/active_loader.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
namespace blink {
class WebURLLoader;
@@ -18,7 +18,7 @@ namespace media {
// Wraps an active WebURLLoader with some additional state.
//
// Handles deferring and deletion of loaders.
-class MEDIA_EXPORT ActiveLoader {
+class MEDIA_BLINK_EXPORT ActiveLoader {
public:
// Creates an ActiveLoader with the given loader. It is assumed that the
// initial state of |loader| is loading and not deferred.
diff --git a/media/blink/buffered_data_source.h b/media/blink/buffered_data_source.h
index 9762050..0c88ec8 100644
--- a/media/blink/buffered_data_source.h
+++ b/media/blink/buffered_data_source.h
@@ -13,9 +13,9 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "media/base/data_source.h"
-#include "media/base/media_export.h"
#include "media/base/ranges.h"
#include "media/blink/buffered_resource_loader.h"
+#include "media/blink/media_blink_export.h"
#include "url/gurl.h"
namespace base {
@@ -25,7 +25,7 @@ class SingleThreadTaskRunner;
namespace media {
class MediaLog;
-class MEDIA_EXPORT BufferedDataSourceHost {
+class MEDIA_BLINK_EXPORT BufferedDataSourceHost {
public:
// Notify the host of the total size of the media file.
virtual void SetTotalBytes(int64 total_bytes) = 0;
@@ -44,7 +44,7 @@ class MEDIA_EXPORT BufferedDataSourceHost {
//
// BufferedDataSource must be created and destroyed on the thread associated
// with the |task_runner| passed in the constructor.
-class MEDIA_EXPORT BufferedDataSource : public DataSource {
+class MEDIA_BLINK_EXPORT BufferedDataSource : public DataSource {
public:
// Used to specify video preload states. They are "hints" to the browser about
// how aggressively the browser should load and buffer data.
diff --git a/media/blink/buffered_data_source_host_impl.h b/media/blink/buffered_data_source_host_impl.h
index 8dd2ab7..d58c8c0 100644
--- a/media/blink/buffered_data_source_host_impl.h
+++ b/media/blink/buffered_data_source_host_impl.h
@@ -6,15 +6,15 @@
#define MEDIA_BLINK_BUFFERED_DATA_SOURCE_HOST_IMPL_H_
#include "base/time/time.h"
-#include "media/base/media_export.h"
#include "media/base/ranges.h"
#include "media/blink/buffered_data_source.h"
+#include "media/blink/media_blink_export.h"
namespace media {
// Provides an implementation of BufferedDataSourceHost that translates the
// buffered byte ranges into estimated time ranges.
-class MEDIA_EXPORT BufferedDataSourceHostImpl
+class MEDIA_BLINK_EXPORT BufferedDataSourceHostImpl
: public BufferedDataSourceHost {
public:
BufferedDataSourceHostImpl();
diff --git a/media/blink/buffered_resource_loader.h b/media/blink/buffered_resource_loader.h
index b4dec9a..97c59f4 100644
--- a/media/blink/buffered_resource_loader.h
+++ b/media/blink/buffered_resource_loader.h
@@ -9,9 +9,9 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
-#include "media/base/media_export.h"
#include "media/base/seekable_buffer.h"
#include "media/blink/active_loader.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebURLLoader.h"
#include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
@@ -28,7 +28,7 @@ const int64 kPositionNotSpecified = -1;
// render thread. It wraps a WebURLLoader and does in-memory buffering,
// pausing resource loading when the in-memory buffer is full and resuming
// resource loading when there is available capacity.
-class MEDIA_EXPORT BufferedResourceLoader
+class MEDIA_BLINK_EXPORT BufferedResourceLoader
: NON_EXPORTED_BASE(public blink::WebURLLoaderClient) {
public:
// kNeverDefer - Aggresively buffer; never defer loading while paused.
diff --git a/media/blink/cache_util.h b/media/blink/cache_util.h
index 5c59f14..033b6bd 100644
--- a/media/blink/cache_util.h
+++ b/media/blink/cache_util.h
@@ -8,7 +8,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
namespace blink {
class WebURLResponse;
@@ -33,8 +33,8 @@ enum UncacheableReason {
// Return the logical OR of the reasons "response" cannot be used for a future
// request (using the disk cache), or 0 if it might be useful.
-uint32 MEDIA_EXPORT GetReasonsForUncacheability(
- const blink::WebURLResponse& response);
+uint32 MEDIA_BLINK_EXPORT
+GetReasonsForUncacheability(const blink::WebURLResponse& response);
} // namespace media
diff --git a/media/blink/cdm_result_promise_helper.h b/media/blink/cdm_result_promise_helper.h
index 2fe385d..e2a67c3 100644
--- a/media/blink/cdm_result_promise_helper.h
+++ b/media/blink/cdm_result_promise_helper.h
@@ -7,8 +7,8 @@
#include <string>
-#include "media/base/media_export.h"
#include "media/base/media_keys.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
namespace media {
@@ -28,14 +28,14 @@ enum CdmResultForUMA {
NUM_RESULT_CODES
};
-MEDIA_EXPORT CdmResultForUMA
- ConvertCdmExceptionToResultForUMA(MediaKeys::Exception exception_code);
+MEDIA_BLINK_EXPORT CdmResultForUMA
+ConvertCdmExceptionToResultForUMA(MediaKeys::Exception exception_code);
-MEDIA_EXPORT blink::WebContentDecryptionModuleException ConvertCdmException(
- MediaKeys::Exception exception_code);
+MEDIA_BLINK_EXPORT blink::WebContentDecryptionModuleException
+ConvertCdmException(MediaKeys::Exception exception_code);
-MEDIA_EXPORT void ReportCdmResultUMA(const std::string& uma_name,
- CdmResultForUMA result);
+MEDIA_BLINK_EXPORT void ReportCdmResultUMA(const std::string& uma_name,
+ CdmResultForUMA result);
} // namespace media
diff --git a/media/blink/key_system_config_selector.h b/media/blink/key_system_config_selector.h
index 7a8afbf..55e6b33 100644
--- a/media/blink/key_system_config_selector.h
+++ b/media/blink/key_system_config_selector.h
@@ -13,7 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "media/base/eme_constants.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebVector.h"
namespace blink {
@@ -31,7 +31,7 @@ struct CdmConfig;
class KeySystems;
class MediaPermission;
-class MEDIA_EXPORT KeySystemConfigSelector {
+class MEDIA_BLINK_EXPORT KeySystemConfigSelector {
public:
KeySystemConfigSelector(
const KeySystems* key_systems,
diff --git a/media/blink/media_blink.gyp b/media/blink/media_blink.gyp
index 5e4a738..86e5e0f 100644
--- a/media/blink/media_blink.gyp
+++ b/media/blink/media_blink.gyp
@@ -25,7 +25,7 @@
'../../url/url.gyp:url_lib',
],
'defines': [
- 'MEDIA_IMPLEMENTATION',
+ 'MEDIA_BLINK_IMPLEMENTATION',
],
# This sources list is duplicated in //media/blink/BUILD.gn
'sources': [
@@ -48,6 +48,7 @@
'encrypted_media_player_support.h',
'key_system_config_selector.cc',
'key_system_config_selector.h',
+ 'media_blink_export.h',
'new_session_cdm_result_promise.cc',
'new_session_cdm_result_promise.h',
'texttrack_impl.cc',
diff --git a/media/blink/media_blink_export.h b/media/blink/media_blink_export.h
new file mode 100644
index 0000000..42325e5
--- /dev/null
+++ b/media/blink/media_blink_export.h
@@ -0,0 +1,32 @@
+// 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.
+
+#ifndef MEDIA_BLINK_MEDIA_BLINK_EXPORT_H_
+#define MEDIA_BLINK_MEDIA_BLINK_EXPORT_H_
+
+// Define MEDIA_BLINK_EXPORT so that functionality implemented by the
+// media/blink module can be exported to consumers.
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(MEDIA_BLINK_IMPLEMENTATION)
+#define MEDIA_BLINK_EXPORT __declspec(dllexport)
+#else
+#define MEDIA_BLINK_EXPORT __declspec(dllimport)
+#endif // defined(MEDIA_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#if defined(MEDIA_BLINK_IMPLEMENTATION)
+#define MEDIA_BLINK_EXPORT __attribute__((visibility("default")))
+#else
+#define MEDIA_BLINK_EXPORT
+#endif
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define MEDIA_BLINK_EXPORT
+#endif
+
+#endif // MEDIA_BLINK_MEDIA_BLINK_EXPORT_H_
diff --git a/media/blink/new_session_cdm_result_promise.h b/media/blink/new_session_cdm_result_promise.h
index 78e70b6..c26bc95 100644
--- a/media/blink/new_session_cdm_result_promise.h
+++ b/media/blink/new_session_cdm_result_promise.h
@@ -9,8 +9,8 @@
#include "base/basictypes.h"
#include "media/base/cdm_promise.h"
-#include "media/base/media_export.h"
#include "media/base/media_keys.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
namespace media {
@@ -37,7 +37,7 @@ typedef base::Callback<void(const std::string& session_id,
// promise returns the session ID (as a string), but the blink promise needs
// to get passed a SessionStatus. This class converts the session id to a
// SessionStatus by calling |new_session_created_cb|.
-class MEDIA_EXPORT NewSessionCdmResultPromise
+class MEDIA_BLINK_EXPORT NewSessionCdmResultPromise
: public CdmPromiseTemplate<std::string> {
public:
NewSessionCdmResultPromise(
diff --git a/media/blink/video_frame_compositor.h b/media/blink/video_frame_compositor.h
index 8cadedb..9983413 100644
--- a/media/blink/video_frame_compositor.h
+++ b/media/blink/video_frame_compositor.h
@@ -12,8 +12,8 @@
#include "base/time/tick_clock.h"
#include "base/timer/timer.h"
#include "cc/layers/video_frame_provider.h"
-#include "media/base/media_export.h"
#include "media/base/video_renderer_sink.h"
+#include "media/blink/media_blink_export.h"
#include "ui/gfx/geometry/size.h"
namespace media {
@@ -44,7 +44,7 @@ class VideoFrame;
//
// VideoFrameCompositor must live on the same thread as the compositor, though
// it may be constructed on any thread.
-class MEDIA_EXPORT VideoFrameCompositor
+class MEDIA_BLINK_EXPORT VideoFrameCompositor
: public VideoRendererSink,
NON_EXPORTED_BASE(public cc::VideoFrameProvider) {
public:
diff --git a/media/blink/webaudiosourceprovider_impl.h b/media/blink/webaudiosourceprovider_impl.h
index bc406e5..675be92 100644
--- a/media/blink/webaudiosourceprovider_impl.h
+++ b/media/blink/webaudiosourceprovider_impl.h
@@ -11,7 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "media/base/audio_renderer_sink.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
#include "third_party/WebKit/public/platform/WebVector.h"
@@ -30,7 +30,7 @@ namespace media {
// sample-frames using the sink's RenderCallback to get the data.
//
// All calls are protected by a lock.
-class MEDIA_EXPORT WebAudioSourceProviderImpl
+class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl
: NON_EXPORTED_BASE(public blink::WebAudioSourceProvider),
NON_EXPORTED_BASE(public AudioRendererSink) {
public:
diff --git a/media/blink/webcontentdecryptionmodule_impl.h b/media/blink/webcontentdecryptionmodule_impl.h
index 3567d8b..730077e 100644
--- a/media/blink/webcontentdecryptionmodule_impl.h
+++ b/media/blink/webcontentdecryptionmodule_impl.h
@@ -8,7 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModule.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
@@ -27,7 +27,7 @@ class CdmFactory;
class CdmSessionAdapter;
class WebContentDecryptionModuleSessionImpl;
-class MEDIA_EXPORT WebContentDecryptionModuleImpl
+class MEDIA_BLINK_EXPORT WebContentDecryptionModuleImpl
: public blink::WebContentDecryptionModule {
public:
static void Create(
diff --git a/media/blink/webencryptedmediaclient_impl.h b/media/blink/webencryptedmediaclient_impl.h
index 83197d8..a87e356 100644
--- a/media/blink/webencryptedmediaclient_impl.h
+++ b/media/blink/webencryptedmediaclient_impl.h
@@ -11,8 +11,8 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "media/base/media_export.h"
#include "media/blink/key_system_config_selector.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h"
namespace blink {
@@ -30,7 +30,7 @@ class CdmFactory;
class KeySystems;
class MediaPermission;
-class MEDIA_EXPORT WebEncryptedMediaClientImpl
+class MEDIA_BLINK_EXPORT WebEncryptedMediaClientImpl
: public blink::WebEncryptedMediaClient {
public:
WebEncryptedMediaClientImpl(
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index e839268..5b53753 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -15,13 +15,13 @@
#include "base/memory/weak_ptr.h"
#include "base/threading/thread.h"
#include "media/base/cdm_factory.h"
-#include "media/base/media_export.h"
#include "media/base/pipeline.h"
#include "media/base/renderer_factory.h"
#include "media/base/text_track.h"
#include "media/blink/buffered_data_source.h"
#include "media/blink/buffered_data_source_host_impl.h"
#include "media/blink/encrypted_media_player_support.h"
+#include "media/blink/media_blink_export.h"
#include "media/blink/video_frame_compositor.h"
#include "media/blink/webmediaplayer_params.h"
#include "media/blink/webmediaplayer_util.h"
@@ -61,7 +61,7 @@ class WebTextTrackImpl;
// The canonical implementation of blink::WebMediaPlayer that's backed by
// Pipeline. Handles normal resource loading, Media Source, and
// Encrypted Media.
-class MEDIA_EXPORT WebMediaPlayerImpl
+class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
: public NON_EXPORTED_BASE(blink::WebMediaPlayer),
public base::SupportsWeakPtr<WebMediaPlayerImpl> {
public:
diff --git a/media/blink/webmediaplayer_params.h b/media/blink/webmediaplayer_params.h
index 7be212a..35f5134 100644
--- a/media/blink/webmediaplayer_params.h
+++ b/media/blink/webmediaplayer_params.h
@@ -7,7 +7,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
-#include "media/base/media_export.h"
+#include "media/blink/media_blink_export.h"
#include "media/filters/context_3d.h"
namespace base {
@@ -28,7 +28,7 @@ class MediaPermission;
// Holds parameters for constructing WebMediaPlayerImpl without having
// to plumb arguments through various abstraction layers.
-class MEDIA_EXPORT WebMediaPlayerParams {
+class MEDIA_BLINK_EXPORT WebMediaPlayerParams {
public:
typedef base::Callback<void(const base::Closure&)> DeferLoadCB;
typedef base::Callback<Context3D()> Context3DCB;
diff --git a/media/blink/webmediaplayer_util.h b/media/blink/webmediaplayer_util.h
index 6359ace..7f4e7e9 100644
--- a/media/blink/webmediaplayer_util.h
+++ b/media/blink/webmediaplayer_util.h
@@ -8,9 +8,9 @@
#include "base/time/time.h"
#include "media/base/audio_renderer_sink.h"
#include "media/base/eme_constants.h"
-#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
#include "media/base/ranges.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
#include "third_party/WebKit/public/platform/WebSetSinkIdCallbacks.h"
@@ -19,29 +19,29 @@
namespace media {
-blink::WebTimeRanges MEDIA_EXPORT ConvertToWebTimeRanges(
- const Ranges<base::TimeDelta>& ranges);
+blink::WebTimeRanges MEDIA_BLINK_EXPORT
+ConvertToWebTimeRanges(const Ranges<base::TimeDelta>& ranges);
-blink::WebMediaPlayer::NetworkState MEDIA_EXPORT PipelineErrorToNetworkState(
- PipelineStatus error);
+blink::WebMediaPlayer::NetworkState MEDIA_BLINK_EXPORT
+PipelineErrorToNetworkState(PipelineStatus error);
// Report various metrics to UMA and RAPPOR.
-void MEDIA_EXPORT ReportMetrics(blink::WebMediaPlayer::LoadType load_type,
- const GURL& url,
- const GURL& origin_url);
+void MEDIA_BLINK_EXPORT ReportMetrics(blink::WebMediaPlayer::LoadType load_type,
+ const GURL& url,
+ const GURL& origin_url);
// Record a RAPPOR metric for the origin of an HLS playback.
-void MEDIA_EXPORT RecordOriginOfHLSPlayback(const GURL& origin_url);
+void MEDIA_BLINK_EXPORT RecordOriginOfHLSPlayback(const GURL& origin_url);
// Convert Initialization Data Types.
-EmeInitDataType MEDIA_EXPORT
+EmeInitDataType MEDIA_BLINK_EXPORT
ConvertToEmeInitDataType(blink::WebEncryptedMediaInitDataType init_data_type);
-blink::WebEncryptedMediaInitDataType MEDIA_EXPORT
+blink::WebEncryptedMediaInitDataType MEDIA_BLINK_EXPORT
ConvertToWebInitDataType(EmeInitDataType init_data_type);
// Wraps a blink::WebSetSinkIdCallbacks into a media::SwitchOutputDeviceCB
// and binds it to the current thread
-SwitchOutputDeviceCB MEDIA_EXPORT
+SwitchOutputDeviceCB MEDIA_BLINK_EXPORT
ConvertToSwitchOutputDeviceCB(blink::WebSetSinkIdCallbacks* web_callbacks);
} // namespace media
diff --git a/media/blink/webmediasource_impl.h b/media/blink/webmediasource_impl.h
index 9251935..6ee8da4 100644
--- a/media/blink/webmediasource_impl.h
+++ b/media/blink/webmediasource_impl.h
@@ -8,14 +8,14 @@
#include <string>
#include <vector>
-#include "media/base/media_export.h"
#include "media/base/media_log.h"
+#include "media/blink/media_blink_export.h"
#include "third_party/WebKit/public/platform/WebMediaSource.h"
namespace media {
class ChunkDemuxer;
-class MEDIA_EXPORT WebMediaSourceImpl
+class MEDIA_BLINK_EXPORT WebMediaSourceImpl
: NON_EXPORTED_BASE(public blink::WebMediaSource) {
public:
WebMediaSourceImpl(ChunkDemuxer* demuxer,