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

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: single quotes, nits, and return success on success Created 5 years, 3 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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 const IPC::Message& message, 1000 const IPC::Message& message,
1001 ResourceMessageFilter* filter) { 1001 ResourceMessageFilter* filter) {
1002 filter_ = filter; 1002 filter_ = filter;
1003 bool handled = true; 1003 bool handled = true;
1004 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcherHostImpl, message) 1004 IPC_BEGIN_MESSAGE_MAP(ResourceDispatcherHostImpl, message)
1005 IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource) 1005 IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource)
1006 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad) 1006 IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad)
1007 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile, 1007 IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile,
1008 OnReleaseDownloadedFile) 1008 OnReleaseDownloadedFile)
1009 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK) 1009 IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK)
1010 IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK)
1011 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest) 1010 IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest)
1012 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, OnDidChangePriority) 1011 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, OnDidChangePriority)
1013 IPC_MESSAGE_UNHANDLED(handled = false) 1012 IPC_MESSAGE_UNHANDLED(handled = false)
1014 IPC_END_MESSAGE_MAP() 1013 IPC_END_MESSAGE_MAP()
1015 1014
1016 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) { 1015 if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) {
1017 base::PickleIterator iter(message); 1016 base::PickleIterator iter(message);
1018 int request_id = -1; 1017 int request_id = -1;
1019 bool ok = iter.ReadInt(&request_id); 1018 bool ok = iter.ReadInt(&request_id);
1020 DCHECK(ok); 1019 DCHECK(ok);
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 1543
1545 // Note that we don't remove the security bits here. This will be done 1544 // Note that we don't remove the security bits here. This will be done
1546 // when all file refs are deleted (see RegisterDownloadedTempFile). 1545 // when all file refs are deleted (see RegisterDownloadedTempFile).
1547 } 1546 }
1548 1547
1549 bool ResourceDispatcherHostImpl::Send(IPC::Message* message) { 1548 bool ResourceDispatcherHostImpl::Send(IPC::Message* message) {
1550 delete message; 1549 delete message;
1551 return false; 1550 return false;
1552 } 1551 }
1553 1552
1554 void ResourceDispatcherHostImpl::OnUploadProgressACK(int request_id) {
1555 ResourceLoader* loader = GetLoader(filter_->child_id(), request_id);
1556 if (loader)
1557 loader->OnUploadProgressACK();
1558 }
1559
1560 // Note that this cancel is subtly different from the other 1553 // Note that this cancel is subtly different from the other
1561 // CancelRequest methods in this file, which also tear down the loader. 1554 // CancelRequest methods in this file, which also tear down the loader.
1562 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) { 1555 void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) {
1563 int child_id = filter_->child_id(); 1556 int child_id = filter_->child_id();
1564 1557
1565 // When the old renderer dies, it sends a message to us to cancel its 1558 // When the old renderer dies, it sends a message to us to cancel its
1566 // requests. 1559 // requests.
1567 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id))) 1560 if (IsTransferredNavigation(GlobalRequestID(child_id, request_id)))
1568 return; 1561 return;
1569 1562
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 load_flags |= net::LOAD_PREFETCH; 2399 load_flags |= net::LOAD_PREFETCH;
2407 } 2400 }
2408 2401
2409 if (is_sync_load) 2402 if (is_sync_load)
2410 load_flags |= net::LOAD_IGNORE_LIMITS; 2403 load_flags |= net::LOAD_IGNORE_LIMITS;
2411 2404
2412 return load_flags; 2405 return load_flags;
2413 } 2406 }
2414 2407
2415 } // namespace content 2408 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698