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/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad) | 974 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad) |
975 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile, | 975 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile, |
976 OnReleaseDownloadedFile) | 976 OnReleaseDownloadedFile) |
977 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK) | 977 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK) |
978 IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK) | 978 IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK) |
979 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest) | 979 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest) |
980 IPC_MESSAGE_UNHANDLED(handled = false) | 980 IPC_MESSAGE_UNHANDLED(handled = false) |
981 IPC_END_MESSAGE_MAP() | 981 IPC_END_MESSAGE_MAP() |
982 | 982 |
983 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) { | 983 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) { |
984 PickleIterator iter(message); | 984 base::PickleIterator iter(message); |
985 int request_id = -1; | 985 int request_id = -1; |
986 bool ok = iter.ReadInt(&request_id); | 986 bool ok = iter.ReadInt(&request_id); |
987 DCHECK(ok); | 987 DCHECK(ok); |
988 GlobalRequestID id(filter_->child_id(), request_id); | 988 GlobalRequestID id(filter_->child_id(), request_id); |
989 DelegateMap::iterator it = delegate_map_.find(id); | 989 DelegateMap::iterator it = delegate_map_.find(id); |
990 if (it != delegate_map_.end()) { | 990 if (it != delegate_map_.end()) { |
991 ObserverList<ResourceMessageDelegate>::Iterator del_it(it->second); | 991 ObserverList<ResourceMessageDelegate>::Iterator del_it(it->second); |
992 ResourceMessageDelegate* delegate; | 992 ResourceMessageDelegate* delegate; |
993 while (!handled && (delegate = del_it.GetNext()) != NULL) { | 993 while (!handled && (delegate = del_it.GetNext()) != NULL) { |
994 handled = delegate->OnMessageReceived(message); | 994 handled = delegate->OnMessageReceived(message); |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2366 | 2366 |
2367 // Add a flag to selectively bypass the data reduction proxy if the resource | 2367 // Add a flag to selectively bypass the data reduction proxy if the resource |
2368 // type is not an image. | 2368 // type is not an image. |
2369 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2369 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2370 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2370 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2371 | 2371 |
2372 return load_flags; | 2372 return load_flags; |
2373 } | 2373 } |
2374 | 2374 |
2375 } // namespace content | 2375 } // namespace content |
OLD | NEW |