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

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

Issue 12243002: Pass WebKit priority changes and parsing messages up to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename IPC Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/common/resource_dispatcher.h » ('j') | content/common/view_messages.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 #if defined(OS_WIN) 196 #if defined(OS_WIN)
197 #pragma warning(disable: 4748) 197 #pragma warning(disable: 4748)
198 #pragma optimize("", off) 198 #pragma optimize("", off)
199 #endif 199 #endif
200 200
201 #if defined(OS_WIN) 201 #if defined(OS_WIN)
202 #pragma optimize("", on) 202 #pragma optimize("", on)
203 #pragma warning(default: 4748) 203 #pragma warning(default: 4748)
204 #endif 204 #endif
205 205
206 net::RequestPriority DetermineRequestPriority(
207 const ResourceHostMsg_Request& request_data) {
208 switch (request_data.priority) {
209 case WebKit::WebURLRequest::PriorityVeryHigh:
210 return net::HIGHEST;
211
212 case WebKit::WebURLRequest::PriorityHigh:
213 return net::MEDIUM;
214
215 case WebKit::WebURLRequest::PriorityMedium:
216 return net::LOW;
217
218 case WebKit::WebURLRequest::PriorityLow:
219 return net::LOWEST;
220
221 case WebKit::WebURLRequest::PriorityVeryLow:
222 return net::IDLE;
223
224 case WebKit::WebURLRequest::PriorityUnresolved:
225 default:
226 NOTREACHED();
227 return net::LOW;
228 }
229 }
230
231 void OnSwapOutACKHelper(int render_process_id, 206 void OnSwapOutACKHelper(int render_process_id,
232 int render_view_id, 207 int render_view_id,
233 bool timed_out) { 208 bool timed_out) {
234 RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id, 209 RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id,
235 render_view_id); 210 render_view_id);
236 if (rvh) 211 if (rvh)
237 rvh->OnSwapOutACK(timed_out); 212 rvh->OnSwapOutACK(timed_out);
238 } 213 }
239 214
240 net::Error CallbackAndReturn( 215 net::Error CallbackAndReturn(
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 referrer.policy); 889 referrer.policy);
915 net::HttpRequestHeaders headers; 890 net::HttpRequestHeaders headers;
916 headers.AddHeadersFromString(request_data.headers); 891 headers.AddHeadersFromString(request_data.headers);
917 request->SetExtraRequestHeaders(headers); 892 request->SetExtraRequestHeaders(headers);
918 } 893 }
919 894
920 // TODO(darin): Do we really need all of these URLRequest setters in the 895 // TODO(darin): Do we really need all of these URLRequest setters in the
921 // transferred navigation case? 896 // transferred navigation case?
922 897
923 request->set_load_flags(load_flags); 898 request->set_load_flags(load_flags);
924 899 request->set_priority(request_data.priority);
925 request->set_priority(DetermineRequestPriority(request_data));
926 900
927 // Resolve elements from request_body and prepare upload data. 901 // Resolve elements from request_body and prepare upload data.
928 if (request_data.request_body) { 902 if (request_data.request_body) {
929 request->set_upload(make_scoped_ptr( 903 request->set_upload(make_scoped_ptr(
930 request_data.request_body->ResolveElementsAndCreateUploadDataStream( 904 request_data.request_body->ResolveElementsAndCreateUploadDataStream(
931 filter_->blob_storage_context()->controller(), 905 filter_->blob_storage_context()->controller(),
932 filter_->file_system_context(), 906 filter_->file_system_context(),
933 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)))); 907 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))));
934 } 908 }
935 909
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 1674
1701 return i->second.get(); 1675 return i->second.get();
1702 } 1676 }
1703 1677
1704 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id, 1678 ResourceLoader* ResourceDispatcherHostImpl::GetLoader(int child_id,
1705 int request_id) const { 1679 int request_id) const {
1706 return GetLoader(GlobalRequestID(child_id, request_id)); 1680 return GetLoader(GlobalRequestID(child_id, request_id));
1707 } 1681 }
1708 1682
1709 } // namespace content 1683 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/resource_dispatcher.h » ('j') | content/common/view_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698