diff options
author | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:46:44 +0000 |
---|---|---|
committer | polina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 22:46:44 +0000 |
commit | 996bdbda28035f7f68955525625c998290706281 (patch) | |
tree | dfc61c5633359f02e40421e0240aeac25753b642 /webkit/plugins | |
parent | a965ca65e8170b3d685b7ca9185929fe3915b7f9 (diff) | |
download | chromium_src-996bdbda28035f7f68955525625c998290706281.zip chromium_src-996bdbda28035f7f68955525625c998290706281.tar.gz chromium_src-996bdbda28035f7f68955525625c998290706281.tar.bz2 |
1;2cReplace PP_ERROR_WOULDBLOCK with PP_OK_COMPLETIONPENDING. Improve error code comments. Update all code that uses this error code. Keep the old code for now flagging it as deprecated. Update copyrights.
BUG=none
TEST=bots
Review URL: http://codereview.chromium.org/6814033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 5 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_audio_impl.cc | 5 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_broker_impl.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_directory_reader_impl.cc | 5 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_chooser_impl.h | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_io_impl.cc | 14 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_io_impl.h | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_ref_impl.cc | 11 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_file_system_impl.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_menu_impl.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_surface_3d_impl.cc | 5 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_transport_impl.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_url_loader_impl.cc | 14 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_url_loader_impl.h | 2 |
17 files changed, 41 insertions, 46 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index a166c14..d469860 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -129,13 +129,13 @@ base::MessageLoopProxy* GetMainThreadMessageLoop() { void AddRefResource(PP_Resource resource) { if (!ResourceTracker::Get()->AddRefResource(resource)) { - DLOG(WARNING) << "AddRefResource()ing a nonexistent resource"; + DLOG(WARNING) << "AddRefResource()ing a nonexistent resource " << resource; } } void ReleaseResource(PP_Resource resource) { if (!ResourceTracker::Get()->UnrefResource(resource)) { - DLOG(WARNING) << "ReleaseResource()ing a nonexistent resource"; + DLOG(WARNING) << "ReleaseResource()ing a nonexistent resource " << resource; } } @@ -539,4 +539,3 @@ bool PluginModule::InitializeModule() { } // namespace ppapi } // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_audio_impl.cc b/webkit/plugins/ppapi/ppb_audio_impl.cc index 0d4f852..54de09c 100644 --- a/webkit/plugins/ppapi/ppb_audio_impl.cc +++ b/webkit/plugins/ppapi/ppb_audio_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -310,7 +310,7 @@ int32_t PPB_Audio_Impl::Open(PluginDelegate* plugin_delegate, // once and only once. create_callback_ = create_callback; create_callback_pending_ = true; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_Audio_Impl::GetSyncSocket(int* sync_socket) { @@ -373,4 +373,3 @@ void PPB_Audio_Impl::StreamCreated( } // namespace ppapi } // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_broker_impl.cc b/webkit/plugins/ppapi/ppb_broker_impl.cc index d214c7b..9e0cb5c 100644 --- a/webkit/plugins/ppapi/ppb_broker_impl.cc +++ b/webkit/plugins/ppapi/ppb_broker_impl.cc @@ -103,7 +103,7 @@ int32_t PPB_Broker_Impl::Connect( connect_callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, connect_callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) { diff --git a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc index 36e43bf..e704b3f 100644 --- a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc +++ b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -119,7 +119,7 @@ int32_t PPB_DirectoryReader_Impl::GetNextEntry( callback, NULL, NULL, this))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } void PPB_DirectoryReader_Impl::AddNewEntries( @@ -168,4 +168,3 @@ bool PPB_DirectoryReader_Impl::FillUpEntry() { } // namespace ppapi } // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc b/webkit/plugins/ppapi/ppb_file_chooser_impl.cc index 702f107..817dcd5 100644 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl.cc +++ b/webkit/plugins/ppapi/ppb_file_chooser_impl.cc @@ -194,7 +194,7 @@ int32_t PPB_FileChooser_Impl::Show(const PP_CompletionCallback& callback) { return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } scoped_refptr<PPB_FileRef_Impl> PPB_FileChooser_Impl::GetNextChosenFile() { diff --git a/webkit/plugins/ppapi/ppb_file_chooser_impl.h b/webkit/plugins/ppapi/ppb_file_chooser_impl.h index 75923a1..57d1d32 100644 --- a/webkit/plugins/ppapi/ppb_file_chooser_impl.h +++ b/webkit/plugins/ppapi/ppb_file_chooser_impl.h @@ -43,7 +43,7 @@ class PPB_FileChooser_Impl : public Resource { int32_t ValidateCallback(const PP_CompletionCallback& callback); // Sets up |callback| as the pending callback. This should only be called once - // it is certain that |PP_ERROR_WOULDBLOCK| will be returned. + // it is certain that |PP_OK_COMPLETIONPENDING| will be returned. void RegisterCallback(const PP_CompletionCallback& callback); void RunCallback(int32_t result); diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.cc b/webkit/plugins/ppapi/ppb_file_io_impl.cc index 6597aee..624ced4 100644 --- a/webkit/plugins/ppapi/ppb_file_io_impl.cc +++ b/webkit/plugins/ppapi/ppb_file_io_impl.cc @@ -262,7 +262,7 @@ int32_t PPB_FileIO_Impl::Open(PPB_FileRef_Impl* file_ref, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::Query(PP_FileInfo_Dev* info, @@ -283,7 +283,7 @@ int32_t PPB_FileIO_Impl::Query(PP_FileInfo_Dev* info, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::Touch(PP_Time last_access_time, @@ -301,7 +301,7 @@ int32_t PPB_FileIO_Impl::Touch(PP_Time last_access_time, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::Read(int64_t offset, @@ -323,7 +323,7 @@ int32_t PPB_FileIO_Impl::Read(int64_t offset, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::Write(int64_t offset, @@ -341,7 +341,7 @@ int32_t PPB_FileIO_Impl::Write(int64_t offset, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::SetLength(int64_t length, @@ -357,7 +357,7 @@ int32_t PPB_FileIO_Impl::SetLength(int64_t length, return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_FileIO_Impl::Flush(PP_CompletionCallback callback) { @@ -371,7 +371,7 @@ int32_t PPB_FileIO_Impl::Flush(PP_CompletionCallback callback) { return PP_ERROR_FAILED; RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } void PPB_FileIO_Impl::Close() { diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.h b/webkit/plugins/ppapi/ppb_file_io_impl.h index 7fe5f46..621aa1e 100644 --- a/webkit/plugins/ppapi/ppb_file_io_impl.h +++ b/webkit/plugins/ppapi/ppb_file_io_impl.h @@ -84,7 +84,7 @@ class PPB_FileIO_Impl : public Resource { PP_CompletionCallback callback); // Sets up |callback| as the pending callback. This should only be called once - // it is certain that |PP_ERROR_WOULDBLOCK| will be returned. + // it is certain that |PP_OK_COMPLETIONPENDING| will be returned. void RegisterCallback(PP_CompletionCallback callback); void RunPendingCallback(int32_t result); diff --git a/webkit/plugins/ppapi/ppb_file_ref_impl.cc b/webkit/plugins/ppapi/ppb_file_ref_impl.cc index 55bf3f1..c2ec5b2 100644 --- a/webkit/plugins/ppapi/ppb_file_ref_impl.cc +++ b/webkit/plugins/ppapi/ppb_file_ref_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -131,7 +131,7 @@ int32_t MakeDirectory(PP_Resource directory_ref_id, callback, NULL, NULL, NULL))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t Touch(PP_Resource file_ref_id, @@ -156,7 +156,7 @@ int32_t Touch(PP_Resource file_ref_id, callback, NULL, NULL, NULL))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t Delete(PP_Resource file_ref_id, @@ -178,7 +178,7 @@ int32_t Delete(PP_Resource file_ref_id, callback, NULL, NULL, NULL))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t Rename(PP_Resource file_ref_id, @@ -209,7 +209,7 @@ int32_t Rename(PP_Resource file_ref_id, callback, NULL, NULL, NULL))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } const PPB_FileRef_Dev ppb_fileref = { @@ -340,4 +340,3 @@ FilePath PPB_FileRef_Impl::GetSystemPath() const { } // namespace ppapi } // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_file_system_impl.cc b/webkit/plugins/ppapi/ppb_file_system_impl.cc index a41c4cc..0f4793c 100644 --- a/webkit/plugins/ppapi/ppb_file_system_impl.cc +++ b/webkit/plugins/ppapi/ppb_file_system_impl.cc @@ -77,7 +77,7 @@ int32_t Open(PP_Resource file_system_id, callback, NULL, file_system, NULL))) return PP_ERROR_FAILED; - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } PP_FileSystemType_Dev GetType(PP_Resource resource) { diff --git a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc index d147996..f21a597 100644 --- a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc @@ -177,7 +177,7 @@ int32_t PPB_Flash_Menu_Impl::Show(const PP_Point* location, int32_t rv = instance()->delegate()->ShowContextMenu( instance(), this, gfx::Point(location->x, location->y)); - if (rv == PP_ERROR_WOULDBLOCK) { + if (rv == PP_OK_COMPLETIONPENDING) { // Record callback and output buffers. callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); diff --git a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc b/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc index c817c8e..a136003 100644 --- a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc +++ b/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc @@ -114,7 +114,7 @@ int32_t PPB_Flash_NetConnector_Impl::ConnectTcp( } int32_t rv = instance()->delegate()->ConnectTcp(this, host, port); - if (rv == PP_ERROR_WOULDBLOCK) { + if (rv == PP_OK_COMPLETIONPENDING) { // Record callback and output buffers. callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); @@ -153,7 +153,7 @@ int32_t PPB_Flash_NetConnector_Impl::ConnectTcpAddress( } int32_t rv = instance()->delegate()->ConnectTcpAddress(this, addr); - if (rv == PP_ERROR_WOULDBLOCK) { + if (rv == PP_OK_COMPLETIONPENDING) { // Record callback and output buffers. callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index 1bb83ee..c1b6ab9 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -399,7 +399,7 @@ int32_t PPB_Graphics2D_Impl::Flush(const PP_CompletionCallback& callback) { } else { unpainted_flush_callback_.Set(callback); } - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } bool PPB_Graphics2D_Impl::ReadImageData(PP_Resource image, diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc index e48b1d5..b735c1d 100644 --- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc +++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -145,7 +145,7 @@ int32_t PPB_Surface3D_Impl::SwapBuffers(PP_CompletionCallback callback) { if (impl) { context_->gles2_impl()->SwapBuffers(); } - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } void PPB_Surface3D_Impl::ViewInitiatedPaint() { @@ -202,4 +202,3 @@ void PPB_Surface3D_Impl::SendContextLost() { } // namespace ppapi } // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_transport_impl.cc b/webkit/plugins/ppapi/ppb_transport_impl.cc index 0022014..c4d440e 100644 --- a/webkit/plugins/ppapi/ppb_transport_impl.cc +++ b/webkit/plugins/ppapi/ppb_transport_impl.cc @@ -154,7 +154,7 @@ int32_t PPB_Transport_Impl::Connect(PP_CompletionCallback callback) { CHECK(resource_id); connect_callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_Transport_Impl::GetNextAddress(PP_Var* address, @@ -172,7 +172,7 @@ int32_t PPB_Transport_Impl::GetNextAddress(PP_Var* address, CHECK(resource_id); next_address_callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_Transport_Impl::ReceiveRemoteAddress(PP_Var address) { @@ -200,7 +200,7 @@ int32_t PPB_Transport_Impl::Recv(void* data, uint32_t len, CHECK(resource_id); recv_callback_ = new TrackedCompletionCallback( instance()->module()->GetCallbackTracker(), resource_id, callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_Transport_Impl::Send(const void* data, uint32_t len, diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc index 31518d1..bb2621e 100644 --- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc +++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc @@ -205,7 +205,7 @@ PPB_URLLoader_Impl::PPB_URLLoader_Impl(PluginInstance* instance, total_bytes_to_be_received_(-1), user_buffer_(NULL), user_buffer_size_(0), - done_status_(PP_ERROR_WOULDBLOCK), + done_status_(PP_OK_COMPLETIONPENDING), has_universal_access_(false), status_callback_(NULL) { } @@ -267,7 +267,7 @@ int32_t PPB_URLLoader_Impl::Open(PPB_URLRequestInfo_Impl* request, // Notify completion when we receive a redirect or response headers. RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_URLLoader_Impl::FollowRedirect(PP_CompletionCallback callback) { @@ -283,7 +283,7 @@ int32_t PPB_URLLoader_Impl::FollowRedirect(PP_CompletionCallback callback) { loader_->setDefersLoading(false); // Allow the redirect to continue. RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } bool PPB_URLLoader_Impl::GetUploadProgress(int64_t* bytes_sent, @@ -329,14 +329,14 @@ int32_t PPB_URLLoader_Impl::ReadResponseBody(void* buffer, return FillUserBuffer(); // We may have already reached EOF. - if (done_status_ != PP_ERROR_WOULDBLOCK) { + if (done_status_ != PP_OK_COMPLETIONPENDING) { user_buffer_ = NULL; user_buffer_size_ = 0; return done_status_; } RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } int32_t PPB_URLLoader_Impl::FinishStreamingToFile( @@ -348,12 +348,12 @@ int32_t PPB_URLLoader_Impl::FinishStreamingToFile( return PP_ERROR_FAILED; // We may have already reached EOF. - if (done_status_ != PP_ERROR_WOULDBLOCK) + if (done_status_ != PP_OK_COMPLETIONPENDING) return done_status_; // Wait for didFinishLoading / didFail. RegisterCallback(callback); - return PP_ERROR_WOULDBLOCK; + return PP_OK_COMPLETIONPENDING; } void PPB_URLLoader_Impl::Close() { diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.h b/webkit/plugins/ppapi/ppb_url_loader_impl.h index cd21285..3bc8dc1 100644 --- a/webkit/plugins/ppapi/ppb_url_loader_impl.h +++ b/webkit/plugins/ppapi/ppb_url_loader_impl.h @@ -95,7 +95,7 @@ class PPB_URLLoader_Impl : public Resource, public WebKit::WebURLLoaderClient { int32_t ValidateCallback(PP_CompletionCallback callback); // Sets up |callback| as the pending callback. This should only be called once - // it is certain that |PP_ERROR_WOULDBLOCK| will be returned. + // it is certain that |PP_OK_COMPLETIONPENDING| will be returned. void RegisterCallback(PP_CompletionCallback callback); void RunCallback(int32_t result); |