diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:55:08 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:55:08 +0000 |
commit | 9d9387eb0b90329e586607987809447d41ae4e3c (patch) | |
tree | d0deaa3047028589164886f98f7548a3e364fec7 /content/common | |
parent | 304fd15dbe7a69cd0580f54e78e08eda909e6f85 (diff) | |
download | chromium_src-9d9387eb0b90329e586607987809447d41ae4e3c.zip chromium_src-9d9387eb0b90329e586607987809447d41ae4e3c.tar.gz chromium_src-9d9387eb0b90329e586607987809447d41ae4e3c.tar.bz2 |
Log some additional information in crash dumps.
BUG=160401
Review URL: https://chromiumcodereview.appspot.com/11824052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/resource_dispatcher.cc | 10 | ||||
-rw-r--r-- | content/common/resource_dispatcher.h | 3 | ||||
-rw-r--r-- | content/common/resource_dispatcher_unittest.cc | 4 | ||||
-rw-r--r-- | content/common/resource_messages.h | 9 |
4 files changed, 20 insertions, 6 deletions
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc index 26f8937..aa64ff2 100644 --- a/content/common/resource_dispatcher.cc +++ b/content/common/resource_dispatcher.cc @@ -337,7 +337,8 @@ void ResourceDispatcher::OnReceivedCachedMetadata( void ResourceDispatcher::OnSetDataBuffer(const IPC::Message& message, int request_id, base::SharedMemoryHandle shm_handle, - int shm_size) { + int shm_size, + base::ProcessId renderer_pid) { PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); if (!request_info) return; @@ -350,6 +351,13 @@ void ResourceDispatcher::OnSetDataBuffer(const IPC::Message& message, bool ok = request_info->buffer->Map(shm_size); if (!ok) { + // Added to help debug crbug/160401. + base::ProcessId renderer_pid_copy = renderer_pid; + base::debug::Alias(&renderer_pid_copy); + + base::SharedMemoryHandle shm_handle_copy = shm_handle; + base::debug::Alias(&shm_handle_copy); + CrashOnMapFailure(); return; } diff --git a/content/common/resource_dispatcher.h b/content/common/resource_dispatcher.h index 3b568dd..509a266 100644 --- a/content/common/resource_dispatcher.h +++ b/content/common/resource_dispatcher.h @@ -118,7 +118,8 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { const IPC::Message& message, int request_id, base::SharedMemoryHandle shm_handle, - int shm_size); + int shm_size, + base::ProcessId renderer_pid); void OnReceivedData( const IPC::Message& message, int request_id, diff --git a/content/common/resource_dispatcher_unittest.cc b/content/common/resource_dispatcher_unittest.cc index f5c226b..d27b6a1 100644 --- a/content/common/resource_dispatcher_unittest.cc +++ b/content/common/resource_dispatcher_unittest.cc @@ -135,7 +135,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender { EXPECT_TRUE(shared_mem.GiveToProcess( base::Process::Current().handle(), &dup_handle)); dispatcher_->OnSetDataBuffer(message_queue_[0], request_id, dup_handle, - test_page_contents_len); + test_page_contents_len, 0); dispatcher_->OnReceivedData(message_queue_[0], request_id, 0, test_page_contents_len, test_page_contents_len); @@ -259,7 +259,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, &duplicated_handle)); dispatcher_->OnMessageReceived( - ResourceMsg_SetDataBuffer(0, 0, duplicated_handle, 100)); + ResourceMsg_SetDataBuffer(0, 0, duplicated_handle, 100, 0)); dispatcher_->OnMessageReceived( ResourceMsg_DataReceived(0, 0, 0, 100, 100)); diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index a838a34..03220af 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h @@ -5,6 +5,7 @@ // IPC messages for resource loading. // Multiply-included message file, hence no include guard. +#include "base/process.h" #include "base/shared_memory.h" #include "content/common/content_param_traits_macros.h" #include "content/public/common/common_param_traits.h" @@ -220,10 +221,14 @@ IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect, // NOTE: The shared memory handle should already be mapped into the process // that receives this message. // -IPC_MESSAGE_ROUTED3(ResourceMsg_SetDataBuffer, +// TODO(darin): The |renderer_pid| parameter is just a temporary parameter, +// added to help in debugging crbug/160401. +// +IPC_MESSAGE_ROUTED4(ResourceMsg_SetDataBuffer, int /* request_id */, base::SharedMemoryHandle /* shm_handle */, - int /* shm_size */) + int /* shm_size */, + base::ProcessId /* renderer_pid */) // Sent when some data from a resource request is ready. The data offset and // length specify a byte range into the shared memory buffer provided by the |