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

Side by Side Diff: content/child/resource_scheduling_filter.cc

Issue 1350823002: Revert of Reland #2 "ipc: Add a new field num_brokered_attachments to the message header." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/resource_scheduling_filter.h" 5 #include "content/child/resource_scheduling_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "content/child/resource_dispatcher.h" 9 #include "content/child/resource_dispatcher.h"
10 #include "content/common/resource_messages.h"
11 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
12 #include "ipc/ipc_message_start.h" 11 #include "ipc/ipc_message_start.h"
13 12
14 namespace content { 13 namespace content {
15 14
16 ResourceSchedulingFilter::ResourceSchedulingFilter( 15 ResourceSchedulingFilter::ResourceSchedulingFilter(
17 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, 16 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
18 ResourceDispatcher* resource_dispatcher) 17 ResourceDispatcher* resource_dispatcher)
19 : main_thread_task_runner_(main_thread_task_runner), 18 : main_thread_task_runner_(main_thread_task_runner),
20 resource_dispatcher_(resource_dispatcher), 19 resource_dispatcher_(resource_dispatcher),
21 weak_ptr_factory_(this) { 20 weak_ptr_factory_(this) {
22 DCHECK(main_thread_task_runner_.get()); 21 DCHECK(main_thread_task_runner_.get());
23 DCHECK(resource_dispatcher_); 22 DCHECK(resource_dispatcher_);
24 } 23 }
25 24
26 ResourceSchedulingFilter::~ResourceSchedulingFilter() { 25 ResourceSchedulingFilter::~ResourceSchedulingFilter() {
27 } 26 }
28 27
29 bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) { 28 bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) {
30 // TODO(erikchen): Temporary code to help track http://crbug.com/527588.
31 content::CheckContentsOfDataReceivedMessage(&message);
32
33 main_thread_task_runner_->PostTask( 29 main_thread_task_runner_->PostTask(
34 FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage, 30 FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage,
35 weak_ptr_factory_.GetWeakPtr(), message)); 31 weak_ptr_factory_.GetWeakPtr(), message));
36 return true; 32 return true;
37 } 33 }
38 34
39 bool ResourceSchedulingFilter::GetSupportedMessageClasses( 35 bool ResourceSchedulingFilter::GetSupportedMessageClasses(
40 std::vector<uint32>* supported_message_classes) const { 36 std::vector<uint32>* supported_message_classes) const {
41 supported_message_classes->push_back(ResourceMsgStart); 37 supported_message_classes->push_back(ResourceMsgStart);
42 return true; 38 return true;
43 } 39 }
44 40
45 void ResourceSchedulingFilter::DispatchMessage(const IPC::Message& message) { 41 void ResourceSchedulingFilter::DispatchMessage(const IPC::Message& message) {
46 resource_dispatcher_->OnMessageReceived(message); 42 resource_dispatcher_->OnMessageReceived(message);
47 } 43 }
48 44
49 } // namespace content 45 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/threaded_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698