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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 #include "net/cookies/cookie_monster.h" | 73 #include "net/cookies/cookie_monster.h" |
74 #include "net/http/http_cache.h" | 74 #include "net/http/http_cache.h" |
75 #include "net/http/http_response_headers.h" | 75 #include "net/http/http_response_headers.h" |
76 #include "net/http/http_response_info.h" | 76 #include "net/http/http_response_info.h" |
77 #include "net/http/http_transaction_factory.h" | 77 #include "net/http/http_transaction_factory.h" |
78 #include "net/url_request/url_request.h" | 78 #include "net/url_request/url_request.h" |
79 #include "net/url_request/url_request_context.h" | 79 #include "net/url_request/url_request_context.h" |
80 #include "net/url_request/url_request_job_factory.h" | 80 #include "net/url_request/url_request_job_factory.h" |
81 #include "webkit/appcache/appcache_interceptor.h" | 81 #include "webkit/appcache/appcache_interceptor.h" |
82 #include "webkit/appcache/appcache_interfaces.h" | 82 #include "webkit/appcache/appcache_interfaces.h" |
83 #include "webkit/blob/blob_storage_controller.h" | 83 #include "webkit/blob/blob_data.h" |
| 84 #include "webkit/blob/blob_storage_context.h" |
| 85 #include "webkit/blob/blob_url_request_job_factory.h" |
84 #include "webkit/blob/shareable_file_reference.h" | 86 #include "webkit/blob/shareable_file_reference.h" |
85 #include "webkit/glue/resource_request_body.h" | 87 #include "webkit/glue/resource_request_body.h" |
86 #include "webkit/glue/webkit_glue.h" | 88 #include "webkit/glue/webkit_glue.h" |
87 | 89 |
88 using base::Time; | 90 using base::Time; |
89 using base::TimeDelta; | 91 using base::TimeDelta; |
90 using base::TimeTicks; | 92 using base::TimeTicks; |
91 using webkit_blob::ShareableFileReference; | 93 using webkit_blob::ShareableFileReference; |
92 using webkit_glue::ResourceRequestBody; | 94 using webkit_glue::ResourceRequestBody; |
93 | 95 |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 // TODO(darin): Do we really need all of these URLRequest setters in the | 923 // TODO(darin): Do we really need all of these URLRequest setters in the |
922 // transferred navigation case? | 924 // transferred navigation case? |
923 | 925 |
924 request->set_load_flags(load_flags); | 926 request->set_load_flags(load_flags); |
925 request->set_priority(request_data.priority); | 927 request->set_priority(request_data.priority); |
926 | 928 |
927 // Resolve elements from request_body and prepare upload data. | 929 // Resolve elements from request_body and prepare upload data. |
928 if (request_data.request_body) { | 930 if (request_data.request_body) { |
929 request->set_upload(make_scoped_ptr( | 931 request->set_upload(make_scoped_ptr( |
930 request_data.request_body->ResolveElementsAndCreateUploadDataStream( | 932 request_data.request_body->ResolveElementsAndCreateUploadDataStream( |
931 filter_->blob_storage_context()->controller(), | 933 filter_->blob_storage_context()->context(), |
932 filter_->file_system_context(), | 934 filter_->file_system_context(), |
933 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)))); | 935 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)))); |
934 } | 936 } |
935 | 937 |
936 bool allow_download = request_data.allow_download && | 938 bool allow_download = request_data.allow_download && |
937 ResourceType::IsFrame(request_data.resource_type); | 939 ResourceType::IsFrame(request_data.resource_type); |
938 | 940 |
939 // Make extra info and read footer (contains request ID). | 941 // Make extra info and read footer (contains request ID). |
940 ResourceRequestInfoImpl* extra_info = | 942 ResourceRequestInfoImpl* extra_info = |
941 new ResourceRequestInfoImpl( | 943 new ResourceRequestInfoImpl( |
(...skipping 12 matching lines...) Expand all Loading... |
954 allow_download, | 956 allow_download, |
955 request_data.has_user_gesture, | 957 request_data.has_user_gesture, |
956 request_data.referrer_policy, | 958 request_data.referrer_policy, |
957 resource_context, | 959 resource_context, |
958 !is_sync_load); | 960 !is_sync_load); |
959 extra_info->AssociateWithRequest(request); // Request takes ownership. | 961 extra_info->AssociateWithRequest(request); // Request takes ownership. |
960 | 962 |
961 if (request->url().SchemeIs(chrome::kBlobScheme)) { | 963 if (request->url().SchemeIs(chrome::kBlobScheme)) { |
962 // Hang on to a reference to ensure the blob is not released prior | 964 // Hang on to a reference to ensure the blob is not released prior |
963 // to the job being started. | 965 // to the job being started. |
964 extra_info->set_requested_blob_data( | 966 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( |
965 filter_->blob_storage_context()->controller()-> | 967 request, |
966 GetBlobDataFromUrl(request->url())); | 968 filter_->blob_storage_context()->context()-> |
| 969 GetBlobDataFromPublicUrl(request->url())); |
967 } | 970 } |
968 | 971 |
969 // Have the appcache associate its extra info with the request. | 972 // Have the appcache associate its extra info with the request. |
970 appcache::AppCacheInterceptor::SetExtraRequestInfo( | 973 appcache::AppCacheInterceptor::SetExtraRequestInfo( |
971 request, filter_->appcache_service(), child_id, | 974 request, filter_->appcache_service(), child_id, |
972 request_data.appcache_host_id, request_data.resource_type); | 975 request_data.appcache_host_id, request_data.resource_type); |
973 | 976 |
974 // Construct the IPC resource handler. | 977 // Construct the IPC resource handler. |
975 scoped_ptr<ResourceHandler> handler; | 978 scoped_ptr<ResourceHandler> handler; |
976 if (sync_result) { | 979 if (sync_result) { |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 DelegateMap::iterator it = delegate_map_.find(id); | 1700 DelegateMap::iterator it = delegate_map_.find(id); |
1698 DCHECK(it->second->HasObserver(delegate)); | 1701 DCHECK(it->second->HasObserver(delegate)); |
1699 it->second->RemoveObserver(delegate); | 1702 it->second->RemoveObserver(delegate); |
1700 if (it->second->size() == 0) { | 1703 if (it->second->size() == 0) { |
1701 delete it->second; | 1704 delete it->second; |
1702 delegate_map_.erase(it); | 1705 delegate_map_.erase(it); |
1703 } | 1706 } |
1704 } | 1707 } |
1705 | 1708 |
1706 } // namespace content | 1709 } // namespace content |
OLD | NEW |