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

Side by Side Diff: components/webdata/common/web_data_request_manager.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/webdata/common/web_data_request_manager.h" 5 #include "components/webdata/common/web_data_request_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h"
8 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
9 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
11 #include "base/single_thread_task_runner.h"
10 #include "base/stl_util.h" 12 #include "base/stl_util.h"
11 13
12 //////////////////////////////////////////////////////////////////////////////// 14 ////////////////////////////////////////////////////////////////////////////////
13 // 15 //
14 // WebDataRequest implementation. 16 // WebDataRequest implementation.
15 // 17 //
16 //////////////////////////////////////////////////////////////////////////////// 18 ////////////////////////////////////////////////////////////////////////////////
17 19
18 WebDataRequest::WebDataRequest(WebDataServiceConsumer* consumer, 20 WebDataRequest::WebDataRequest(WebDataServiceConsumer* consumer,
19 WebDataRequestManager* manager) 21 WebDataRequestManager* manager)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 NOTREACHED() << "Canceling a nonexistent web data service request"; 106 NOTREACHED() << "Canceling a nonexistent web data service request";
105 return; 107 return;
106 } 108 }
107 i->second->Cancel(); 109 i->second->Cancel();
108 pending_requests_.erase(i); 110 pending_requests_.erase(i);
109 } 111 }
110 112
111 void WebDataRequestManager::RequestCompleted( 113 void WebDataRequestManager::RequestCompleted(
112 scoped_ptr<WebDataRequest> request) { 114 scoped_ptr<WebDataRequest> request) {
113 base::MessageLoop* loop = request->GetMessageLoop(); 115 base::MessageLoop* loop = request->GetMessageLoop();
114 loop->PostTask(FROM_HERE, 116 loop->task_runner()->PostTask(
115 base::Bind(&WebDataRequestManager::RequestCompletedOnThread, 117 FROM_HERE, base::Bind(&WebDataRequestManager::RequestCompletedOnThread,
116 this, 118 this, base::Passed(&request)));
117 base::Passed(&request)));
118 } 119 }
119 120
120 void WebDataRequestManager::RequestCompletedOnThread( 121 void WebDataRequestManager::RequestCompletedOnThread(
121 scoped_ptr<WebDataRequest> request) { 122 scoped_ptr<WebDataRequest> request) {
122 if (request->IsCancelled()) 123 if (request->IsCancelled())
123 return; 124 return;
124 125
125 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is 126 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
126 // fixed. 127 // fixed.
127 tracked_objects::ScopedTracker tracking_profile1( 128 tracked_objects::ScopedTracker tracking_profile1(
(...skipping 22 matching lines...) Expand all
150 if (!request->IsCancelled()) { 151 if (!request->IsCancelled()) {
151 WebDataServiceConsumer* consumer = request->GetConsumer(); 152 WebDataServiceConsumer* consumer = request->GetConsumer();
152 request->OnComplete(); 153 request->OnComplete();
153 if (consumer) { 154 if (consumer) {
154 scoped_ptr<WDTypedResult> r = request->GetResult(); 155 scoped_ptr<WDTypedResult> r = request->GetResult();
155 consumer->OnWebDataServiceRequestDone(request->GetHandle(), r.get()); 156 consumer->OnWebDataServiceRequestDone(request->GetHandle(), r.get());
156 } 157 }
157 } 158 }
158 159
159 } 160 }
OLDNEW
« no previous file with comments | « components/web_resource/web_resource_service.cc ('k') | components/webdata/common/web_data_service_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698