| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 // ResourceDispatcher --------------------------------------------------------- | 289 // ResourceDispatcher --------------------------------------------------------- |
| 290 | 290 |
| 291 ResourceDispatcher::ResourceDispatcher( | 291 ResourceDispatcher::ResourceDispatcher( |
| 292 IPC::Sender* sender, | 292 IPC::Sender* sender, |
| 293 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) | 293 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) |
| 294 : message_sender_(sender), | 294 : message_sender_(sender), |
| 295 delegate_(NULL), | 295 delegate_(NULL), |
| 296 io_timestamp_(base::TimeTicks()), | 296 io_timestamp_(base::TimeTicks()), |
| 297 weak_factory_(this), | 297 main_thread_task_runner_(main_thread_task_runner), |
| 298 main_thread_task_runner_(main_thread_task_runner) { | 298 weak_factory_(this) { |
| 299 } | 299 } |
| 300 | 300 |
| 301 ResourceDispatcher::~ResourceDispatcher() { | 301 ResourceDispatcher::~ResourceDispatcher() { |
| 302 } | 302 } |
| 303 | 303 |
| 304 // ResourceDispatcher implementation ------------------------------------------ | 304 // ResourceDispatcher implementation ------------------------------------------ |
| 305 | 305 |
| 306 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { | 306 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { |
| 307 if (!IsResourceDispatcherMessage(message)) { | 307 if (!IsResourceDispatcherMessage(message)) { |
| 308 return false; | 308 return false; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 896 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
| 897 while (!queue->empty()) { | 897 while (!queue->empty()) { |
| 898 IPC::Message* message = queue->front(); | 898 IPC::Message* message = queue->front(); |
| 899 ReleaseResourcesInDataMessage(*message); | 899 ReleaseResourcesInDataMessage(*message); |
| 900 queue->pop_front(); | 900 queue->pop_front(); |
| 901 delete message; | 901 delete message; |
| 902 } | 902 } |
| 903 } | 903 } |
| 904 | 904 |
| 905 } // namespace content | 905 } // namespace content |
| OLD | NEW |