Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1588)

Unified Diff: content/child/resource_scheduling_filter.cc

Issue 1379543003: Revert of Post loading tasks on the appropriate WebFrameScheduler's queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/resource_scheduling_filter.h ('k') | content/child/web_url_loader_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_scheduling_filter.cc
diff --git a/content/child/resource_scheduling_filter.cc b/content/child/resource_scheduling_filter.cc
index 6445c00a2b55b2545944b177ae7d380930679c58..843cd8713f4c58047c2a4699a9a88875d51e5acf 100644
--- a/content/child/resource_scheduling_filter.cc
+++ b/content/child/resource_scheduling_filter.cc
@@ -9,31 +9,8 @@
#include "content/child/resource_dispatcher.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_start.h"
-#include "third_party/WebKit/public/platform/WebTaskRunner.h"
-#include "third_party/WebKit/public/platform/WebTraceLocation.h"
namespace content {
-
-namespace {
-class DispatchMessageTask : public blink::WebTaskRunner::Task {
- public:
- DispatchMessageTask(
- base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter,
- const IPC::Message& message)
- : resource_scheduling_filter_(resource_scheduling_filter),
- message_(message) {}
-
- void run() override {
- if (!resource_scheduling_filter_.get())
- return;
- resource_scheduling_filter_->DispatchMessage(message_);
- }
-
- private:
- base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter_;
- const IPC::Message message_;
-};
-} // namespace
ResourceSchedulingFilter::ResourceSchedulingFilter(
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
@@ -49,40 +26,10 @@
}
bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) {
- base::AutoLock lock(request_id_to_task_runner_map_lock_);
- int request_id;
-
- base::PickleIterator pickle_iterator(message);
- if (!pickle_iterator.ReadInt(&request_id)) {
- NOTREACHED() << "malformed resource message";
- return true;
- }
- // Dispatch the message on the request id specific task runner, if there is
- // one, or on the general main_thread_task_runner if there isn't.
- RequestIdToTaskRunnerMap::const_iterator iter =
- request_id_to_task_runner_map_.find(request_id);
- if (iter != request_id_to_task_runner_map_.end()) {
- // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE coexist.
- iter->second->postTask(
- blink::WebTraceLocation(__FUNCTION__, __FILE__),
- new DispatchMessageTask(weak_ptr_factory_.GetWeakPtr(), message));
- } else {
- main_thread_task_runner_->PostTask(
- FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage,
- weak_ptr_factory_.GetWeakPtr(), message));
- }
+ main_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage,
+ weak_ptr_factory_.GetWeakPtr(), message));
return true;
-}
-
-void ResourceSchedulingFilter::SetRequestIdTaskRunner(
- int id, scoped_ptr<blink::WebTaskRunner> web_task_runner) {
- base::AutoLock lock(request_id_to_task_runner_map_lock_);
- request_id_to_task_runner_map_.insert(id, web_task_runner.Pass());
-}
-
-void ResourceSchedulingFilter::ClearRequestIdTaskRunner(int id) {
- base::AutoLock lock(request_id_to_task_runner_map_lock_);
- request_id_to_task_runner_map_.erase(id);
}
bool ResourceSchedulingFilter::GetSupportedMessageClasses(
« no previous file with comments | « content/child/resource_scheduling_filter.h ('k') | content/child/web_url_loader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698