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

Side by Side Diff: android_webview/browser/aw_form_database_service.cc

Issue 2403773002: Remove stl_util's STLDeleteContainerPointers from autofill. (Closed)
Patch Set: rebase Created 4 years, 2 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "android_webview/browser/aw_form_database_service.h" 5 #include "android_webview/browser/aw_form_database_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "components/autofill/core/browser/webdata/autofill_table.h" 10 #include "components/autofill/core/browser/webdata/autofill_table.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 autofill_data_->GetCountOfValuesContainedBetween( 99 autofill_data_->GetCountOfValuesContainedBetween(
100 base::Time(), base::Time::Max(), this); 100 base::Time(), base::Time::Max(), this);
101 PendingQuery query; 101 PendingQuery query;
102 query.result = result; 102 query.result = result;
103 query.completion = completion; 103 query.completion = completion;
104 result_map_[pending_query_handle] = query; 104 result_map_[pending_query_handle] = query;
105 } 105 }
106 106
107 void AwFormDatabaseService::OnWebDataServiceRequestDone( 107 void AwFormDatabaseService::OnWebDataServiceRequestDone(
108 WebDataServiceBase::Handle h, 108 WebDataServiceBase::Handle h,
109 const WDTypedResult* result) { 109 std::unique_ptr<WDTypedResult> result) {
110
111 DCHECK_CURRENTLY_ON(BrowserThread::DB); 110 DCHECK_CURRENTLY_ON(BrowserThread::DB);
112 bool has_form_data = false; 111 bool has_form_data = false;
113 if (result) { 112 if (result) {
114 DCHECK_EQ(AUTOFILL_VALUE_RESULT, result->GetType()); 113 DCHECK_EQ(AUTOFILL_VALUE_RESULT, result->GetType());
115 const WDResult<int>* autofill_result = 114 const WDResult<int>* autofill_result =
116 static_cast<const WDResult<int>*>(result); 115 static_cast<const WDResult<int>*>(result.get());
117 has_form_data = autofill_result->GetValue() > 0; 116 has_form_data = autofill_result->GetValue() > 0;
118 } 117 }
119 QueryMap::const_iterator it = result_map_.find(h); 118 QueryMap::const_iterator it = result_map_.find(h);
120 if (it == result_map_.end()) { 119 if (it == result_map_.end()) {
121 LOG(WARNING) << "Received unexpected callback from web data service"; 120 LOG(WARNING) << "Received unexpected callback from web data service";
122 return; 121 return;
123 } 122 }
124 *(it->second.result) = has_form_data; 123 *(it->second.result) = has_form_data;
125 it->second.completion->Signal(); 124 it->second.completion->Signal();
126 result_map_.erase(h); 125 result_map_.erase(h);
127 } 126 }
128 127
129 } // namespace android_webview 128 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_form_database_service.h ('k') | chrome/browser/autofill/form_structure_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698