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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | « content/common/npobject_stub.cc ('k') | content/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) 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/common/resource_dispatcher.h" 7 #include "content/common/resource_dispatcher.h"
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 return; 560 return;
561 } 561 }
562 PendingRequestInfo& request_info = it->second; 562 PendingRequestInfo& request_info = it->second;
563 if (value) { 563 if (value) {
564 request_info.is_deferred = value; 564 request_info.is_deferred = value;
565 } else if (request_info.is_deferred) { 565 } else if (request_info.is_deferred) {
566 request_info.is_deferred = false; 566 request_info.is_deferred = false;
567 567
568 FollowPendingRedirect(request_id, request_info); 568 FollowPendingRedirect(request_id, request_info);
569 569
570 MessageLoop::current()->PostTask(FROM_HERE, 570 base::MessageLoop::current()->PostTask(
571 FROM_HERE,
571 base::Bind(&ResourceDispatcher::FlushDeferredMessages, 572 base::Bind(&ResourceDispatcher::FlushDeferredMessages,
572 weak_factory_.GetWeakPtr(), request_id)); 573 weak_factory_.GetWeakPtr(),
574 request_id));
573 } 575 }
574 } 576 }
575 577
576 void ResourceDispatcher::DidChangePriority( 578 void ResourceDispatcher::DidChangePriority(
577 int routing_id, int request_id, net::RequestPriority new_priority) { 579 int routing_id, int request_id, net::RequestPriority new_priority) {
578 DCHECK(ContainsKey(pending_requests_, request_id)); 580 DCHECK(ContainsKey(pending_requests_, request_id));
579 message_sender()->Send(new ResourceHostMsg_DidChangePriority( 581 message_sender()->Send(new ResourceHostMsg_DidChangePriority(
580 routing_id, request_id, new_priority)); 582 routing_id, request_id, new_priority));
581 } 583 }
582 584
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { 750 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) {
749 while (!queue->empty()) { 751 while (!queue->empty()) {
750 IPC::Message* message = queue->front(); 752 IPC::Message* message = queue->front();
751 ReleaseResourcesInDataMessage(*message); 753 ReleaseResourcesInDataMessage(*message);
752 queue->pop_front(); 754 queue->pop_front();
753 delete message; 755 delete message;
754 } 756 }
755 } 757 }
756 758
757 } // namespace content 759 } // namespace content
OLDNEW
« no previous file with comments | « content/common/npobject_stub.cc ('k') | content/common/resource_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698