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

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

Issue 2041033003: clang-tidy WaitableEvent refactor (Android side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0_windows
Patch Set: Created 4 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
« no previous file with comments | « no previous file | android_webview/browser/test/fake_window.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) 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void AwFormDatabaseService::ClearFormDataImpl() { 72 void AwFormDatabaseService::ClearFormDataImpl() {
73 base::Time begin; 73 base::Time begin;
74 base::Time end = base::Time::Max(); 74 base::Time end = base::Time::Max();
75 autofill_data_->RemoveFormElementsAddedBetween(begin, end); 75 autofill_data_->RemoveFormElementsAddedBetween(begin, end);
76 autofill_data_->RemoveAutofillDataModifiedBetween(begin, end); 76 autofill_data_->RemoveAutofillDataModifiedBetween(begin, end);
77 } 77 }
78 78
79 bool AwFormDatabaseService::HasFormData() { 79 bool AwFormDatabaseService::HasFormData() {
80 WaitableEvent completion(false, false); 80 WaitableEvent completion(base::WaitableEvent::ResetPolicy::AUTOMATIC,
81 base::WaitableEvent::InitialState::NOT_SIGNALED);
81 bool result = false; 82 bool result = false;
82 BrowserThread::PostTask( 83 BrowserThread::PostTask(
83 BrowserThread::DB, 84 BrowserThread::DB,
84 FROM_HERE, 85 FROM_HERE,
85 base::Bind(&AwFormDatabaseService::HasFormDataImpl, 86 base::Bind(&AwFormDatabaseService::HasFormDataImpl,
86 base::Unretained(this), 87 base::Unretained(this),
87 &completion, 88 &completion,
88 &result)); 89 &result));
89 completion.Wait(); 90 completion.Wait();
90 return result; 91 return result;
(...skipping 27 matching lines...) Expand all
118 if (it == result_map_.end()) { 119 if (it == result_map_.end()) {
119 LOG(WARNING) << "Received unexpected callback from web data service"; 120 LOG(WARNING) << "Received unexpected callback from web data service";
120 return; 121 return;
121 } 122 }
122 *(it->second.result) = has_form_data; 123 *(it->second.result) = has_form_data;
123 it->second.completion->Signal(); 124 it->second.completion->Signal();
124 result_map_.erase(h); 125 result_map_.erase(h);
125 } 126 }
126 127
127 } // namespace android_webview 128 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/test/fake_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698