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

Side by Side Diff: chrome/browser/webdata/web_data_service.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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) 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/webdata/web_data_service.h" 5 #include "chrome/browser/webdata/web_data_service.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 } 941 }
942 942
943 void WebDataService::RemoveFormElementsAddedBetweenImpl( 943 void WebDataService::RemoveFormElementsAddedBetweenImpl(
944 GenericRequest2<Time, Time>* request) { 944 GenericRequest2<Time, Time>* request) {
945 InitializeDatabaseIfNecessary(); 945 InitializeDatabaseIfNecessary();
946 if (db_ && !request->IsCancelled()) { 946 if (db_ && !request->IsCancelled()) {
947 AutofillChangeList changes; 947 AutofillChangeList changes;
948 if (db_->RemoveFormElementsAddedBetween(request->GetArgument1(), 948 if (db_->RemoveFormElementsAddedBetween(request->GetArgument1(),
949 request->GetArgument2(), 949 request->GetArgument2(),
950 &changes)) { 950 &changes)) {
951 if (changes.size() > 0) { 951 if (!changes.empty()) {
952 request->SetResult( 952 request->SetResult(
953 new WDResult<AutofillChangeList>(AUTOFILL_CHANGES, changes)); 953 new WDResult<AutofillChangeList>(AUTOFILL_CHANGES, changes));
954 954
955 // Post the notifications including the list of affected keys. 955 // Post the notifications including the list of affected keys.
956 // This is sent here so that work resulting from this notification 956 // This is sent here so that work resulting from this notification
957 // will be done on the DB thread, and not the UI thread. 957 // will be done on the DB thread, and not the UI thread.
958 NotificationService::current()->Notify( 958 NotificationService::current()->Notify(
959 NotificationType::AUTOFILL_ENTRIES_CHANGED, 959 NotificationType::AUTOFILL_ENTRIES_CHANGED,
960 Source<WebDataService>(this), 960 Source<WebDataService>(this),
961 Details<AutofillChangeList>(&changes)); 961 Details<AutofillChangeList>(&changes));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 return result_; 1236 return result_;
1237 } 1237 }
1238 1238
1239 void WebDataService::WebDataRequest::RequestComplete() { 1239 void WebDataService::WebDataRequest::RequestComplete() {
1240 WebDataService* s = service_; 1240 WebDataService* s = service_;
1241 Task* t = NewRunnableMethod(s, 1241 Task* t = NewRunnableMethod(s,
1242 &WebDataService::RequestCompleted, 1242 &WebDataService::RequestCompleted,
1243 handle_); 1243 handle_);
1244 message_loop_->PostTask(FROM_HERE, t); 1244 message_loop_->PostTask(FROM_HERE, t);
1245 } 1245 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/window_snapshot/window_snapshot_mac.mm ('k') | chrome/browser/webdata/web_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698