| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/common/resource_dispatcher.h" | 7 #include "content/common/resource_dispatcher.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 298 } |
| 299 | 299 |
| 300 DispatchMessage(message); | 300 DispatchMessage(message); |
| 301 return true; | 301 return true; |
| 302 } | 302 } |
| 303 | 303 |
| 304 ResourceDispatcher::PendingRequestInfo* | 304 ResourceDispatcher::PendingRequestInfo* |
| 305 ResourceDispatcher::GetPendingRequestInfo(int request_id) { | 305 ResourceDispatcher::GetPendingRequestInfo(int request_id) { |
| 306 PendingRequestList::iterator it = pending_requests_.find(request_id); | 306 PendingRequestList::iterator it = pending_requests_.find(request_id); |
| 307 if (it == pending_requests_.end()) { | 307 if (it == pending_requests_.end()) { |
| 308 // This might happen for kill()ed requests on the webkit end, so perhaps it | 308 // This might happen for kill()ed requests on the webkit end. |
| 309 // shouldn't be a warning... | |
| 310 DLOG(WARNING) << "Received message for a nonexistent or finished request"; | |
| 311 return NULL; | 309 return NULL; |
| 312 } | 310 } |
| 313 return &(it->second); | 311 return &(it->second); |
| 314 } | 312 } |
| 315 | 313 |
| 316 void ResourceDispatcher::OnUploadProgress( | 314 void ResourceDispatcher::OnUploadProgress( |
| 317 const IPC::Message& message, int request_id, int64 position, int64 size) { | 315 const IPC::Message& message, int request_id, int64 position, int64 size) { |
| 318 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); | 316 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
| 319 if (!request_info) | 317 if (!request_info) |
| 320 return; | 318 return; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 603 |
| 606 // static | 604 // static |
| 607 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 605 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
| 608 while (!queue->empty()) { | 606 while (!queue->empty()) { |
| 609 IPC::Message* message = queue->front(); | 607 IPC::Message* message = queue->front(); |
| 610 ReleaseResourcesInDataMessage(*message); | 608 ReleaseResourcesInDataMessage(*message); |
| 611 queue->pop_front(); | 609 queue->pop_front(); |
| 612 delete message; | 610 delete message; |
| 613 } | 611 } |
| 614 } | 612 } |
| OLD | NEW |