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

Unified Diff: chrome/utility/importer/firefox_importer_unittest_utils_mac.cc

Issue 306123004: NSSDecryptor::ReadAndParseSignons() - improved password form scheme detection, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Naming fix Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/importer/firefox_importer_unittest_utils.h ('k') | chrome/utility/importer/nss_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
diff --git a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
index 9608f63c76161ffaf40e4d12b0302b6f858f2b26..6d896e847ed524319642b76429db53a0077f139c 100644
--- a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
@@ -83,13 +83,21 @@ class FFDecryptorServerChannelListener : public IPC::Listener {
base::MessageLoop::current()->Quit();
}
- void OnDecryptedTextResonse(const base::string16& decrypted_text) {
+ void OnDecryptedTextResponse(const base::string16& decrypted_text) {
DCHECK(!got_result);
result_string = decrypted_text;
got_result = true;
base::MessageLoop::current()->Quit();
}
+ void OnParseSignonsResponse(
+ const std::vector<autofill::PasswordForm>& parsed_vector) {
+ DCHECK(!got_result);
+ result_vector = parsed_vector;
+ got_result = true;
+ base::MessageLoop::current()->Quit();
+ }
+
void QuitClient() {
if (sender_)
sender_->Send(new Msg_Decryptor_Quit());
@@ -99,7 +107,8 @@ class FFDecryptorServerChannelListener : public IPC::Listener {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(FFDecryptorServerChannelListener, msg)
IPC_MESSAGE_HANDLER(Msg_Decryptor_InitReturnCode, OnInitDecryptorResponse)
- IPC_MESSAGE_HANDLER(Msg_Decryptor_Response, OnDecryptedTextResonse)
+ IPC_MESSAGE_HANDLER(Msg_Decryptor_Response, OnDecryptedTextResponse)
+ IPC_MESSAGE_HANDLER(Msg_ParseSignons_Response, OnParseSignonsResponse)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -113,6 +122,7 @@ class FFDecryptorServerChannelListener : public IPC::Listener {
// Results of IPC calls.
base::string16 result_string;
+ std::vector<autofill::PasswordForm> result_vector;
bool result_bool;
// True if IPC call succeeded and data in above variables is valid.
bool got_result;
@@ -210,6 +220,17 @@ base::string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) {
return base::string16();
}
+std::vector<autofill::PasswordForm> FFUnitTestDecryptorProxy::ParseSignons(
+ const base::FilePath& signons_path) {
+ channel_->Send(new Msg_ParseSignons(signons_path));
+ bool ok = WaitForClientResponse();
+ if (ok && listener_->got_result) {
+ listener_->got_result = false;
+ return listener_->result_vector;
+ }
+ return std::vector<autofill::PasswordForm>();
+}
+
//---------------------------- Child Process -----------------------
// Class to listen on the client side of the ipc channel, it calls through
@@ -233,6 +254,12 @@ class FFDecryptorClientChannelListener : public IPC::Listener {
sender_->Send(new Msg_Decryptor_Response(unencrypted_str));
}
+ void OnParseSignons(base::FilePath signons_path) {
+ std::vector<autofill::PasswordForm> forms;
+ decryptor_.ReadAndParseSignons(signons_path, &forms);
+ sender_->Send(new Msg_ParseSignons_Response(forms));
+ }
+
void OnQuitRequest() {
base::MessageLoop::current()->Quit();
}
@@ -242,6 +269,7 @@ class FFDecryptorClientChannelListener : public IPC::Listener {
IPC_BEGIN_MESSAGE_MAP(FFDecryptorClientChannelListener, msg)
IPC_MESSAGE_HANDLER(Msg_Decryptor_Init, OnDecryptor_Init)
IPC_MESSAGE_HANDLER(Msg_Decrypt, OnDecrypt)
+ IPC_MESSAGE_HANDLER(Msg_ParseSignons, OnParseSignons)
IPC_MESSAGE_HANDLER(Msg_Decryptor_Quit, OnQuitRequest)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
« no previous file with comments | « chrome/utility/importer/firefox_importer_unittest_utils.h ('k') | chrome/utility/importer/nss_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698