| Index: content/child/child_resource_message_filter.cc
|
| diff --git a/content/child/child_resource_message_filter.cc b/content/child/child_resource_message_filter.cc
|
| index 0a761713ad4ad857c89149d6a9230152643af791..961638c8cda639ef0dff3f7ffe1e5efdf46a8adf 100644
|
| --- a/content/child/child_resource_message_filter.cc
|
| +++ b/content/child/child_resource_message_filter.cc
|
| @@ -9,9 +9,23 @@
|
| #include "base/thread_task_runner_handle.h"
|
| #include "content/child/resource_dispatcher.h"
|
| #include "content/common/resource_messages.h"
|
| +#include "content/renderer/renderer_high_priority_task_queue.h"
|
|
|
| namespace content {
|
|
|
| +void ResourceDispatchedOnMessageReceived(
|
| + ResourceDispatcher* resource_dispatcher, const IPC::Message& message) {
|
| + resource_dispatcher->OnMessageReceived(message);
|
| +}
|
| +
|
| +void MarkFontNormalExecuteTaskPosition() {
|
| + TRACE_EVENT0("simon", "MarkFont_Normal");
|
| +}
|
| +
|
| +void MarkFontHighPriorityExecuteTaskPosition() {
|
| + TRACE_EVENT0("simon", "MarkFont_High");
|
| +}
|
| +
|
| ChildResourceMessageFilter::ChildResourceMessageFilter(
|
| ResourceDispatcher* resource_dispatcher)
|
| : main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
|
| @@ -24,11 +38,32 @@ bool ChildResourceMessageFilter::OnMessageReceived(
|
| if (message.type() == ResourceMsg_RequestComplete::ID ||
|
| message.type() == ResourceMsg_ReceivedResponse::ID ||
|
| message.type() == ResourceMsg_ReceivedRedirect::ID) {
|
| + if (resource_dispatcher_->IsPendingRequestFontType(message)) {
|
| + RendererHighPriorityTaskQueue::PostTask(FROM_HERE, base::Bind(
|
| + &ResourceDispatcher::set_io_timestamp,
|
| + base::Unretained(resource_dispatcher_),
|
| + base::TimeTicks::Now()));
|
| + } else {
|
| + main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(
|
| + &ResourceDispatcher::set_io_timestamp,
|
| + base::Unretained(resource_dispatcher_),
|
| + base::TimeTicks::Now()));
|
| + }
|
| + }
|
| +
|
| + if (resource_dispatcher_->IsPendingRequestFontType(message)) {
|
| main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(
|
| - &ResourceDispatcher::set_io_timestamp,
|
| - base::Unretained(resource_dispatcher_),
|
| - base::TimeTicks::Now()));
|
| + &MarkFontNormalExecuteTaskPosition));
|
| +
|
| + RendererHighPriorityTaskQueue::PostTask(FROM_HERE, base::Bind(
|
| + &ResourceDispatchedOnMessageReceived,
|
| + base::Unretained(resource_dispatcher_),
|
| + message));
|
| + RendererHighPriorityTaskQueue::PostTask(FROM_HERE, base::Bind(
|
| + &MarkFontHighPriorityExecuteTaskPosition));
|
| + return true;
|
| }
|
| +
|
| return false;
|
| }
|
|
|
|
|