| 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 "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" | 9 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
| 10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 bool DataProviderMessageFilter::OnMessageReceived( | 82 bool DataProviderMessageFilter::OnMessageReceived( |
| 83 const IPC::Message& message) { | 83 const IPC::Message& message) { |
| 84 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 84 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 85 | 85 |
| 86 if (message.type() != ResourceMsg_DataReceived::ID) | 86 if (message.type() != ResourceMsg_DataReceived::ID) |
| 87 return false; | 87 return false; |
| 88 | 88 |
| 89 int request_id; | 89 int request_id; |
| 90 | 90 |
| 91 PickleIterator iter(message); | 91 base::PickleIterator iter(message); |
| 92 if (!iter.ReadInt(&request_id)) { | 92 if (!iter.ReadInt(&request_id)) { |
| 93 NOTREACHED() << "malformed resource message"; | 93 NOTREACHED() << "malformed resource message"; |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (request_id == request_id_) { | 97 if (request_id == request_id_) { |
| 98 ResourceMsg_DataReceived::Schema::Param arg; | 98 ResourceMsg_DataReceived::Schema::Param arg; |
| 99 if (ResourceMsg_DataReceived::Read(&message, &arg)) { | 99 if (ResourceMsg_DataReceived::Read(&message, &arg)) { |
| 100 OnReceivedData(base::get<0>(arg), base::get<1>(arg), | 100 OnReceivedData(base::get<0>(arg), base::get<1>(arg), |
| 101 base::get<2>(arg), base::get<3>(arg)); | 101 base::get<2>(arg), base::get<3>(arg)); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 DCHECK(threaded_data_receiver_->needsMainthreadDataCopy()); | 342 DCHECK(threaded_data_receiver_->needsMainthreadDataCopy()); |
| 343 DCHECK_EQ((size_t)data_length, data_copy->size()); | 343 DCHECK_EQ((size_t)data_length, data_copy->size()); |
| 344 } | 344 } |
| 345 | 345 |
| 346 threaded_data_receiver_->acceptMainthreadDataNotification( | 346 threaded_data_receiver_->acceptMainthreadDataNotification( |
| 347 (data_copy && !data_copy->empty()) ? &data_copy->front() : NULL, | 347 (data_copy && !data_copy->empty()) ? &data_copy->front() : NULL, |
| 348 data_length, encoded_data_length); | 348 data_length, encoded_data_length); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |