OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/threaded_data_provider.h" | 5 #include "content/child/threaded_data_provider.h" |
6 | 6 |
7 #include "content/child/child_process.h" | 7 #include "content/child/child_process.h" |
8 #include "content/child/child_thread.h" | 8 #include "content/child/child_thread.h" |
9 #include "content/child/resource_dispatcher.h" | 9 #include "content/child/resource_dispatcher.h" |
10 #include "content/child/thread_safe_sender.h" | 10 #include "content/child/thread_safe_sender.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 bool DataProviderMessageFilter::OnMessageReceived( | 80 bool DataProviderMessageFilter::OnMessageReceived( |
81 const IPC::Message& message) { | 81 const IPC::Message& message) { |
82 DCHECK(io_message_loop_->BelongsToCurrentThread()); | 82 DCHECK(io_message_loop_->BelongsToCurrentThread()); |
83 | 83 |
84 if (message.type() != ResourceMsg_DataReceived::ID) | 84 if (message.type() != ResourceMsg_DataReceived::ID) |
85 return false; | 85 return false; |
86 | 86 |
87 int request_id; | 87 int request_id; |
88 | 88 |
89 PickleIterator iter(message); | 89 PickleIterator iter(message); |
90 if (!iter.ReadInt(&request_id)) { | 90 if (!message.ReadInt(&iter, &request_id)) { |
91 NOTREACHED() << "malformed resource message"; | 91 NOTREACHED() << "malformed resource message"; |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 if (request_id == request_id_) { | 95 if (request_id == request_id_) { |
96 ResourceMsg_DataReceived::Schema::Param arg; | 96 ResourceMsg_DataReceived::Schema::Param arg; |
97 if (ResourceMsg_DataReceived::Read(&message, &arg)) { | 97 if (ResourceMsg_DataReceived::Read(&message, &arg)) { |
98 OnReceivedData(get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg)); | 98 OnReceivedData(get<0>(arg), get<1>(arg), get<2>(arg), get<3>(arg)); |
99 return true; | 99 return true; |
100 } | 100 } |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 // TODO(oysteine): SiteIsolationPolicy needs to be be checked | 279 // TODO(oysteine): SiteIsolationPolicy needs to be be checked |
280 // here before we pass the data to the data provider | 280 // here before we pass the data to the data provider |
281 // (or earlier on the I/O thread), otherwise once SiteIsolationPolicy does | 281 // (or earlier on the I/O thread), otherwise once SiteIsolationPolicy does |
282 // actual blocking as opposed to just UMA logging this will bypass it. | 282 // actual blocking as opposed to just UMA logging this will bypass it. |
283 threaded_data_receiver_->acceptData(data, data_length); | 283 threaded_data_receiver_->acceptData(data, data_length); |
284 ipc_channel_->Send(new ResourceHostMsg_DataReceived_ACK(request_id_)); | 284 ipc_channel_->Send(new ResourceHostMsg_DataReceived_ACK(request_id_)); |
285 } | 285 } |
286 | 286 |
287 } // namespace content | 287 } // namespace content |
OLD | NEW |