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

Side by Side Diff: chrome/common/resource_dispatcher.cc

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « chrome/common/render_messages_internal.h ('k') | chrome/common/resource_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/resource_dispatcher.h" 7 #include "chrome/common/resource_dispatcher.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 NOTREACHED() << "Trying to (un)defer an unstarted request"; 206 NOTREACHED() << "Trying to (un)defer an unstarted request";
207 return; 207 return;
208 } 208 }
209 209
210 dispatcher_->SetDefersLoading(request_id_, value); 210 dispatcher_->SetDefersLoading(request_id_, value);
211 } 211 }
212 212
213 void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { 213 void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
214 if (request_id_ != -1) { 214 if (request_id_ != -1) {
215 NOTREACHED() << "Starting a request twice"; 215 NOTREACHED() << "Starting a request twice";
216 response->status.set_status(URLRequestStatus::FAILED); 216 response->status.set_status(net::URLRequestStatus::FAILED);
217 return; 217 return;
218 } 218 }
219 219
220 request_id_ = MakeRequestID(); 220 request_id_ = MakeRequestID();
221 221
222 SyncLoadResult result; 222 SyncLoadResult result;
223 IPC::SyncMessage* msg = new ViewHostMsg_SyncLoad(routing_id_, request_id_, 223 IPC::SyncMessage* msg = new ViewHostMsg_SyncLoad(routing_id_, request_id_,
224 request_, &result); 224 request_, &result);
225 // NOTE: This may pump events (see RenderThread::Send). 225 // NOTE: This may pump events (see RenderThread::Send).
226 if (!dispatcher_->message_sender()->Send(msg)) { 226 if (!dispatcher_->message_sender()->Send(msg)) {
227 response->status.set_status(URLRequestStatus::FAILED); 227 response->status.set_status(net::URLRequestStatus::FAILED);
228 return; 228 return;
229 } 229 }
230 230
231 response->status = result.status; 231 response->status = result.status;
232 response->url = result.final_url; 232 response->url = result.final_url;
233 response->headers = result.headers; 233 response->headers = result.headers;
234 response->mime_type = result.mime_type; 234 response->mime_type = result.mime_type;
235 response->charset = result.charset; 235 response->charset = result.charset;
236 response->request_time = result.request_time; 236 response->request_time = result.request_time;
237 response->response_time = result.response_time; 237 response->response_time = result.response_time;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 416
417 void ResourceDispatcher::FollowPendingRedirect( 417 void ResourceDispatcher::FollowPendingRedirect(
418 int request_id, 418 int request_id,
419 PendingRequestInfo& request_info) { 419 PendingRequestInfo& request_info) {
420 IPC::Message* msg = request_info.pending_redirect_message.release(); 420 IPC::Message* msg = request_info.pending_redirect_message.release();
421 if (msg) 421 if (msg)
422 message_sender()->Send(msg); 422 message_sender()->Send(msg);
423 } 423 }
424 424
425 void ResourceDispatcher::OnRequestComplete(int request_id, 425 void ResourceDispatcher::OnRequestComplete(int request_id,
426 const URLRequestStatus& status, 426 const net::URLRequestStatus& status,
427 const std::string& security_info, 427 const std::string& security_info,
428 const base::Time& completion_time) { 428 const base::Time& completion_time) {
429 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); 429 PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
430 if (!request_info) 430 if (!request_info)
431 return; 431 return;
432 432
433 webkit_glue::ResourceLoaderBridge::Peer* peer = request_info->peer; 433 webkit_glue::ResourceLoaderBridge::Peer* peer = request_info->peer;
434 434
435 if (status.status() == URLRequestStatus::CANCELED && 435 if (status.status() == net::URLRequestStatus::CANCELED &&
436 status.os_error() != net::ERR_ABORTED) { 436 status.os_error() != net::ERR_ABORTED) {
437 // Resource canceled with a specific error are filtered. 437 // Resource canceled with a specific error are filtered.
438 SecurityFilterPeer* new_peer = 438 SecurityFilterPeer* new_peer =
439 SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( 439 SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest(
440 request_info->resource_type, 440 request_info->resource_type,
441 request_info->peer, 441 request_info->peer,
442 status.os_error()); 442 status.os_error());
443 if (new_peer) { 443 if (new_peer) {
444 request_info->peer = new_peer; 444 request_info->peer = new_peer;
445 peer = new_peer; 445 peer = new_peer;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 609
610 // static 610 // static
611 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { 611 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) {
612 while (!queue->empty()) { 612 while (!queue->empty()) {
613 IPC::Message* message = queue->front(); 613 IPC::Message* message = queue->front();
614 ReleaseResourcesInDataMessage(*message); 614 ReleaseResourcesInDataMessage(*message);
615 queue->pop_front(); 615 queue->pop_front();
616 delete message; 616 delete message;
617 } 617 }
618 } 618 }
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/common/resource_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698