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

Side by Side Diff: content/browser/renderer_host/buffered_resource_handler.cc

Issue 10501004: Refactor the guts of ResourceDispatcherHostImpl into a new class named (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
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 #include "content/browser/renderer_host/buffered_resource_handler.h" 5 #include "content/browser/renderer_host/buffered_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // Remove the non-owning pointer to the CrossSiteResourceHandler, if any, 390 // Remove the non-owning pointer to the CrossSiteResourceHandler, if any,
391 // from the extra request info because the CrossSiteResourceHandler (part of 391 // from the extra request info because the CrossSiteResourceHandler (part of
392 // the original ResourceHandler chain) will be deleted by the next statement. 392 // the original ResourceHandler chain) will be deleted by the next statement.
393 ResourceRequestInfoImpl* info = 393 ResourceRequestInfoImpl* info =
394 ResourceRequestInfoImpl::ForRequest(request_); 394 ResourceRequestInfoImpl::ForRequest(request_);
395 info->set_cross_site_handler(NULL); 395 info->set_cross_site_handler(NULL);
396 396
397 // This is handled entirely within the new ResourceHandler, so just reset the 397 // This is handled entirely within the new ResourceHandler, so just reset the
398 // original ResourceHandler. 398 // original ResourceHandler.
399 next_handler_ = handler.Pass(); 399 next_handler_ = handler.Pass();
400 next_handler_->SetController(controller());
400 401
401 next_handler_needs_response_started_ = true; 402 next_handler_needs_response_started_ = true;
402 next_handler_needs_will_read_ = true; 403 next_handler_needs_will_read_ = true;
403 404
404 return ForwardPendingEventsToNextHandler(request_id, defer); 405 return ForwardPendingEventsToNextHandler(request_id, defer);
405 } 406 }
406 407
407 bool BufferedResourceHandler::ForwardPendingEventsToNextHandler(int request_id, 408 bool BufferedResourceHandler::ForwardPendingEventsToNextHandler(int request_id,
408 bool* defer) { 409 bool* defer) {
409 if (next_handler_needs_response_started_) { 410 if (next_handler_needs_response_started_) {
(...skipping 29 matching lines...) Expand all
439 const std::vector<webkit::WebPluginInfo>& plugins) { 440 const std::vector<webkit::WebPluginInfo>& plugins) {
440 bool needs_resume = deferred_waiting_for_plugins_; 441 bool needs_resume = deferred_waiting_for_plugins_;
441 deferred_waiting_for_plugins_ = false; 442 deferred_waiting_for_plugins_ = false;
442 443
443 wait_for_plugins_ = false; 444 wait_for_plugins_ = false;
444 if (!request_) 445 if (!request_)
445 return; 446 return;
446 447
447 ResourceRequestInfoImpl* info = 448 ResourceRequestInfoImpl* info =
448 ResourceRequestInfoImpl::ForRequest(request_); 449 ResourceRequestInfoImpl::ForRequest(request_);
449 int child_id = info->GetChildID();
450 int request_id = info->GetRequestID(); 450 int request_id = info->GetRequestID();
451 451
452 bool defer = false; 452 bool defer = false;
453 if (!CompleteResponseStarted(request_id, &defer)) { 453 if (!CompleteResponseStarted(request_id, &defer)) {
454 host_->CancelRequest(child_id, request_id, false); 454 controller()->Cancel();
455 } else if (!defer && needs_resume) { 455 } else if (!defer && needs_resume) {
456 host_->ResumeDeferredRequest(child_id, request_id); 456 controller()->Resume();
457 } 457 }
458 } 458 }
459 459
460 } // namespace content 460 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698