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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 response->load_timing = result.load_timing; | 262 response->load_timing = result.load_timing; |
263 response->devtools_info = result.devtools_info; | 263 response->devtools_info = result.devtools_info; |
264 response->data.swap(result.data); | 264 response->data.swap(result.data); |
265 response->download_file_path = result.download_file_path; | 265 response->download_file_path = result.download_file_path; |
266 } | 266 } |
267 | 267 |
268 // ResourceDispatcher --------------------------------------------------------- | 268 // ResourceDispatcher --------------------------------------------------------- |
269 | 269 |
270 ResourceDispatcher::ResourceDispatcher(IPC::Sender* sender) | 270 ResourceDispatcher::ResourceDispatcher(IPC::Sender* sender) |
271 : message_sender_(sender), | 271 : message_sender_(sender), |
272 weak_factory_(this), | |
273 delegate_(NULL), | 272 delegate_(NULL), |
274 io_timestamp_(base::TimeTicks()) { | 273 io_timestamp_(base::TimeTicks()), |
| 274 weak_factory_(this) { |
275 } | 275 } |
276 | 276 |
277 ResourceDispatcher::~ResourceDispatcher() { | 277 ResourceDispatcher::~ResourceDispatcher() { |
278 } | 278 } |
279 | 279 |
280 // ResourceDispatcher implementation ------------------------------------------ | 280 // ResourceDispatcher implementation ------------------------------------------ |
281 | 281 |
282 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { | 282 bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { |
283 if (!IsResourceDispatcherMessage(message)) { | 283 if (!IsResourceDispatcherMessage(message)) { |
284 return false; | 284 return false; |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 875 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
876 while (!queue->empty()) { | 876 while (!queue->empty()) { |
877 IPC::Message* message = queue->front(); | 877 IPC::Message* message = queue->front(); |
878 ReleaseResourcesInDataMessage(*message); | 878 ReleaseResourcesInDataMessage(*message); |
879 queue->pop_front(); | 879 queue->pop_front(); |
880 delete message; | 880 delete message; |
881 } | 881 } |
882 } | 882 } |
883 | 883 |
884 } // namespace content | 884 } // namespace content |
OLD | NEW |