diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-07 16:10:47 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-07 16:10:47 +0000 |
commit | 9ec0f9c97357dd5b4dd9deae252f8d3633ad38a9 (patch) | |
tree | 061c0b2fb922a0e0f710d8399c6f45cbd5f2e8df /webkit | |
parent | 93a99125d4826e560c9a51603279eae9a7390694 (diff) | |
download | chromium_src-9ec0f9c97357dd5b4dd9deae252f8d3633ad38a9.zip chromium_src-9ec0f9c97357dd5b4dd9deae252f8d3633ad38a9.tar.gz chromium_src-9ec0f9c97357dd5b4dd9deae252f8d3633ad38a9.tar.bz2 |
Rewrite scoped_array<T> to scoped_ptr<T[]> in media/ and webkit/.
This changelist was automatically generated using a clang tool.
BUG=171111
Review URL: https://codereview.chromium.org/13752002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
21 files changed, 41 insertions, 41 deletions
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc index 47dc311..19db330 100644 --- a/webkit/fileapi/file_system_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_url_request_job_unittest.cc @@ -235,7 +235,7 @@ TEST_F(FileSystemURLRequestJobTest, FileTest) { TEST_F(FileSystemURLRequestJobTest, FileTestFullSpecifiedRange) { const size_t buffer_size = 4000; - scoped_array<char> buffer(new char[buffer_size]); + scoped_ptr<char[]> buffer(new char[buffer_size]); FillBuffer(buffer.get(), buffer_size); WriteFile("bigfile", buffer.get(), buffer_size); @@ -259,7 +259,7 @@ TEST_F(FileSystemURLRequestJobTest, FileTestFullSpecifiedRange) { TEST_F(FileSystemURLRequestJobTest, FileTestHalfSpecifiedRange) { const size_t buffer_size = 4000; - scoped_array<char> buffer(new char[buffer_size]); + scoped_ptr<char[]> buffer(new char[buffer_size]); FillBuffer(buffer.get(), buffer_size); WriteFile("bigfile", buffer.get(), buffer_size); diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index a1e4b51..689ee34 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -1150,7 +1150,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::getActiveAttrib( program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_name_length); if (max_name_length < 0) return false; - scoped_array<GLchar> name(new GLchar[max_name_length]); + scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); if (!name.get()) { synthesizeGLError(GL_OUT_OF_MEMORY); return false; @@ -1177,7 +1177,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::getActiveUniform( program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length); if (max_name_length < 0) return false; - scoped_array<GLchar> name(new GLchar[max_name_length]); + scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); if (!name.get()) { synthesizeGLError(GL_OUT_OF_MEMORY); return false; @@ -1245,7 +1245,7 @@ WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: gl_->GetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength); if (!logLength) return WebKit::WebString(); - scoped_array<GLchar> log(new GLchar[logLength]); + scoped_ptr<GLchar[]> log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); GLsizei returnedLogLength = 0; @@ -1269,7 +1269,7 @@ WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: gl_->GetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength); if (!logLength) return WebKit::WebString(); - scoped_array<GLchar> log(new GLchar[logLength]); + scoped_ptr<GLchar[]> log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); GLsizei returnedLogLength = 0; @@ -1291,7 +1291,7 @@ WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: gl_->GetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &logLength); if (!logLength) return WebKit::WebString(); - scoped_array<GLchar> log(new GLchar[logLength]); + scoped_ptr<GLchar[]> log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); GLsizei returnedLogLength = 0; @@ -1313,7 +1313,7 @@ WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl:: shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, &logLength); if (!logLength) return WebKit::WebString(); - scoped_array<GLchar> log(new GLchar[logLength]); + scoped_ptr<GLchar[]> log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); GLsizei returnedLogLength = 0; diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index a810c1c..36ce3d2 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -40,9 +40,9 @@ struct WebGraphicsContext3DInProcessImpl::ShaderSourceEntry { } WGC3Denum type; - scoped_array<char> source; - scoped_array<char> log; - scoped_array<char> translated_source; + scoped_ptr<char[]> source; + scoped_ptr<char[]> log; + scoped_ptr<char[]> translated_source; bool is_valid; }; @@ -1080,7 +1080,7 @@ bool WebGraphicsContext3DInProcessImpl::getActiveAttrib( glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_name_length); if (max_name_length < 0) return false; - scoped_array<GLchar> name(new GLchar[max_name_length]); + scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); GLsizei length = 0; GLint size = -1; GLenum type = 0; @@ -1102,7 +1102,7 @@ bool WebGraphicsContext3DInProcessImpl::getActiveUniform( glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length); if (max_name_length < 0) return false; - scoped_array<GLchar> name(new GLchar[max_name_length]); + scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); GLsizei length = 0; GLint size = -1; GLenum type = 0; @@ -1202,7 +1202,7 @@ WebString WebGraphicsContext3DInProcessImpl::getProgramInfoLog( glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_length); if (!log_length) return WebString(); - scoped_array<GLchar> log(new GLchar[log_length]); + scoped_ptr<GLchar[]> log(new GLchar[log_length]); GLsizei returned_log_length; glGetProgramInfoLog(program, log_length, &returned_log_length, log.get()); DCHECK(log_length == returned_log_length + 1); @@ -1305,7 +1305,7 @@ WebString WebGraphicsContext3DInProcessImpl::getShaderInfoLog(WebGLId shader) { glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_length); if (log_length <= 1) return WebString(); - scoped_array<GLchar> log(new GLchar[log_length]); + scoped_ptr<GLchar[]> log(new GLchar[log_length]); GLsizei returned_log_length; glGetShaderInfoLog(shader, log_length, &returned_log_length, log.get()); DCHECK(log_length == returned_log_length + 1); @@ -1331,7 +1331,7 @@ WebString WebGraphicsContext3DInProcessImpl::getShaderSource(WebGLId shader) { glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &log_length); if (log_length <= 1) return WebString(); - scoped_array<GLchar> log(new GLchar[log_length]); + scoped_ptr<GLchar[]> log(new GLchar[log_length]); GLsizei returned_log_length; glGetShaderSource(shader, log_length, &returned_log_length, log.get()); DCHECK(log_length == returned_log_length + 1); diff --git a/webkit/media/buffered_data_source.h b/webkit/media/buffered_data_source.h index 6d50c39..1c3523f 100644 --- a/webkit/media/buffered_data_source.h +++ b/webkit/media/buffered_data_source.h @@ -177,7 +177,7 @@ class BufferedDataSource : public media::DataSource { // because we want buffer to be passed into BufferedResourceLoader to be // always non-null. And by initializing this member with a default size we can // avoid creating zero-sized buffered if the first read has zero size. - scoped_array<uint8> intermediate_read_buffer_; + scoped_ptr<uint8[]> intermediate_read_buffer_; int intermediate_read_buffer_size_; // The message loop of the render thread. diff --git a/webkit/media/buffered_data_source_unittest.cc b/webkit/media/buffered_data_source_unittest.cc index 9e77c42..92109fc 100644 --- a/webkit/media/buffered_data_source_unittest.cc +++ b/webkit/media/buffered_data_source_unittest.cc @@ -168,7 +168,7 @@ class BufferedDataSourceTest : public testing::Test { } void ReceiveData(int size) { - scoped_array<char> data(new char[size]); + scoped_ptr<char[]> data(new char[size]); memset(data.get(), 0xA5, size); // Arbitrary non-zero value. loader()->didReceiveData(url_loader(), data.get(), size, size); diff --git a/webkit/media/buffered_resource_loader_unittest.cc b/webkit/media/buffered_resource_loader_unittest.cc index 4a917b4..9e9dbe1 100644 --- a/webkit/media/buffered_resource_loader_unittest.cc +++ b/webkit/media/buffered_resource_loader_unittest.cc @@ -217,7 +217,7 @@ class BufferedResourceLoaderTest : public testing::Test { void WriteData(int size) { EXPECT_CALL(*this, ProgressCallback(_)); - scoped_array<char> data(new char[size]); + scoped_ptr<char[]> data(new char[size]); loader_->didReceiveData(url_loader_, data.get(), size, size); } diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.cc b/webkit/media/crypto/ppapi/clear_key_cdm.cc index 435a982..4c0e2d5 100644 --- a/webkit/media/crypto/ppapi/clear_key_cdm.cc +++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc @@ -187,7 +187,7 @@ void ClearKeyCdm::Client::KeyMessage(const std::string& key_system, void ClearKeyCdm::Client::NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, + scoped_ptr<uint8[]> init_data, int init_data_length) { // In the current implementation of AesDecryptor, NeedKey is not used. // If no key is available to decrypt an input buffer, it returns kNoKey to diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.h b/webkit/media/crypto/ppapi/clear_key_cdm.h index 7865b06..35f0187 100644 --- a/webkit/media/crypto/ppapi/clear_key_cdm.h +++ b/webkit/media/crypto/ppapi/clear_key_cdm.h @@ -97,7 +97,7 @@ class ClearKeyCdm : public cdm::ContentDecryptionModule { void NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, int init_data_length); + scoped_ptr<uint8[]> init_data, int init_data_length); private: Status status_; diff --git a/webkit/media/crypto/ppapi_decryptor.cc b/webkit/media/crypto/ppapi_decryptor.cc index ac07ba3..580c5a3 100644 --- a/webkit/media/crypto/ppapi_decryptor.cc +++ b/webkit/media/crypto/ppapi_decryptor.cc @@ -281,7 +281,7 @@ void PpapiDecryptor::KeyMessage(const std::string& key_system, void PpapiDecryptor::NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, + scoped_ptr<uint8[]> init_data, int init_data_size) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); need_key_cb_.Run(key_system, session_id, type, diff --git a/webkit/media/crypto/ppapi_decryptor.h b/webkit/media/crypto/ppapi_decryptor.h index b57adf5..aad28c6 100644 --- a/webkit/media/crypto/ppapi_decryptor.h +++ b/webkit/media/crypto/ppapi_decryptor.h @@ -89,7 +89,7 @@ class PpapiDecryptor : public media::Decryptor { void NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, int init_data_size); + scoped_ptr<uint8[]> init_data, int init_data_size); // Hold a reference of the plugin instance to make sure the plugin outlives // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_| diff --git a/webkit/media/crypto/proxy_decryptor.cc b/webkit/media/crypto/proxy_decryptor.cc index eac99c2..bd0328a 100644 --- a/webkit/media/crypto/proxy_decryptor.cc +++ b/webkit/media/crypto/proxy_decryptor.cc @@ -215,7 +215,7 @@ void ProxyDecryptor::KeyMessage(const std::string& key_system, void ProxyDecryptor::NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, + scoped_ptr<uint8[]> init_data, int init_data_size) { need_key_cb_.Run(key_system, session_id, type, init_data.Pass(), init_data_size); diff --git a/webkit/media/crypto/proxy_decryptor.h b/webkit/media/crypto/proxy_decryptor.h index 8327fee..0b26dd2 100644 --- a/webkit/media/crypto/proxy_decryptor.h +++ b/webkit/media/crypto/proxy_decryptor.h @@ -68,7 +68,7 @@ class ProxyDecryptor { void NeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, int init_data_size); + scoped_ptr<uint8[]> init_data, int init_data_size); // Needed to create the PpapiDecryptor. WebKit::WebMediaPlayerClient* web_media_player_client_; diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc index a193cc4..2f144ee 100644 --- a/webkit/media/webmediaplayer_impl.cc +++ b/webkit/media/webmediaplayer_impl.cc @@ -1032,7 +1032,7 @@ void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, void WebMediaPlayerImpl::OnNeedKey(const std::string& key_system, const std::string& session_id, const std::string& type, - scoped_array<uint8> init_data, + scoped_ptr<uint8[]> init_data, int init_data_size) { DCHECK(main_loop_->BelongsToCurrentThread()); diff --git a/webkit/media/webmediaplayer_impl.h b/webkit/media/webmediaplayer_impl.h index 68e6f3c..ce09d90 100644 --- a/webkit/media/webmediaplayer_impl.h +++ b/webkit/media/webmediaplayer_impl.h @@ -207,7 +207,7 @@ class WebMediaPlayerImpl void OnNeedKey(const std::string& key_system, const std::string& type, const std::string& session_id, - scoped_array<uint8> init_data, + scoped_ptr<uint8[]> init_data, int init_data_size); void SetOpaque(bool); diff --git a/webkit/mocks/mock_webhyphenator.cc b/webkit/mocks/mock_webhyphenator.cc index 70e551a..219eca8 100644 --- a/webkit/mocks/mock_webhyphenator.cc +++ b/webkit/mocks/mock_webhyphenator.cc @@ -61,7 +61,7 @@ size_t MockWebHyphenator::computeLastHyphenLocation( if (!IsStringASCII(word_utf16)) return 0; std::string word = StringToLowerASCII(UTF16ToASCII(word_utf16)); - scoped_array<char> hyphens(new char[word.length() + 5]); + scoped_ptr<char[]> hyphens(new char[word.length() + 5]); char** rep = NULL; int* pos = NULL; int* cut = NULL; diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.cc b/webkit/plugins/npapi/webplugin_delegate_impl.cc index 08170a3..5011e3c 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl.cc @@ -66,8 +66,8 @@ bool WebPluginDelegateImpl::Initialize( webkit_glue::SetForcefullyTerminatePluginProcess(true); int argc = 0; - scoped_array<char*> argn(new char*[arg_names.size()]); - scoped_array<char*> argv(new char*[arg_names.size()]); + scoped_ptr<char*[]> argn(new char*[arg_names.size()]); + scoped_ptr<char*[]> argv(new char*[arg_names.size()]); for (size_t i = 0; i < arg_names.size(); ++i) { if (quirks_ & PLUGIN_QUIRK_NO_WINDOWLESS && LowerCaseEqualsASCII(arg_names[i], "windowlessvideo")) { diff --git a/webkit/plugins/ppapi/npapi_glue.h b/webkit/plugins/ppapi/npapi_glue.h index f732402..17b336f 100644 --- a/webkit/plugins/ppapi/npapi_glue.h +++ b/webkit/plugins/ppapi/npapi_glue.h @@ -156,7 +156,7 @@ class PPVarArrayFromNPVariantArray { private: size_t size_; - scoped_array<PP_Var> array_; + scoped_ptr<PP_Var[]> array_; DISALLOW_COPY_AND_ASSIGN(PPVarArrayFromNPVariantArray); }; diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 5ad3aa7..a46d4d2 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -294,9 +294,9 @@ bool SecurityOriginForInstance(PP_Instance instance_id, // Convert the given vector to an array of C-strings. The strings in the // returned vector are only guaranteed valid so long as the vector of strings // is not modified. -scoped_array<const char*> StringVectorToArgArray( +scoped_ptr<const char*[]> StringVectorToArgArray( const std::vector<std::string>& vector) { - scoped_array<const char*> array(new const char*[vector.size()]); + scoped_ptr<const char*[]> array(new const char*[vector.size()]); for (size_t i = 0; i < vector.size(); ++i) array[i] = vector[i].c_str(); return array.Pass(); @@ -582,8 +582,8 @@ bool PluginInstance::Initialize(const std::vector<std::string>& arg_names, argn_ = arg_names; argv_ = arg_values; - scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); - scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); + scoped_ptr<const char*[]> argn_array(StringVectorToArgArray(argn_)); + scoped_ptr<const char*[]> argv_array(StringVectorToArgArray(argv_)); bool success = PP_ToBool(instance_interface_->DidCreate(pp_instance(), argn_.size(), argn_array.get(), @@ -2419,8 +2419,8 @@ PP_NaClResult PluginInstance::ResetAsProxied( plugin_zoom_interface_ = NULL; // Re-send the DidCreate event via the proxy. - scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); - scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); + scoped_ptr<const char*[]> argn_array(StringVectorToArgArray(argn_)); + scoped_ptr<const char*[]> argv_array(StringVectorToArgArray(argv_)); if (!instance_interface_->DidCreate(pp_instance(), argn_.size(), argn_array.get(), argv_array.get())) return PP_NACL_ERROR_INSTANCE; diff --git a/webkit/plugins/ppapi/ppb_var_deprecated_impl.cc b/webkit/plugins/ppapi/ppb_var_deprecated_impl.cc index e7373a3..4ea102a8 100644 --- a/webkit/plugins/ppapi/ppb_var_deprecated_impl.cc +++ b/webkit/plugins/ppapi/ppb_var_deprecated_impl.cc @@ -290,7 +290,7 @@ PP_Var InternalCallDeprecated(ObjectAccessorTryCatch* accessor, return PP_MakeUndefined(); } - scoped_array<NPVariant> args; + scoped_ptr<NPVariant[]> args; if (argc) { args.reset(new NPVariant[argc]); for (uint32_t i = 0; i < argc; ++i) { @@ -350,7 +350,7 @@ PP_Var Construct(PP_Var var, if (accessor.has_exception()) return PP_MakeUndefined(); - scoped_array<NPVariant> args; + scoped_ptr<NPVariant[]> args; if (argc) { args.reset(new NPVariant[argc]); for (uint32_t i = 0; i < argc; ++i) { diff --git a/webkit/support/weburl_loader_mock_factory.cc b/webkit/support/weburl_loader_mock_factory.cc index 11da208..cce3efa 100644 --- a/webkit/support/weburl_loader_mock_factory.cc +++ b/webkit/support/weburl_loader_mock_factory.cc @@ -183,7 +183,7 @@ bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path, return false; int size = static_cast<int>(file_size); - scoped_array<char> buffer(new char[size]); + scoped_ptr<char[]> buffer(new char[size]); data->reset(); int read_count = file_util::ReadFile(file_path, buffer.get(), size); if (read_count == -1) diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index b97f4fa..28e3e5a 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -402,7 +402,7 @@ class RequestProxy return; // Make a local copy of buf_, since AsyncReadData reuses it. - scoped_array<char> buf_copy(new char[bytes_read]); + scoped_ptr<char[]> buf_copy(new char[bytes_read]); memcpy(buf_copy.get(), buf_->data(), bytes_read); // Continue reading more data into buf_ |