From eafedd1648b0e29e89270ee32fad35cc8932feaf Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Mon, 25 Mar 2024 11:41:29 -0700 Subject: [PATCH] [media] Fix non-guarded customizations in //third_party/chromium/media All modification to Chromium media code is guarded by `#if defined(STARBOARD)`. b/329702113 --- .../base/demuxer_memory_limit_starboard.cc | 4 ++ .../chromium/media/base/demuxer_stream.h | 6 +-- .../chromium/media/base/starboard_utils.cc | 4 ++ .../chromium/media/base/starboard_utils.h | 4 ++ .../media/base/starboard_utils_test.cc | 4 ++ third_party/chromium/media/base/status.h | 2 + .../media/cobalt/base/bind_post_task.h | 4 ++ .../chromium/media/cobalt/base/check.h | 4 ++ .../chromium/media/cobalt/base/check_op.h | 4 ++ .../media/cobalt/base/cxx17_backports.h | 4 ++ .../chromium/media/cobalt/base/hash/md5.h | 4 ++ .../chromium/media/cobalt/base/notreached.h | 4 ++ .../media/cobalt/base/types/strong_alias.h | 4 ++ .../cobalt/net/cookies/site_for_cookies.h | 4 ++ .../chromium/media/filters/chunk_demuxer.cc | 39 +++++++------------ .../chromium/media/filters/chunk_demuxer.h | 19 ++++----- .../media/filters/source_buffer_stream.cc | 14 ++++--- .../media/filters/source_buffer_stream.h | 8 ++-- ui/gfx/color_space.h | 4 ++ ui/gfx/color_space_export.h | 4 ++ ui/gfx/geometry/point.cc | 4 ++ ui/gfx/geometry/point.h | 4 ++ ui/gfx/geometry/point3_f.h | 4 ++ ui/gfx/geometry/point_base.h | 4 ++ ui/gfx/geometry/point_f.cc | 4 ++ ui/gfx/geometry/point_f.h | 4 ++ ui/gfx/geometry/rect.h | 4 ++ ui/gfx/geometry/rect_base.h | 4 ++ ui/gfx/geometry/rect_base_impl.h | 4 ++ ui/gfx/geometry/size.h | 4 ++ ui/gfx/geometry/size_base.h | 4 ++ ui/gfx/geometry/size_f.h | 4 ++ ui/gfx/geometry/vector2d.h | 4 ++ ui/gfx/geometry/vector2d_f.h | 4 ++ ui/gfx/hdr_metadata.h | 4 ++ ui/gfx/native_pixmap_handle.h | 4 ++ 36 files changed, 160 insertions(+), 48 deletions(-) diff --git a/third_party/chromium/media/base/demuxer_memory_limit_starboard.cc b/third_party/chromium/media/base/demuxer_memory_limit_starboard.cc index d8305f034f95..188878d8715c 100644 --- a/third_party/chromium/media/base/demuxer_memory_limit_starboard.cc +++ b/third_party/chromium/media/base/demuxer_memory_limit_starboard.cc @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "media/base/demuxer_memory_limit.h" #include "media/base/decoder_buffer.h" diff --git a/third_party/chromium/media/base/demuxer_stream.h b/third_party/chromium/media/base/demuxer_stream.h index 67769b39fd26..f1a975456713 100644 --- a/third_party/chromium/media/base/demuxer_stream.h +++ b/third_party/chromium/media/base/demuxer_stream.h @@ -70,7 +70,7 @@ class MEDIA_EXPORT DemuxerStream { #if defined(STARBOARD) virtual std::string mime_type() const { return ""; } -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) // Request a buffer to returned via the provided callback. // @@ -80,10 +80,10 @@ class MEDIA_EXPORT DemuxerStream { #if defined(STARBOARD) typedef base::OnceCallback>&)> ReadCB; virtual void Read(int max_number_of_buffers_to_read, ReadCB read_cb) = 0; -#else // defined (STARBOARD) +#else // defined(STARBOARD) typedef base::OnceCallback)> ReadCB; virtual void Read(ReadCB read_cb) = 0; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) // Returns the audio/video decoder configuration. It is an error to call the // audio method on a video stream and vice versa. After |kConfigChanged| is diff --git a/third_party/chromium/media/base/starboard_utils.cc b/third_party/chromium/media/base/starboard_utils.cc index 6bc31a1dee9a..5c3580208b0a 100644 --- a/third_party/chromium/media/base/starboard_utils.cc +++ b/third_party/chromium/media/base/starboard_utils.cc @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "media/base/starboard_utils.h" #include diff --git a/third_party/chromium/media/base/starboard_utils.h b/third_party/chromium/media/base/starboard_utils.h index 50920bd698e5..6f908e5e588e 100644 --- a/third_party/chromium/media/base/starboard_utils.h +++ b/third_party/chromium/media/base/starboard_utils.h @@ -15,6 +15,10 @@ #ifndef MEDIA_BASE_STARBOARD_UTILS_H_ #define MEDIA_BASE_STARBOARD_UTILS_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "starboard/drm.h" #include "starboard/media.h" #include "media/base/audio_codecs.h" diff --git a/third_party/chromium/media/base/starboard_utils_test.cc b/third_party/chromium/media/base/starboard_utils_test.cc index ab5460c1015b..a2feb6d2e101 100644 --- a/third_party/chromium/media/base/starboard_utils_test.cc +++ b/third_party/chromium/media/base/starboard_utils_test.cc @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "media/base/starboard_utils.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/third_party/chromium/media/base/status.h b/third_party/chromium/media/base/status.h index 6101e3f938e7..5ddbda4ac604 100644 --- a/third_party/chromium/media/base/status.h +++ b/third_party/chromium/media/base/status.h @@ -17,7 +17,9 @@ #include "media/base/media_export.h" #include "media/base/media_serializers_base.h" #include "media/base/status_codes.h" +#if defined(STARBOARD) #include "third_party/abseil-cpp/absl/types/optional.h" +#endif // defined(STARBOARD) // Mojo namespaces for serialization friend declarations. namespace mojo { diff --git a/third_party/chromium/media/cobalt/base/bind_post_task.h b/third_party/chromium/media/cobalt/base/bind_post_task.h index b914e8adef5b..634a1d7d3411 100644 --- a/third_party/chromium/media/cobalt/base/bind_post_task.h +++ b/third_party/chromium/media/cobalt/base/bind_post_task.h @@ -5,6 +5,10 @@ #ifndef BASE_BIND_POST_TASK_H_ #define BASE_BIND_POST_TASK_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/location.h" namespace base { diff --git a/third_party/chromium/media/cobalt/base/check.h b/third_party/chromium/media/cobalt/base/check.h index d26320bc304d..17464daa91df 100644 --- a/third_party/chromium/media/cobalt/base/check.h +++ b/third_party/chromium/media/cobalt/base/check.h @@ -15,6 +15,10 @@ #ifndef BASE_CHECK_H_ #define BASE_CHECK_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/logging.h" #endif // BASE_CHECK_H_ diff --git a/third_party/chromium/media/cobalt/base/check_op.h b/third_party/chromium/media/cobalt/base/check_op.h index 296c84f099b8..74e046fcb39f 100644 --- a/third_party/chromium/media/cobalt/base/check_op.h +++ b/third_party/chromium/media/cobalt/base/check_op.h @@ -15,6 +15,10 @@ #ifndef BASE_CHECK_OP_H_ #define BASE_CHECK_OP_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/logging.h" #endif // BASE_CHECK_OP_H_ diff --git a/third_party/chromium/media/cobalt/base/cxx17_backports.h b/third_party/chromium/media/cobalt/base/cxx17_backports.h index a7c1c1305656..2f6e2ac8a508 100644 --- a/third_party/chromium/media/cobalt/base/cxx17_backports.h +++ b/third_party/chromium/media/cobalt/base/cxx17_backports.h @@ -15,6 +15,10 @@ #ifndef BASE_CXX17_BACKPORTS_H_ #define BASE_CXX17_BACKPORTS_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/stl_util.h" #endif // BASE_CXX17_BACKPORTS_H_ diff --git a/third_party/chromium/media/cobalt/base/hash/md5.h b/third_party/chromium/media/cobalt/base/hash/md5.h index 2993131d6091..8f9e6c008f0b 100644 --- a/third_party/chromium/media/cobalt/base/hash/md5.h +++ b/third_party/chromium/media/cobalt/base/hash/md5.h @@ -15,6 +15,10 @@ #ifndef BASE_HASH_MD5_H_ #define BASE_HASH_MD5_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/md5.h" #endif // BASE_HASH_MD5_H_ diff --git a/third_party/chromium/media/cobalt/base/notreached.h b/third_party/chromium/media/cobalt/base/notreached.h index 0afca93445f5..4eb09e6241b4 100644 --- a/third_party/chromium/media/cobalt/base/notreached.h +++ b/third_party/chromium/media/cobalt/base/notreached.h @@ -15,6 +15,10 @@ #ifndef BASE_NOTREACHED_H_ #define BASE_NOTREACHED_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "base/logging.h" #endif // BASE_NOTREACHED_H_ diff --git a/third_party/chromium/media/cobalt/base/types/strong_alias.h b/third_party/chromium/media/cobalt/base/types/strong_alias.h index 8c148d46c22f..3fa4447f2387 100644 --- a/third_party/chromium/media/cobalt/base/types/strong_alias.h +++ b/third_party/chromium/media/cobalt/base/types/strong_alias.h @@ -5,6 +5,10 @@ #ifndef BASE_TYPES_STRONG_ALIAS_H_ #define BASE_TYPES_STRONG_ALIAS_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include #include diff --git a/third_party/chromium/media/cobalt/net/cookies/site_for_cookies.h b/third_party/chromium/media/cobalt/net/cookies/site_for_cookies.h index 296e3e4dad70..cf6b0406dfb9 100644 --- a/third_party/chromium/media/cobalt/net/cookies/site_for_cookies.h +++ b/third_party/chromium/media/cobalt/net/cookies/site_for_cookies.h @@ -5,6 +5,10 @@ #ifndef NET_SITE_FOR_COOKIES_H #define NET_SITE_FOR_COOKIES_H +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + namespace net { // Reduced version enough to make media code depending on it to be built. diff --git a/third_party/chromium/media/filters/chunk_demuxer.cc b/third_party/chromium/media/filters/chunk_demuxer.cc index 0bb01f4cd5a6..969ab5f68909 100644 --- a/third_party/chromium/media/filters/chunk_demuxer.cc +++ b/third_party/chromium/media/filters/chunk_demuxer.cc @@ -17,7 +17,7 @@ #include "base/strings/string_number_conversions.h" #if defined(STARBOARD) #include "base/strings/string_split.h" -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "media/base/audio_decoder_config.h" @@ -63,7 +63,6 @@ std::string ExpectedCodecs(const std::string& content_type, } #if defined(STARBOARD) - // Parse type and codecs from mime type. It will return "video/mp4" and // "avc1.42E01E, mp4a.40.2" for "video/mp4; codecs="avc1.42E01E, mp4a.40.2". // Note that this function does minimum validation as the media stack will check @@ -95,8 +94,7 @@ bool ParseMimeType(const std::string& mime_type, std::string* type, // underlying parsers. return true; } - -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) } // namespace @@ -107,10 +105,10 @@ ChunkDemuxerStream::ChunkDemuxerStream(const std::string& mime_type, Type type, MediaTrack::Id media_track_id) : mime_type_(mime_type), type_(type), -#else // defined (STARBOARD) +#else // defined(STARBOARD) ChunkDemuxerStream::ChunkDemuxerStream(Type type, MediaTrack::Id media_track_id) : type_(type), -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) liveness_(DemuxerStream::LIVENESS_UNKNOWN), media_track_id_(media_track_id), state_(UNINITIALIZED), @@ -132,9 +130,9 @@ void ChunkDemuxerStream::AbortReads() { if (read_cb_) { #if defined(STARBOARD) std::move(read_cb_).Run(kAborted, {}); -#else // defined (STARBOARD) +#else // defined(STARBOARD) std::move(read_cb_).Run(kAborted, nullptr); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) } } @@ -156,10 +154,10 @@ void ChunkDemuxerStream::Shutdown() { if (read_cb_) { #if defined(STARBOARD) std::move(read_cb_).Run(DemuxerStream::kOk, {StreamParserBuffer::CreateEOSBuffer()}); -#else // defined (STARBOARD) +#else // defined(STARBOARD) std::move(read_cb_).Run(DemuxerStream::kOk, StreamParserBuffer::CreateEOSBuffer()); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) } } @@ -182,7 +180,7 @@ void ChunkDemuxerStream::Seek(base::TimeDelta time) { #if defined(STARBOARD) write_head_ = time; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) stream_->Seek(time); } @@ -229,7 +227,6 @@ bool ChunkDemuxerStream::EvictCodedFrames(base::TimeDelta media_time, } #if defined(STARBOARD) - base::TimeDelta ChunkDemuxerStream::GetWriteHead() const { base::AutoLock auto_lock(lock_); return write_head_; @@ -246,8 +243,6 @@ void ChunkDemuxerStream::SetStreamMemoryLimitOverride(size_t memory_limit) { base::AutoLock auto_lock(lock_); stream_->set_memory_limit_override(memory_limit); } - - #endif // defined(STARBOARD) void ChunkDemuxerStream::OnMemoryPressure( @@ -335,9 +330,9 @@ bool ChunkDemuxerStream::UpdateAudioConfig(const AudioDecoderConfig& config, DCHECK_EQ(state_, UNINITIALIZED); #if defined(STARBOARD) stream_ = std::make_unique(mime_type_, config, media_log); -#else // defined (STARBOARD) +#else // defined(STARBOARD) stream_ = std::make_unique(config, media_log); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) return true; } @@ -355,9 +350,9 @@ bool ChunkDemuxerStream::UpdateVideoConfig(const VideoDecoderConfig& config, DCHECK_EQ(state_, UNINITIALIZED); #if defined(STARBOARD) stream_ = std::make_unique(mime_type_, config, media_log); -#else // defined (STARBOARD) +#else // defined(STARBOARD) stream_ = std::make_unique(config, media_log); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) return true; } @@ -889,7 +884,6 @@ ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id, } #if defined(STARBOARD) - ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id, const std::string& mime_type) { std::string type, codecs; @@ -901,8 +895,7 @@ ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id, id_to_mime_map_[id] = mime_type; return AddId(id, type, codecs); } - -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) ChunkDemuxer::Status ChunkDemuxer::AddIdInternal( const std::string& id, @@ -1107,7 +1100,6 @@ bool ChunkDemuxer::EvictCodedFrames(const std::string& id, } #if defined(STARBOARD) - base::TimeDelta ChunkDemuxer::GetWriteHead(const std::string& id) const { base::AutoLock auto_lock(lock_); DCHECK(IsValidId(id)); @@ -1138,7 +1130,6 @@ size_t ChunkDemuxer::GetSourceBufferStreamMemoryLimit(const std::string& id) { } return source_state_map_[id]->GetSourceBufferStreamMemoryLimit(); } - #endif // defined(STARBOARD) bool ChunkDemuxer::AppendData(const std::string& id, @@ -1689,7 +1680,7 @@ ChunkDemuxerStream* ChunkDemuxer::CreateDemuxerStream( #else // defined(STARBOARD) std::unique_ptr stream = std::make_unique(type, media_track_id); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) DCHECK(track_id_to_demux_stream_map_.find(media_track_id) == track_id_to_demux_stream_map_.end()); diff --git a/third_party/chromium/media/filters/chunk_demuxer.h b/third_party/chromium/media/filters/chunk_demuxer.h index 76a01f414f41..52ebae4f4e94 100644 --- a/third_party/chromium/media/filters/chunk_demuxer.h +++ b/third_party/chromium/media/filters/chunk_demuxer.h @@ -43,9 +43,9 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream { #if defined(STARBOARD) ChunkDemuxerStream(const std::string& mime_type, Type type, MediaTrack::Id media_track_id); -#else // defined (STARBOARD) +#else // defined(STARBOARD) ChunkDemuxerStream(Type type, MediaTrack::Id media_track_id); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) ~ChunkDemuxerStream() override; // ChunkDemuxerStream control methods. @@ -134,14 +134,10 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream { std::string mime_type() const override { return mime_type_; } size_t GetStreamMemoryLimit(); void SetStreamMemoryLimitOverride(size_t memory_limit); -#endif // defined (STARBOARD) - -#if defined(STARBOARD) void Read(int max_number_of_buffers_to_read, ReadCB read_cb) override; -#else // defined (STARBOARD) +#else // defined(STARBOARD) void Read(ReadCB read_cb) override; -#endif // defined (STARBOARD) - +#endif // defined(STARBOARD) Type type() const override; Liveness liveness() const override; AudioDecoderConfig audio_decoder_config() override; @@ -193,7 +189,7 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream { const std::string mime_type_; int max_number_of_buffers_to_read_{1}; bool pending_config_change_ {false}; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) // Specifies the type of the stream. const Type type_; @@ -295,7 +291,7 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { // Special version of AddId() that retains the |mime_type| from the web app. Status AddId(const std::string& id, const std::string& mime_type) WARN_UNUSED_RESULT; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) // Notifies a caller via |tracks_updated_cb| that the set of media tracks // for a given |id| has changed. This callback must be set before any calls to @@ -394,7 +390,6 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { #if defined(STARBOARD) base::TimeDelta GetWriteHead(const std::string& id) const; - void SetSourceBufferStreamMemoryLimit(const std::string& guid, size_t limit); size_t GetSourceBufferStreamMemoryLimit(const std::string& guid); #endif // defined(STARBOARD) @@ -600,7 +595,7 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { #if defined(STARBOARD) std::map id_to_mime_map_; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) }; } // namespace media diff --git a/third_party/chromium/media/filters/source_buffer_stream.cc b/third_party/chromium/media/filters/source_buffer_stream.cc index f086c3898cd0..0eb0a47bc097 100644 --- a/third_party/chromium/media/filters/source_buffer_stream.cc +++ b/third_party/chromium/media/filters/source_buffer_stream.cc @@ -165,11 +165,11 @@ SourceBufferStream::SourceBufferStream(const std::string& mime_type, MediaLog* media_log) : mime_type_(mime_type), media_log_(media_log), -#else // defined (STARBOARD) +#else // defined(STARBOARD) SourceBufferStream::SourceBufferStream(const AudioDecoderConfig& audio_config, MediaLog* media_log) : media_log_(media_log), -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) seek_buffer_timestamp_(kNoTimestamp), coded_frame_group_start_pts_(kNoTimestamp), range_for_next_append_(ranges_.end()), @@ -188,11 +188,11 @@ SourceBufferStream::SourceBufferStream(const std::string& mime_type, MediaLog* media_log) : mime_type_(mime_type), media_log_(media_log), -#else // defined (STARBOARD) +#else // defined(STARBOARD) SourceBufferStream::SourceBufferStream(const VideoDecoderConfig& video_config, MediaLog* media_log) : media_log_(media_log), -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) seek_buffer_timestamp_(kNoTimestamp), coded_frame_group_start_pts_(kNoTimestamp), range_for_next_append_(ranges_.end()), @@ -201,8 +201,12 @@ SourceBufferStream::SourceBufferStream(const VideoDecoderConfig& video_config, base::Milliseconds(kMinimumInterbufferDistanceInMs)), memory_limit_( GetDemuxerStreamVideoMemoryLimit(Demuxer::DemuxerTypes::kChunkDemuxer, +#if !defined(STARBOARD) + &video_config)) { +#else // !defined(STARBOARD) &video_config, mime_type_)) { +#endif // !defined(STARBOARD) DCHECK(video_config.IsValidConfig()); video_configs_.push_back(video_config); DVLOG(2) << __func__ << ": video_buffer_size= " << memory_limit_; @@ -2086,6 +2090,6 @@ base::TimeDelta SourceBufferStream::GetBufferedDurationForGarbageCollection() return duration; } -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) } // namespace media diff --git a/third_party/chromium/media/filters/source_buffer_stream.h b/third_party/chromium/media/filters/source_buffer_stream.h index 248b38ed40e9..c073ad94dbfa 100644 --- a/third_party/chromium/media/filters/source_buffer_stream.h +++ b/third_party/chromium/media/filters/source_buffer_stream.h @@ -68,12 +68,12 @@ class MEDIA_EXPORT SourceBufferStream { SourceBufferStream(const std::string& mime_type, const VideoDecoderConfig& video_config, MediaLog* media_log); -#else // defined (STARBOARD) +#else // defined(STARBOARD) SourceBufferStream(const AudioDecoderConfig& audio_config, MediaLog* media_log); SourceBufferStream(const VideoDecoderConfig& video_config, MediaLog* media_log); -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) SourceBufferStream(const TextTrackConfig& text_config, MediaLog* media_log); @@ -196,7 +196,7 @@ class MEDIA_EXPORT SourceBufferStream { memory_limit_ = memory_limit; memory_override_ = true; } -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) private: friend class SourceBufferStreamTest; @@ -416,7 +416,7 @@ class MEDIA_EXPORT SourceBufferStream { const std::string mime_type_; bool memory_override_ = false; -#endif // defined (STARBOARD) +#endif // defined(STARBOARD) // Used to report log messages that can help the web developer figure out what // is wrong with the content. diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h index 169ef2f693f5..6dadcc95eae2 100644 --- a/ui/gfx/color_space.h +++ b/ui/gfx/color_space.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_COLOR_SPACE_H_ #define UI_GFX_COLOR_SPACE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/color_space_export.h b/ui/gfx/color_space_export.h index a0402b73cf07..86f1e97f749a 100644 --- a/ui/gfx/color_space_export.h +++ b/ui/gfx/color_space_export.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_COLOR_SPACE_EXPORT_H_ #define UI_GFX_COLOR_SPACE_EXPORT_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #if defined(COMPONENT_BUILD) #if defined(WIN32) diff --git a/ui/gfx/geometry/point.cc b/ui/gfx/geometry/point.cc index f167f200c2e3..b4d3745d4fde 100644 --- a/ui/gfx/geometry/point.cc +++ b/ui/gfx/geometry/point.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "ui/gfx/geometry/point.h" #include "base/strings/stringprintf.h" diff --git a/ui/gfx/geometry/point.h b/ui/gfx/geometry/point.h index 3d02ccf4cfe4..00fb6c472fd0 100644 --- a/ui/gfx/geometry/point.h +++ b/ui/gfx/geometry/point.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_POINT_H_ #define UI_GFX_GEOMETRY_POINT_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/point3_f.h b/ui/gfx/geometry/point3_f.h index 07b95c093c42..b51712974b27 100644 --- a/ui/gfx/geometry/point3_f.h +++ b/ui/gfx/geometry/point3_f.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_POINT3_F_H_ #define UI_GFX_GEOMETRY_POINT3_F_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/point_base.h b/ui/gfx/geometry/point_base.h index 43eea5025171..a1cd4d284aee 100644 --- a/ui/gfx/geometry/point_base.h +++ b/ui/gfx/geometry/point_base.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_POINT_BASE_H_ #define UI_GFX_GEOMETRY_POINT_BASE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include namespace gfx { diff --git a/ui/gfx/geometry/point_f.cc b/ui/gfx/geometry/point_f.cc index 4808ab7a20d4..c5a6ef99636d 100644 --- a/ui/gfx/geometry/point_f.cc +++ b/ui/gfx/geometry/point_f.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "ui/gfx/geometry/point_f.h" #include "base/strings/stringprintf.h" diff --git a/ui/gfx/geometry/point_f.h b/ui/gfx/geometry/point_f.h index 6dd12ffac9e5..ad0a56f5818f 100644 --- a/ui/gfx/geometry/point_f.h +++ b/ui/gfx/geometry/point_f.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_POINT_F_H_ #define UI_GFX_GEOMETRY_POINT_F_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/rect.h b/ui/gfx/geometry/rect.h index c980174b6ec3..f60ec7fd67c6 100644 --- a/ui/gfx/geometry/rect.h +++ b/ui/gfx/geometry/rect.h @@ -12,6 +12,10 @@ #ifndef UI_GFX_GEOMETRY_RECT_H_ #define UI_GFX_GEOMETRY_RECT_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include #include diff --git a/ui/gfx/geometry/rect_base.h b/ui/gfx/geometry/rect_base.h index 0cec1ea948d2..6661a7734a01 100644 --- a/ui/gfx/geometry/rect_base.h +++ b/ui/gfx/geometry/rect_base.h @@ -12,6 +12,10 @@ #ifndef UI_GFX_GEOMETRY_RECT_BASE_H_ #define UI_GFX_GEOMETRY_RECT_BASE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include namespace gfx { diff --git a/ui/gfx/geometry/rect_base_impl.h b/ui/gfx/geometry/rect_base_impl.h index 09ee7f3446a8..9dda2746ea58 100644 --- a/ui/gfx/geometry/rect_base_impl.h +++ b/ui/gfx/geometry/rect_base_impl.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_RECT_BASE_IMPL_H_ #define UI_GFX_GEOMETRY_RECT_BASE_IMPL_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/size.h b/ui/gfx/geometry/size.h index 3e5a5b64a79f..4b617094b838 100644 --- a/ui/gfx/geometry/size.h +++ b/ui/gfx/geometry/size.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_SIZE_H_ #define UI_GFX_GEOMETRY_SIZE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/size_base.h b/ui/gfx/geometry/size_base.h index b535b3f818d1..327be54b33dd 100644 --- a/ui/gfx/geometry/size_base.h +++ b/ui/gfx/geometry/size_base.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_SIZE_BASE_H_ #define UI_GFX_GEOMETRY_SIZE_BASE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + namespace gfx { // A size has width and height values. diff --git a/ui/gfx/geometry/size_f.h b/ui/gfx/geometry/size_f.h index 587f19e4f972..63266e11a3b2 100644 --- a/ui/gfx/geometry/size_f.h +++ b/ui/gfx/geometry/size_f.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_GEOMETRY_SIZE_F_H_ #define UI_GFX_GEOMETRY_SIZE_F_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/vector2d.h b/ui/gfx/geometry/vector2d.h index 86ad260de504..cef79fd70239 100644 --- a/ui/gfx/geometry/vector2d.h +++ b/ui/gfx/geometry/vector2d.h @@ -10,6 +10,10 @@ #ifndef UI_GFX_GEOMETRY_VECTOR2D_H_ #define UI_GFX_GEOMETRY_VECTOR2D_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/geometry/vector2d_f.h b/ui/gfx/geometry/vector2d_f.h index f97ef00d3865..76ea59cc2abc 100644 --- a/ui/gfx/geometry/vector2d_f.h +++ b/ui/gfx/geometry/vector2d_f.h @@ -10,6 +10,10 @@ #ifndef UI_GFX_GEOMETRY_VECTOR2D_F_H_ #define UI_GFX_GEOMETRY_VECTOR2D_F_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include #include diff --git a/ui/gfx/hdr_metadata.h b/ui/gfx/hdr_metadata.h index 8828158b2e78..17458de10535 100644 --- a/ui/gfx/hdr_metadata.h +++ b/ui/gfx/hdr_metadata.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_HDR_METADATA_H_ #define UI_GFX_HDR_METADATA_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + #include "media/base/media_export.h" #include "ui/gfx/geometry/point_f.h" diff --git a/ui/gfx/native_pixmap_handle.h b/ui/gfx/native_pixmap_handle.h index d0d769b05ac0..757b63254e8b 100644 --- a/ui/gfx/native_pixmap_handle.h +++ b/ui/gfx/native_pixmap_handle.h @@ -5,6 +5,10 @@ #ifndef UI_GFX_NATIVE_PIXMAP_HANDLE_H_ #define UI_GFX_NATIVE_PIXMAP_HANDLE_H_ +#if !defined(STARBOARD) +#error "This file only works with Cobalt/Starboard." +#endif // !defined(STARBOARD) + // A reduced version of `native_pixmap_handle.h` enough to make required files // in Chromium media to be built.