Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 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. |
| 745 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( | 746 scoped_ptr<ResourceRequestDetails> detail(new ResourceRequestDetails( |
| 746 loader->request(), | 747 loader->request(), |
| 747 GetCertID(loader->request(), info->GetChildID()))); | 748 GetCertID(loader->request(), info->GetChildID()), |
|
jar (doing other things)
2013/06/18 01:33:49
nit: one arg per line when you can't even wrap at
kouhei (in TOK)
2013/06/18 22:28:41
Done.
| |
| 749 info->GetPageTransition())); | |
| 748 BrowserThread::PostTask( | 750 BrowserThread::PostTask( |
| 749 BrowserThread::UI, FROM_HERE, | 751 BrowserThread::UI, FROM_HERE, |
| 750 base::Bind( | 752 base::Bind( |
| 751 &NotifyOnUI<ResourceRequestDetails>, | 753 &NotifyOnUI<ResourceRequestDetails>, |
| 752 static_cast<int>(NOTIFICATION_RESOURCE_RESPONSE_STARTED), | 754 static_cast<int>(NOTIFICATION_RESOURCE_RESPONSE_STARTED), |
| 753 render_process_id, render_view_id, base::Passed(&detail))); | 755 render_process_id, render_view_id, base::Passed(&detail))); |
| 754 } | 756 } |
| 755 | 757 |
| 756 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { | 758 void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { |
| 757 ResourceRequestInfo* info = loader->GetRequestInfo(); | 759 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); | 1877 DelegateMap::iterator it = delegate_map_.find(id); |
| 1876 DCHECK(it->second->HasObserver(delegate)); | 1878 DCHECK(it->second->HasObserver(delegate)); |
| 1877 it->second->RemoveObserver(delegate); | 1879 it->second->RemoveObserver(delegate); |
| 1878 if (it->second->size() == 0) { | 1880 if (it->second->size() == 0) { |
| 1879 delete it->second; | 1881 delete it->second; |
| 1880 delegate_map_.erase(it); | 1882 delegate_map_.erase(it); |
| 1881 } | 1883 } |
| 1882 } | 1884 } |
| 1883 | 1885 |
| 1884 } // namespace content | 1886 } // namespace content |
| OLD | NEW |