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

Side by Side Diff: chrome/browser/history/history_extension_api.cc

Issue 8960010: base::Bind: Convert NewRunnableMethod in chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix 55. Created 9 years 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) 2011 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 #include "chrome/browser/history/history_extension_api.h" 5 #include "chrome/browser/history/history_extension_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 AddRef(); // Balanced in SendAysncRepose() and below. 214 AddRef(); // Balanced in SendAysncRepose() and below.
215 bool retval = RunAsyncImpl(); 215 bool retval = RunAsyncImpl();
216 if (false == retval) 216 if (false == retval)
217 Release(); 217 Release();
218 return retval; 218 return retval;
219 } 219 }
220 220
221 void HistoryFunctionWithCallback::SendAsyncResponse() { 221 void HistoryFunctionWithCallback::SendAsyncResponse() {
222 MessageLoop::current()->PostTask( 222 MessageLoop::current()->PostTask(
223 FROM_HERE, 223 FROM_HERE,
224 NewRunnableMethod( 224 base::Bind(&HistoryFunctionWithCallback::SendResponseToCallback, this));
225 this,
226 &HistoryFunctionWithCallback::SendResponseToCallback));
227 } 225 }
228 226
229 void HistoryFunctionWithCallback::SendResponseToCallback() { 227 void HistoryFunctionWithCallback::SendResponseToCallback() {
230 SendResponse(true); 228 SendResponse(true);
231 Release(); // Balanced in RunImpl(). 229 Release(); // Balanced in RunImpl().
232 } 230 }
233 231
234 bool GetVisitsHistoryFunction::RunAsyncImpl() { 232 bool GetVisitsHistoryFunction::RunAsyncImpl() {
235 DictionaryValue* json; 233 DictionaryValue* json;
236 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json)); 234 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json));
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 &cancelable_consumer_, 394 &cancelable_consumer_,
397 base::Bind(&DeleteAllHistoryFunction::DeleteComplete, 395 base::Bind(&DeleteAllHistoryFunction::DeleteComplete,
398 base::Unretained(this))); 396 base::Unretained(this)));
399 397
400 return true; 398 return true;
401 } 399 }
402 400
403 void DeleteAllHistoryFunction::DeleteComplete() { 401 void DeleteAllHistoryFunction::DeleteComplete() {
404 SendAsyncResponse(); 402 SendAsyncResponse();
405 } 403 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | chrome/browser/net/sqlite_origin_bound_cert_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698