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

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

Issue 11410019: ********** Chromium Blob hacking (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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 | Annotate | Revision Log
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 <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "net/cookies/cookie_monster.h" 70 #include "net/cookies/cookie_monster.h"
71 #include "net/http/http_cache.h" 71 #include "net/http/http_cache.h"
72 #include "net/http/http_response_headers.h" 72 #include "net/http/http_response_headers.h"
73 #include "net/http/http_response_info.h" 73 #include "net/http/http_response_info.h"
74 #include "net/http/http_transaction_factory.h" 74 #include "net/http/http_transaction_factory.h"
75 #include "net/url_request/url_request.h" 75 #include "net/url_request/url_request.h"
76 #include "net/url_request/url_request_context.h" 76 #include "net/url_request/url_request_context.h"
77 #include "net/url_request/url_request_job_factory.h" 77 #include "net/url_request/url_request_job_factory.h"
78 #include "webkit/appcache/appcache_interceptor.h" 78 #include "webkit/appcache/appcache_interceptor.h"
79 #include "webkit/appcache/appcache_interfaces.h" 79 #include "webkit/appcache/appcache_interfaces.h"
80 #include "webkit/blob/blob_storage_controller.h" 80 #include "webkit/blob/blob_data.h"
81 #include "webkit/blob/blob_storage_context.h"
82 #include "webkit/blob/blob_url_request_job_factory.h"
81 #include "webkit/blob/shareable_file_reference.h" 83 #include "webkit/blob/shareable_file_reference.h"
82 #include "webkit/glue/resource_request_body.h" 84 #include "webkit/glue/resource_request_body.h"
83 #include "webkit/glue/webkit_glue.h" 85 #include "webkit/glue/webkit_glue.h"
84 86
85 using base::Time; 87 using base::Time;
86 using base::TimeDelta; 88 using base::TimeDelta;
87 using base::TimeTicks; 89 using base::TimeTicks;
88 using webkit_blob::ShareableFileReference; 90 using webkit_blob::ShareableFileReference;
89 using webkit_glue::ResourceRequestBody; 91 using webkit_glue::ResourceRequestBody;
90 92
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // transferred navigation case? 950 // transferred navigation case?
949 951
950 request->set_load_flags(load_flags); 952 request->set_load_flags(load_flags);
951 953
952 request->set_priority(DetermineRequestPriority(request_data.resource_type)); 954 request->set_priority(DetermineRequestPriority(request_data.resource_type));
953 955
954 // Resolve elements from request_body and prepare upload data. 956 // Resolve elements from request_body and prepare upload data.
955 if (request_data.request_body) { 957 if (request_data.request_body) {
956 request->set_upload( 958 request->set_upload(
957 request_data.request_body->ResolveElementsAndCreateUploadData( 959 request_data.request_body->ResolveElementsAndCreateUploadData(
958 filter_->blob_storage_context()->controller())); 960 filter_->blob_storage_context()->context()));
959 } 961 }
960 962
961 bool allow_download = request_data.allow_download && 963 bool allow_download = request_data.allow_download &&
962 ResourceType::IsFrame(request_data.resource_type); 964 ResourceType::IsFrame(request_data.resource_type);
963 965
964 // Make extra info and read footer (contains request ID). 966 // Make extra info and read footer (contains request ID).
965 ResourceRequestInfoImpl* extra_info = 967 ResourceRequestInfoImpl* extra_info =
966 new ResourceRequestInfoImpl( 968 new ResourceRequestInfoImpl(
967 process_type, 969 process_type,
968 child_id, 970 child_id,
969 route_id, 971 route_id,
970 request_data.origin_pid, 972 request_data.origin_pid,
971 request_id, 973 request_id,
972 request_data.is_main_frame, 974 request_data.is_main_frame,
973 request_data.frame_id, 975 request_data.frame_id,
974 request_data.parent_is_main_frame, 976 request_data.parent_is_main_frame,
975 request_data.parent_frame_id, 977 request_data.parent_frame_id,
976 request_data.resource_type, 978 request_data.resource_type,
977 request_data.transition_type, 979 request_data.transition_type,
978 false, // is download 980 false, // is download
979 allow_download, 981 allow_download,
980 request_data.has_user_gesture, 982 request_data.has_user_gesture,
981 request_data.referrer_policy, 983 request_data.referrer_policy,
982 resource_context); 984 resource_context);
983 extra_info->AssociateWithRequest(request); // Request takes ownership. 985 extra_info->AssociateWithRequest(request); // Request takes ownership.
984 986
985 if (request->url().SchemeIs(chrome::kBlobScheme)) { 987 if (request->url().SchemeIs(chrome::kBlobScheme)) {
986 // Hang on to a reference to ensure the blob is not released prior 988 // Hang on to a reference to ensure the blob is not released prior
987 // to the job being started. 989 // to the job being started.
988 extra_info->set_requested_blob_data( 990 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle(
989 filter_->blob_storage_context()->controller()-> 991 request,
990 GetBlobDataFromUrl(request->url())); 992 filter_->blob_storage_context()->context()->
993 GetBlobDataFromPublicUrl(request->url()));
991 } 994 }
992 995
993 // Have the appcache associate its extra info with the request. 996 // Have the appcache associate its extra info with the request.
994 appcache::AppCacheInterceptor::SetExtraRequestInfo( 997 appcache::AppCacheInterceptor::SetExtraRequestInfo(
995 request, filter_->appcache_service(), child_id, 998 request, filter_->appcache_service(), child_id,
996 request_data.appcache_host_id, request_data.resource_type); 999 request_data.appcache_host_id, request_data.resource_type);
997 1000
998 // Construct the IPC resource handler. 1001 // Construct the IPC resource handler.
999 scoped_ptr<ResourceHandler> handler; 1002 scoped_ptr<ResourceHandler> handler;
1000 if (sync_result) { 1003 if (sync_result) {
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 1723
1721 return i->second.get(); 1724 return i->second.get();
1722 } 1725 }
1723 1726
1724 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, 1727 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id,
1725 int request_id) const { 1728 int request_id) const {
1726 return GetLoader(GlobalRequestID(child_id, request_id)); 1729 return GetLoader(GlobalRequestID(child_id, request_id));
1727 } 1730 }
1728 1731
1729 } // namespace content 1732 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698