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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); | 705 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); |
706 | 706 |
707 int render_process_id, render_view_id; | 707 int render_process_id, render_view_id; |
708 if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) | 708 if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) |
709 return; | 709 return; |
710 | 710 |
711 // Notify the observers on the UI thread. | 711 // Notify the observers on the UI thread. |
712 scoped_ptr<ResourceRedirectDetails> detail(new ResourceRedirectDetails( | 712 scoped_ptr<ResourceRedirectDetails> detail(new ResourceRedirectDetails( |
713 loader->request(), | 713 loader->request(), |
714 GetCertID(loader->request(), info->GetChildID()), | 714 GetCertID(loader->request(), info->GetChildID()), |
| 715 info->GetPageTransition(), |
715 new_url)); | 716 new_url)); |
716 BrowserThread::PostTask( | 717 BrowserThread::PostTask( |
717 BrowserThread::UI, FROM_HERE, | 718 BrowserThread::UI, FROM_HERE, |
718 base::Bind( | 719 base::Bind( |
719 &NotifyOnUI<ResourceRedirectDetails>, | 720 &NotifyOnUI<ResourceRedirectDetails>, |
720 static_cast<int>(NOTIFICATION_RESOURCE_RECEIVED_REDIRECT), | 721 static_cast<int>(NOTIFICATION_RESOURCE_RECEIVED_REDIRECT), |
721 render_process_id, render_view_id, base::Passed(&detail))); | 722 render_process_id, render_view_id, base::Passed(&detail))); |
722 } | 723 } |
723 | 724 |
724 void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { | 725 void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) { |
(...skipping 10 matching lines...) Expand all Loading... |
735 // this request traversed Begin{Download,SaveFile,Request}. | 736 // this request traversed Begin{Download,SaveFile,Request}. |
736 // TODO(rdsmith): This isn't currently true; see http://crbug.com/241176. | 737 // TODO(rdsmith): This isn't currently true; see http://crbug.com/241176. |
737 NOTREACHED(); | 738 NOTREACHED(); |
738 } | 739 } |
739 | 740 |
740 int render_process_id, render_view_id; | 741 int render_process_id, render_view_id; |
741 if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) | 742 if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id)) |
742 return; | 743 return; |
743 | 744 |
744 // Notify the observers on the UI thread. | 745 // Notify the observers on the UI thread. |
| 746 int cert_id = GetCertID(loader->request(), info->GetChildID()); |
745 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( | 747 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( |
746 loader->request(), | 748 loader->request(), cert_id, info->GetPageTransition())); |
747 GetCertID(loader->request(), info->GetChildID()))); | |
748 BrowserThread::PostTask( | 749 BrowserThread::PostTask( |
749 BrowserThread::UI, FROM_HERE, | 750 BrowserThread::UI, FROM_HERE, |
750 base::Bind( | 751 base::Bind( |
751 &NotifyOnUI<ResourceRequestDetails>, | 752 &NotifyOnUI<ResourceRequestDetails>, |
752 static_cast<int>(NOTIFICATION_RESOURCE_RESPONSE_STARTED), | 753 static_cast<int>(NOTIFICATION_RESOURCE_RESPONSE_STARTED), |
753 render_process_id, render_view_id, base::Passed(&detail))); | 754 render_process_id, render_view_id, base::Passed(&detail))); |
754 } | 755 } |
755 | 756 |
756 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { | 757 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { |
757 ResourceRequestInfo* info = loader->GetRequestInfo(); | 758 ResourceRequestInfo* info = loader->GetRequestInfo(); |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 DelegateMap::iterator it = delegate_map_.find(id); | 1876 DelegateMap::iterator it = delegate_map_.find(id); |
1876 DCHECK(it->second->HasObserver(delegate)); | 1877 DCHECK(it->second->HasObserver(delegate)); |
1877 it->second->RemoveObserver(delegate); | 1878 it->second->RemoveObserver(delegate); |
1878 if (it->second->size() == 0) { | 1879 if (it->second->size() == 0) { |
1879 delete it->second; | 1880 delete it->second; |
1880 delegate_map_.erase(it); | 1881 delegate_map_.erase(it); |
1881 } | 1882 } |
1882 } | 1883 } |
1883 | 1884 |
1884 } // namespace content | 1885 } // namespace content |
OLD | NEW |