diff --git a/app/packager_main.cc b/app/packager_main.cc index 37aab4cb7e..7e36e3ac07 100644 --- a/app/packager_main.cc +++ b/app/packager_main.cc @@ -102,7 +102,7 @@ bool GetMuxerOptions(MuxerOptions* muxer_options) { // Create a temp file if needed. if (muxer_options->single_segment && muxer_options->temp_file_name.empty()) { base::FilePath path; - if (!file_util::CreateTemporaryFile(&path)) { + if (!base::CreateTemporaryFile(&path)) { LOG(ERROR) << "Failed to create a temporary file."; return false; } diff --git a/ipc/README.packager b/ipc/README.packager new file mode 100644 index 0000000000..bccc3d499d --- /dev/null +++ b/ipc/README.packager @@ -0,0 +1,7 @@ +Description: +This directory is included to resolve base/metrics/stats_table.cc dependency +on ipc/ipc_descriptors.h. + +File(s): +ipc/ipc_descritors.h + diff --git a/ipc/ipc_descriptors.h b/ipc/ipc_descriptors.h new file mode 100644 index 0000000000..41560df64b --- /dev/null +++ b/ipc/ipc_descriptors.h @@ -0,0 +1,19 @@ +// Copyright (c) 2009 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 IPC_IPC_DESCRIPTORS_H_ +#define IPC_IPC_DESCRIPTORS_H_ + +// This is a list of global descriptor keys to be used with the +// base::GlobalDescriptors object (see base/posix/global_descriptors.h) +enum { + kPrimaryIPCChannel = 0, + kStatsTableSharedMemFd, + + // The first key that can be use to register descriptors. + kIPCDescriptorMax + +}; + +#endif // IPC_IPC_DESCRIPTORS_H_ diff --git a/media/base/buffer_writer.h b/media/base/buffer_writer.h index 8f92d16e79..3493bad091 100644 --- a/media/base/buffer_writer.h +++ b/media/base/buffer_writer.h @@ -12,6 +12,7 @@ #include +#include "base/stl_util.h" #include "media/base/status.h" namespace media { @@ -48,8 +49,8 @@ class BufferWriter { void Swap(BufferWriter* buffer) { buf_.swap(buffer->buf_); } void Clear() { buf_.clear(); } size_t Size() const { return buf_.size(); } - // Return underlying buffer. Behavior is undefined if the buffer size is 0. - const uint8* Buffer() const { return &buf_[0]; } + // Return underlying buffer. Return NULL if the buffer is empty. + const uint8* Buffer() const { return vector_as_array(&buf_); } // Write the buffer to file. |file| should not be NULL. // Returns OK on success. The internal buffer will be cleared after writing. diff --git a/media/base/buffer_writer_unittest.cc b/media/base/buffer_writer_unittest.cc index 692142ca2c..7d0f0d1087 100644 --- a/media/base/buffer_writer_unittest.cc +++ b/media/base/buffer_writer_unittest.cc @@ -36,9 +36,11 @@ namespace media { class BufferWriterTest : public testing::Test { public: - BufferWriterTest() - : writer_(new BufferWriter(kReservedBufferCapacity)), - reader_(new BufferReader(writer_->Buffer(), kReservedBufferCapacity)) {} + BufferWriterTest() : writer_(new BufferWriter(kReservedBufferCapacity)) {} + + void CreateReader() { + reader_.reset(new BufferReader(writer_->Buffer(), writer_->Size())); + } bool ReadInt(uint8* v) { return reader_->Read1(v); } bool ReadInt(uint16* v) { return reader_->Read2(v); } @@ -61,6 +63,8 @@ class BufferWriterTest : public testing::Test { writer_->AppendInt(max); writer_->AppendInt(val); ASSERT_EQ(sizeof(min) + sizeof(max) + sizeof(val), writer_->Size()); + + CreateReader(); ReadAndExpect(min); ReadAndExpect(max); ReadAndExpect(val); @@ -86,6 +90,8 @@ TEST_F(BufferWriterTest, AppendNBytes) { // Write the least significant four bytes and verify the result. writer_->AppendNBytes(kuint64, sizeof(uint32)); ASSERT_EQ(sizeof(uint32), writer_->Size()); + + CreateReader(); ReadAndExpect(static_cast(kuint64 & 0xFFFFFFFF)); } @@ -100,6 +106,7 @@ TEST_F(BufferWriterTest, AppendVector) { writer_->AppendVector(v); ASSERT_EQ(sizeof(kuint8Array), writer_->Size()); + CreateReader(); std::vector data_read; ASSERT_TRUE(reader_->ReadToVector(&data_read, sizeof(kuint8Array))); ASSERT_EQ(v, data_read); @@ -109,6 +116,7 @@ TEST_F(BufferWriterTest, AppendArray) { writer_->AppendArray(kuint8Array, sizeof(kuint8Array)); ASSERT_EQ(sizeof(kuint8Array), writer_->Size()); + CreateReader(); std::vector data_read; ASSERT_TRUE(reader_->ReadToVector(&data_read, sizeof(kuint8Array))); for (size_t i = 0; i < sizeof(kuint8Array); ++i) @@ -124,6 +132,7 @@ TEST_F(BufferWriterTest, AppendBufferWriter) { ASSERT_EQ(sizeof(kuint16) + sizeof(kint64) + sizeof(kuint32), writer_->Size()); + CreateReader(); ASSERT_NO_FATAL_FAILURE(ReadAndExpect(kuint16)); ASSERT_NO_FATAL_FAILURE(ReadAndExpect(kint64)); ASSERT_NO_FATAL_FAILURE(ReadAndExpect(kuint32)); @@ -139,7 +148,7 @@ TEST_F(BufferWriterTest, Swap) { ASSERT_EQ(sizeof(kuint16) + sizeof(kint64), writer_->Size()); ASSERT_EQ(sizeof(kuint32), local_writer.Size()); - reader_.reset(new BufferReader(writer_->Buffer(), writer_->Size())); + CreateReader(); ASSERT_NO_FATAL_FAILURE(ReadAndExpect(kuint16)); ASSERT_NO_FATAL_FAILURE(ReadAndExpect(kint64)); } @@ -153,7 +162,7 @@ TEST_F(BufferWriterTest, Clear) { TEST_F(BufferWriterTest, WriteToFile) { base::FilePath path; - ASSERT_TRUE(file_util::CreateTemporaryFile(&path)); + ASSERT_TRUE(base::CreateTemporaryFile(&path)); LOG(INFO) << "Created temporary file: " << path.value(); // Append an array to buffer and then write to the temporary file. diff --git a/media/base/container_names_unittest.cc b/media/base/container_names_unittest.cc index 4f78d6093b..dadd523634 100644 --- a/media/base/container_names_unittest.cc +++ b/media/base/container_names_unittest.cc @@ -108,9 +108,9 @@ void TestFile(MediaContainerName expected, const base::FilePath& filename) { // so use file length if file less than 8192 bytes (http://crbug.com/243885). int read_size = sizeof(buffer); int64 actual_size; - if (file_util::GetFileSize(filename, &actual_size) && actual_size < read_size) + if (base::GetFileSize(filename, &actual_size) && actual_size < read_size) read_size = actual_size; - int read = file_util::ReadFile(filename, buffer, read_size); + int read = base::ReadFile(filename, buffer, read_size); // Now verify the type. EXPECT_EQ(expected, diff --git a/media/base/fake_prng.cc b/media/base/fake_prng.cc index bb830acfcf..74ef19e5b4 100644 --- a/media/base/fake_prng.cc +++ b/media/base/fake_prng.cc @@ -50,7 +50,7 @@ bool StartFakePrng() { // Open deterministic random data file and set the OpenSSL PRNG. g_rand_source_fp = - file_util::OpenFile(GetTestDataFilePath(kFakePrngDataFile), "rb"); + base::OpenFile(GetTestDataFilePath(kFakePrngDataFile), "rb"); if (!g_rand_source_fp) { LOG(ERROR) << "Cannot open " << kFakePrngDataFile; return false; @@ -61,7 +61,7 @@ bool StartFakePrng() { void StopFakePrng() { if (g_rand_source_fp) { - file_util::CloseFile(g_rand_source_fp); + base::CloseFile(g_rand_source_fp); g_rand_source_fp = NULL; } else { LOG(WARNING) << "Fake PRNG not started."; diff --git a/media/base/httpfetcher_unittest.cc b/media/base/httpfetcher_unittest.cc index 30d0e6dbee..c259bfe4cb 100644 --- a/media/base/httpfetcher_unittest.cc +++ b/media/base/httpfetcher_unittest.cc @@ -33,7 +33,7 @@ static void CheckHttpGet(const std::string& url, HTTPFetcher fetcher; std::string response; ASSERT_OK(fetcher.Get(url, &response)); - RemoveChars(response, "\r\n\t ", &response); + base::RemoveChars(response, "\r\n\t ", &response); EXPECT_EQ(expected_response, response); } @@ -42,7 +42,7 @@ static void CheckHttpPost(const std::string& url, const std::string& data, HTTPFetcher fetcher; std::string response; ASSERT_OK(fetcher.Post(url, data, &response)); - RemoveChars(response, "\r\n\t ", &response); + base::RemoveChars(response, "\r\n\t ", &response); EXPECT_EQ(expected_response, response); } diff --git a/media/base/media_base.gyp b/media/base/media_base.gyp index 8f7db84f66..320e7eb86e 100644 --- a/media/base/media_base.gyp +++ b/media/base/media_base.gyp @@ -134,6 +134,7 @@ 'dependencies': [ '../../testing/gtest.gyp:gtest', '../../testing/gmock.gyp:gmock', + '../../third_party/openssl/openssl.gyp:openssl', '../file/file.gyp:file', '../test/media_test.gyp:media_test_support', 'base', diff --git a/media/base/widevine_encryptor_source.cc b/media/base/widevine_encryptor_source.cc index fdcf88b30c..b0b3edc512 100644 --- a/media/base/widevine_encryptor_source.cc +++ b/media/base/widevine_encryptor_source.cc @@ -177,7 +177,7 @@ void WidevineEncryptorSource::FillRequest(const std::string& content_id, DCHECK(request); std::string content_id_base64_string; - CHECK(base::Base64Encode(content_id, &content_id_base64_string)); + base::Base64Encode(content_id, &content_id_base64_string); base::DictionaryValue request_dict; request_dict.SetString("content_id", content_id_base64_string); @@ -218,10 +218,10 @@ Status WidevineEncryptorSource::SignRequest(const std::string& request, // Encode request and signature using Base64 encoding. std::string request_base64_string; - CHECK(base::Base64Encode(request, &request_base64_string)); + base::Base64Encode(request, &request_base64_string); std::string signature_base64_string; - CHECK(base::Base64Encode(signature, &signature_base64_string)); + base::Base64Encode(signature, &signature_base64_string); base::DictionaryValue signed_request_dict; signed_request_dict.SetString("request", request_base64_string); diff --git a/media/event/vod_media_info_dump_muxer_listener_unittest.cc b/media/event/vod_media_info_dump_muxer_listener_unittest.cc index c153b77deb..15327441fe 100644 --- a/media/event/vod_media_info_dump_muxer_listener_unittest.cc +++ b/media/event/vod_media_info_dump_muxer_listener_unittest.cc @@ -8,6 +8,7 @@ #include "base/file_util.h" #include "base/files/file_path.h" +#include "base/stl_util.h" #include "media/event/vod_media_info_dump_muxer_listener.h" #include "media/file/file.h" #include "media/base/muxer_options.h" @@ -61,7 +62,7 @@ scoped_refptr CreateVideoStreamInfo( param.width, param.height, param.nalu_length_size, - ¶m.extra_data[0], + vector_as_array(¶m.extra_data), param.extra_data.size(), param.is_encrypted)); } @@ -152,7 +153,7 @@ class VodMediaInfoDumpMuxerListenerTest : public ::testing::Test { virtual ~VodMediaInfoDumpMuxerListenerTest() {} virtual void SetUp() OVERRIDE { - ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path_)); + ASSERT_TRUE(base::CreateTemporaryFile(&temp_file_path_)); DLOG(INFO) << "Created temp file: " << temp_file_path_.value(); temp_file_ = File::Open(temp_file_path_.value().c_str(), "w"); diff --git a/media/file/file_unittest.cc b/media/file/file_unittest.cc index 3eee7b10b8..e17d907b00 100644 --- a/media/file/file_unittest.cc +++ b/media/file/file_unittest.cc @@ -64,7 +64,7 @@ TEST_F(LocalFileTest, Write) { // Read file using file_util API. std::string read_data(kDataSize, 0); ASSERT_EQ(kDataSize, - file_util::ReadFile(test_file_path_, &read_data[0], kDataSize)); + base::ReadFile(test_file_path_, &read_data[0], kDataSize)); // Compare data written and read. EXPECT_EQ(data_, read_data); diff --git a/media/file/local_file.cc b/media/file/local_file.cc index c5c9edeb70..118c8530d0 100644 --- a/media/file/local_file.cc +++ b/media/file/local_file.cc @@ -16,14 +16,14 @@ LocalFile::LocalFile(const char* name, const char* mode) bool LocalFile::Open() { internal_file_ = - file_util::OpenFile(base::FilePath(file_name()), file_mode_.c_str()); + base::OpenFile(base::FilePath(file_name()), file_mode_.c_str()); return (internal_file_ != NULL); } bool LocalFile::Close() { bool result = true; if (internal_file_) { - result = file_util::CloseFile(internal_file_); + result = base::CloseFile(internal_file_); internal_file_ = NULL; } delete this; @@ -52,7 +52,7 @@ int64 LocalFile::Size() { } int64 file_size; - if (!file_util::GetFileSize(base::FilePath(file_name()), &file_size)) { + if (!base::GetFileSize(base::FilePath(file_name()), &file_size)) { LOG(ERROR) << "Cannot get file size."; return -1; } diff --git a/media/mp4/chunk_info_iterator.cc b/media/mp4/chunk_info_iterator.cc index afdbb9192a..a7313628ba 100644 --- a/media/mp4/chunk_info_iterator.cc +++ b/media/mp4/chunk_info_iterator.cc @@ -22,6 +22,7 @@ ChunkInfoIterator::ChunkInfoIterator(const SampleToChunk& sample_to_chunk) if (iterator_ != chunk_info_table_.end()) current_chunk_ = iterator_->first_chunk; } +ChunkInfoIterator::~ChunkInfoIterator() {} bool ChunkInfoIterator::AdvanceChunk() { ++current_chunk_; diff --git a/media/mp4/chunk_info_iterator.h b/media/mp4/chunk_info_iterator.h index 1719f4c990..bbdfef9ee9 100644 --- a/media/mp4/chunk_info_iterator.h +++ b/media/mp4/chunk_info_iterator.h @@ -21,6 +21,7 @@ namespace mp4 { class ChunkInfoIterator { public: explicit ChunkInfoIterator(const SampleToChunk& sample_to_chunk); + ~ChunkInfoIterator(); // Advance the properties to refer to the next chunk. Return status // indicating whether the chunk is still valid. diff --git a/media/mp4/composition_offset_iterator.cc b/media/mp4/composition_offset_iterator.cc index c013b2e15d..7c66513f59 100644 --- a/media/mp4/composition_offset_iterator.cc +++ b/media/mp4/composition_offset_iterator.cc @@ -16,6 +16,7 @@ CompositionOffsetIterator::CompositionOffsetIterator( : sample_index_(0), composition_offset_table_(composition_time_to_sample.composition_offset), iterator_(composition_offset_table_.begin()) {} +CompositionOffsetIterator::~CompositionOffsetIterator() {} bool CompositionOffsetIterator::AdvanceSample() { ++sample_index_; diff --git a/media/mp4/composition_offset_iterator.h b/media/mp4/composition_offset_iterator.h index 9bd0e9802f..a13003661a 100644 --- a/media/mp4/composition_offset_iterator.h +++ b/media/mp4/composition_offset_iterator.h @@ -23,6 +23,7 @@ class CompositionOffsetIterator { public: explicit CompositionOffsetIterator( const CompositionTimeToSample& composition_time_to_sample); + ~CompositionOffsetIterator(); // Advance the properties to refer to the next sample. Return status // indicating whether the sample is still valid. diff --git a/media/mp4/decoding_time_iterator.cc b/media/mp4/decoding_time_iterator.cc index 6250a55f31..9657ea61ce 100644 --- a/media/mp4/decoding_time_iterator.cc +++ b/media/mp4/decoding_time_iterator.cc @@ -18,6 +18,7 @@ DecodingTimeIterator::DecodingTimeIterator( : sample_index_(0), decoding_time_table_(decoding_time_to_sample.decoding_time), iterator_(decoding_time_table_.begin()) {} +DecodingTimeIterator::~DecodingTimeIterator() {} bool DecodingTimeIterator::AdvanceSample() { ++sample_index_; diff --git a/media/mp4/decoding_time_iterator.h b/media/mp4/decoding_time_iterator.h index 4ee7018b40..26c480a920 100644 --- a/media/mp4/decoding_time_iterator.h +++ b/media/mp4/decoding_time_iterator.h @@ -23,6 +23,7 @@ class DecodingTimeIterator { public: explicit DecodingTimeIterator( const DecodingTimeToSample& decoding_time_to_sample); + ~DecodingTimeIterator(); // Advance the properties to refer to the next sample. Return status // indicating whether the sample is still valid. diff --git a/media/mp4/sync_sample_iterator.cc b/media/mp4/sync_sample_iterator.cc index c68a297d63..4a185685ad 100644 --- a/media/mp4/sync_sample_iterator.cc +++ b/media/mp4/sync_sample_iterator.cc @@ -16,6 +16,7 @@ SyncSampleIterator::SyncSampleIterator(const SyncSample& sync_sample) sync_sample_vector_(sync_sample.sample_number), iterator_(sync_sample_vector_.begin()), is_empty_(iterator_ == sync_sample_vector_.end()) {} +SyncSampleIterator::~SyncSampleIterator() {} bool SyncSampleIterator::AdvanceSample() { if (iterator_ != sync_sample_vector_.end() && sample_number_ == *iterator_) diff --git a/media/mp4/sync_sample_iterator.h b/media/mp4/sync_sample_iterator.h index 71d479ec3b..050f2d7c66 100644 --- a/media/mp4/sync_sample_iterator.h +++ b/media/mp4/sync_sample_iterator.h @@ -21,6 +21,7 @@ namespace mp4 { class SyncSampleIterator { public: explicit SyncSampleIterator(const SyncSample& sync_sample); + ~SyncSampleIterator(); // Advance the properties to refer to the next sample. Return status // indicating whether the sample is still valid. diff --git a/media/test/packager_test.cc b/media/test/packager_test.cc index 49de6c727a..52a3743943 100644 --- a/media/test/packager_test.cc +++ b/media/test/packager_test.cc @@ -51,8 +51,7 @@ class PackagerTest : public ::testing::TestWithParam { public: virtual void SetUp() OVERRIDE { // Create a test directory for testing, will be deleted after test. - ASSERT_TRUE( - file_util::CreateNewTempDirectory("packager_", &test_directory_)); + ASSERT_TRUE(base::CreateNewTempDirectory("packager_", &test_directory_)); options_.segment_duration = kSegmentDurationInSeconds; options_.fragment_duration = kFragmentDurationInSecodns; diff --git a/media/test/test_data_util.cc b/media/test/test_data_util.cc index 9180c229f0..36b2dc28ee 100644 --- a/media/test/test_data_util.cc +++ b/media/test/test_data_util.cc @@ -23,7 +23,7 @@ base::FilePath GetTestDataFilePath(const std::string& name) { std::vector ReadTestDataFile(const std::string& name) { std::string buffer; - CHECK(file_util::ReadFileToString(GetTestDataFilePath(name), &buffer)); + CHECK(base::ReadFileToString(GetTestDataFilePath(name), &buffer)); return std::vector(buffer.begin(), buffer.end()); } diff --git a/mpd/test/mpd_builder_test_helper.cc b/mpd/test/mpd_builder_test_helper.cc index 0f5e39b364..8f65cdde31 100644 --- a/mpd/test/mpd_builder_test_helper.cc +++ b/mpd/test/mpd_builder_test_helper.cc @@ -40,7 +40,7 @@ base::FilePath GetSchemaPath() { std::string GetPathContent(const base::FilePath& file_path) { std::string content; - bool file_read_to_string = file_util::ReadFileToString(file_path, &content); + bool file_read_to_string = base::ReadFileToString(file_path, &content); DCHECK(file_read_to_string); return content; } @@ -99,8 +99,8 @@ void ExpectMpdToEqualExpectedOutputFile( const std::string& mpd_string, const std::string& expected_output_file) { std::string expected_mpd; - ASSERT_TRUE(file_util::ReadFileToString( - GetTestDataFilePath(expected_output_file), &expected_mpd)) + ASSERT_TRUE(base::ReadFileToString(GetTestDataFilePath(expected_output_file), + &expected_mpd)) << "Failed to read: " << expected_output_file; // Adding extra << here to get a formatted output. diff --git a/net/README.packager b/net/README.packager new file mode 100644 index 0000000000..d60c263a81 --- /dev/null +++ b/net/README.packager @@ -0,0 +1,15 @@ +Description: +This directory is included to resolve gyp dependency on *.isolate when parsing +base.gyp. Although the involved target is supposed to compiled off, gyp +still tries to locate the included *.isolate. Refer below for the dependency +chain. + +Dependency Chain: +base/base.gyp <= base/base_unittests.isolate <= base/base.isolate + <= build/linux/system.isolate <= net/third_party/nss/ssl.isolate + <= net/third_party/nss/ssl_base.isolate + +File(s): +net/third_party/nss/ssl_base.isolate +net/third_party/nss/ssl.isolate + diff --git a/net/third_party/nss/ssl.isolate b/net/third_party/nss/ssl.isolate new file mode 100644 index 0000000000..f538e82e84 --- /dev/null +++ b/net/third_party/nss/ssl.isolate @@ -0,0 +1,24 @@ +# Copyright 2014 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. +{ + 'conditions': [ + ['OS=="mac" and component=="shared_library"', { + 'variables': { + 'isolate_dependency_tracked': [ + '<(PRODUCT_DIR)/libcrssl.dylib', + ], + }, + }], + ['OS=="win" and component=="shared_library"', { + 'variables': { + 'isolate_dependency_tracked': [ + '<(PRODUCT_DIR)/crssl.dll', + ], + }, + }], + ], + 'includes': [ + 'ssl_base.isolate', + ], +} diff --git a/net/third_party/nss/ssl_base.isolate b/net/third_party/nss/ssl_base.isolate new file mode 100644 index 0000000000..3bae2bdd39 --- /dev/null +++ b/net/third_party/nss/ssl_base.isolate @@ -0,0 +1,16 @@ +# Copyright 2014 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. +# +# This is what is included by base_unittests. +{ + 'conditions': [ + ['OS=="linux" and component=="shared_library" and use_openssl==0', { + 'variables': { + 'isolate_dependency_tracked': [ + '<(PRODUCT_DIR)/lib/libcrssl.so', + ], + }, + }], + ], +} diff --git a/testing/gtest b/testing/gtest index a6772271f7..74de57c951 160000 --- a/testing/gtest +++ b/testing/gtest @@ -1 +1 @@ -Subproject commit a6772271f71672e889776bfe49ec4efd9da036df +Subproject commit 74de57c951aedebc5dfe26a27604353432392b98 diff --git a/third_party/icu b/third_party/icu index e39fea8978..e49b610806 160000 --- a/third_party/icu +++ b/third_party/icu @@ -1 +1 @@ -Subproject commit e39fea897879c8004609e382d1e568a85c3ab345 +Subproject commit e49b610806e6ba6063384ffd7f45d5b7cd561e65 diff --git a/third_party/openssl b/third_party/openssl index 8f54aac19a..bab551292a 160000 --- a/third_party/openssl +++ b/third_party/openssl @@ -1 +1 @@ -Subproject commit 8f54aac19a36d72ea630c813cae51c81a3cc0d78 +Subproject commit bab551292a524df842435aded34751e598bfe30d diff --git a/tools/gyp b/tools/gyp index 793f69bbc0..4bb2a15a7a 160000 --- a/tools/gyp +++ b/tools/gyp @@ -1 +1 @@ -Subproject commit 793f69bbc09792052636dbe6038678b24d68e11b +Subproject commit 4bb2a15a7a77d11fb1d36b077c926b740f50c8da