From 2ad26ba20e613f1967ed302f8c885b877d17b597 Mon Sep 17 00:00:00 2001 From: erikchen Date: Wed, 13 Jan 2016 11:21:23 -0800 Subject: [PATCH] Removing ipc/content debugging for ResourceMsg. This CL reverts commit ee68563f8c5c4781a26b0f2f5dc310cbd6aa950d. BUG= Review URL: https://codereview.chromium.org/1574283003 Cr-Commit-Position: refs/heads/master@{#369235} --- content/browser/browser_main_loop.cc | 5 ----- content/child/child_thread_impl.cc | 4 ---- content/child/resource_dispatcher.cc | 3 --- content/child/resource_scheduling_filter.cc | 4 ---- content/child/threaded_data_provider.cc | 3 --- content/common/resource_messages.cc | 16 ---------------- content/common/resource_messages.h | 4 ---- ipc/ipc_channel.h | 5 ----- ipc/ipc_channel_common.cc | 12 ------------ ipc/ipc_channel_reader.cc | 6 ------ ipc/ipc_channel_win.cc | 11 ----------- 11 files changed, 73 deletions(-) diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 6255f4a32afee5..74e6af634a4679 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -60,7 +60,6 @@ #include "content/common/content_switches_internal.h" #include "content/common/host_discardable_shared_memory_manager.h" #include "content/common/host_shared_bitmap_manager.h" -#include "content/common/resource_messages.h" #include "content/public/browser/browser_main_parts.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_process_host.h" @@ -69,7 +68,6 @@ #include "content/public/common/main_function_params.h" #include "content/public/common/result_codes.h" #include "device/battery/battery_status_service.h" -#include "ipc/ipc_channel.h" #include "ipc/mojo/scoped_ipc_support.h" #include "media/audio/audio_manager.h" #include "media/base/media.h" @@ -1175,9 +1173,6 @@ void BrowserMainLoop::InitializeMainThread() { // Register the main thread by instantiating it, but don't call any methods. main_thread_.reset( new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); - - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - IPC::Channel::SetMessageVerifier(&content::CheckContentsOfResourceMessage); } int BrowserMainLoop::BrowserThreadsStarted() { diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc index d9b02b2769ae7e..b58debff3a409c 100644 --- a/content/child/child_thread_impl.cc +++ b/content/child/child_thread_impl.cc @@ -53,11 +53,9 @@ #include "content/common/child_process_messages.h" #include "content/common/in_process_child_thread_params.h" #include "content/common/mojo/mojo_messages.h" -#include "content/common/resource_messages.h" #include "content/public/common/content_switches.h" #include "ipc/attachment_broker.h" #include "ipc/attachment_broker_unprivileged.h" -#include "ipc/ipc_channel.h" #include "ipc/ipc_logging.h" #include "ipc/ipc_platform_file.h" #include "ipc/ipc_switches.h" @@ -389,8 +387,6 @@ void ChildThreadImpl::Init(const Options& options) { if (!IsInBrowserProcess()) IPC::Logging::GetInstance()->SetIPCSender(this); #endif - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - IPC::Channel::SetMessageVerifier(&content::CheckContentsOfResourceMessage); mojo_ipc_support_.reset(new IPC::ScopedIPCSupport(GetIOTaskRunner())); mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index bcb99b91c5e6d5..be36225c2ad516 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc @@ -86,9 +86,6 @@ ResourceDispatcher::~ResourceDispatcher() { } bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - content::CheckContentsOfResourceMessage(&message); - if (!IsResourceDispatcherMessage(message)) { return false; } diff --git a/content/child/resource_scheduling_filter.cc b/content/child/resource_scheduling_filter.cc index ba05fdc5a36284..1f0a20edd4ed8d 100644 --- a/content/child/resource_scheduling_filter.cc +++ b/content/child/resource_scheduling_filter.cc @@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/location.h" #include "content/child/resource_dispatcher.h" -#include "content/common/resource_messages.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_start.h" #include "third_party/WebKit/public/platform/WebTaskRunner.h" @@ -52,9 +51,6 @@ ResourceSchedulingFilter::~ResourceSchedulingFilter() { } bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) { - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - content::CheckContentsOfResourceMessage(&message); - base::AutoLock lock(request_id_to_task_runner_map_lock_); int request_id; diff --git a/content/child/threaded_data_provider.cc b/content/child/threaded_data_provider.cc index 99791bb277b15e..91d385b81ef353 100644 --- a/content/child/threaded_data_provider.cc +++ b/content/child/threaded_data_provider.cc @@ -83,9 +83,6 @@ void DataProviderMessageFilter::OnFilterAdded(IPC::Sender* sender) { bool DataProviderMessageFilter::OnMessageReceived( const IPC::Message& message) { - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - content::CheckContentsOfResourceMessage(&message); - DCHECK(io_task_runner_->BelongsToCurrentThread()); if (message.type() != ResourceMsg_DataReceived::ID) diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc index a432e9d1542ea4..da92b97b09b7c7 100644 --- a/content/common/resource_messages.cc +++ b/content/common/resource_messages.cc @@ -4,25 +4,9 @@ #include "content/common/resource_messages.h" -#include "base/debug/alias.h" -#include "ipc/ipc_message.h" #include "net/base/load_timing_info.h" #include "net/http/http_response_headers.h" -namespace content { -// TODO(erikchen): Temporary code to help track http://crbug.com/527588. -void CheckContentsOfResourceMessage(const IPC::Message* message) { - if (message->type() == ResourceMsg_DataReceivedDebug::ID) { - ResourceMsg_DataReceivedDebug::Schema::Param arg; - bool success = ResourceMsg_DataReceivedDebug::Read(message, &arg); - CHECK(success); - int data_offset = base::get<1>(arg); - CHECK_LE(data_offset, 512 * 1024); - base::debug::Alias(&data_offset); - } -} -} - namespace IPC { void ParamTraits >::Write( diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index cc0b3d0ef54674..44a4b0e932fc78 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h @@ -32,10 +32,6 @@ struct LoadTimingInfo; namespace content { struct ResourceDevToolsInfo; - -// TODO(erikchen): Temporary code to help track http://crbug.com/527588. -// This method sanity checks the contents of the DataReceived resource message. -void CheckContentsOfResourceMessage(const IPC::Message* m); } namespace IPC { diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h index 20c61f11580f26..dd882bb5cc0862 100644 --- a/ipc/ipc_channel.h +++ b/ipc/ipc_channel.h @@ -159,11 +159,6 @@ class IPC_EXPORT Channel : public Endpoint { ~Channel() override; - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - using MessageVerifier = void (*)(const Message*); - static void SetMessageVerifier(MessageVerifier verifier); - static MessageVerifier GetMessageVerifier(); - // Connect the pipe. On the server side, this will initiate // waiting for connections. On the client, it attempts to // connect to a pre-existing pipe. Note, calling Connect() diff --git a/ipc/ipc_channel_common.cc b/ipc/ipc_channel_common.cc index 8832ff2297d5f9..c12a360b64c6ac 100644 --- a/ipc/ipc_channel_common.cc +++ b/ipc/ipc_channel_common.cc @@ -7,8 +7,6 @@ namespace IPC { -static Channel::MessageVerifier g_message_verifier = nullptr; - // static scoped_ptr Channel::CreateClient( const IPC::ChannelHandle& channel_handle, @@ -50,16 +48,6 @@ scoped_ptr Channel::CreateServer( Channel::~Channel() { } -// static -void Channel::SetMessageVerifier(MessageVerifier verifier) { - g_message_verifier = verifier; -} - -// static -Channel::MessageVerifier Channel::GetMessageVerifier() { - return g_message_verifier; -} - bool Channel::IsSendThreadSafe() const { return false; } diff --git a/ipc/ipc_channel_reader.cc b/ipc/ipc_channel_reader.cc index 8f0c6f80f82945..9c6af49f2f15b1 100644 --- a/ipc/ipc_channel_reader.cc +++ b/ipc/ipc_channel_reader.cc @@ -14,7 +14,6 @@ #include "ipc/ipc_message.h" #include "ipc/ipc_message_attachment_set.h" #include "ipc/ipc_message_macros.h" -#include "ipc/ipc_message_start.h" namespace IPC { namespace internal { @@ -166,11 +165,6 @@ bool ChannelReader::TranslateInputData(const char* input_data, bool ChannelReader::HandleTranslatedMessage( Message* translated_message, const AttachmentIdVector& attachment_ids) { - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - Channel::MessageVerifier verifier = Channel::GetMessageVerifier(); - if (verifier) - verifier(translated_message); - // Immediately handle internal messages. if (IsInternalMessage(*translated_message)) { EmitLogBeforeDispatch(*translated_message); diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 912d2cde3e5721..62918627c17f5f 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -490,17 +490,6 @@ bool ChannelWin::ProcessOutgoingMessages( // Write to pipe... OutputElement* element = output_queue_.front(); - - // TODO(erikchen): Temporary code to help track http://crbug.com/527588. - { - const Message* m = element->get_message(); - if (m) { - Channel::MessageVerifier verifier = Channel::GetMessageVerifier(); - if (verifier) - verifier(m); - } - } - DCHECK(element->size() <= INT_MAX); BOOL ok = WriteFile(pipe_.Get(), element->data(),