Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1301103002: moved upload progress logic from ResourceLoader to AsyncResourceHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added license Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 const IPC::Message& message, 986 const IPC::Message& message,
987 ResourceMessageFilter* filter) { 987 ResourceMessageFilter* filter) {
988 filter_ = filter; 988 filter_ = filter;
989 bool handled = true; 989 bool handled = true;
990 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcherHostImpl, message) 990 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcherHostImpl, message)
991 IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource) 991 IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource)
992 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad) 992 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad)
993 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile, 993 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile,
994 OnReleaseDownloadedFile) 994 OnReleaseDownloadedFile)
995 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK) 995 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK)
996 IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK)
997 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest) 996 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest)
998 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, OnDidChangePriority) 997 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, OnDidChangePriority)
999 IPC_MESSAGE_UNHANDLED(handled = false) 998 IPC_MESSAGE_UNHANDLED(handled = false)
1000 IPC_END_MESSAGE_MAP() 999 IPC_END_MESSAGE_MAP()
1001 1000
1002 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) { 1001 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) {
1003 base::PickleIterator iter(message); 1002 base::PickleIterator iter(message);
1004 int request_id = -1; 1003 int request_id = -1;
1005 bool ok = iter.ReadInt(&request_id); 1004 bool ok = iter.ReadInt(&request_id);
1006 DCHECK(ok); 1005 DCHECK(ok);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 1517
1519 // Note that we don't remove the security bits here. This will be done 1518 // Note that we don't remove the security bits here. This will be done
1520 // when all file refs are deleted (see RegisterDownloadedTempFile). 1519 // when all file refs are deleted (see RegisterDownloadedTempFile).
1521 } 1520 }
1522 1521
1523 bool ResourceDispatcherHostImpl::Send(IPC::Message* message) { 1522 bool ResourceDispatcherHostImpl::Send(IPC::Message* message) {
1524 delete message; 1523 delete message;
1525 return false; 1524 return false;
1526 } 1525 }
1527 1526
1528 void ResourceDispatcherHostImpl::OnUploadProgressACK(int request_id) {
1529 ResourceLoader* loader = GetLoader(filter_->child_id(), request_id);
1530 if (loader)
1531 loader->OnUploadProgressACK();
1532 }
1533
1534 // Note that this cancel is subtly different from the other 1527 // Note that this cancel is subtly different from the other
1535 // CancelRequest methods in this file, which also tear down the loader. 1528 // CancelRequest methods in this file, which also tear down the loader.
1536 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) { 1529 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) {
1537 int child_id = filter_->child_id(); 1530 int child_id = filter_->child_id();
1538 1531
1539 // When the old renderer dies, it sends a message to us to cancel its 1532 // When the old renderer dies, it sends a message to us to cancel its
1540 // requests. 1533 // requests.
1541 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id))) 1534 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id)))
1542 return; 1535 return;
1543 1536
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 2379 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
2387 && !policy->CanReadRawCookies(child_id)) { 2380 && !policy->CanReadRawCookies(child_id)) {
2388 VLOG(1) << "Denied unauthorized request for raw headers"; 2381 VLOG(1) << "Denied unauthorized request for raw headers";
2389 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 2382 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
2390 } 2383 }
2391 2384
2392 return load_flags; 2385 return load_flags;
2393 } 2386 }
2394 2387
2395 } // namespace content 2388 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698