New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 817293 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
hobby only
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Task

Blocking:
issue 817292



Sign in to add a comment

Write serialised passwords in PasswordUIViewAndroid instead of SavePasswordsPreferences

Project Member Reported by vabr@chromium.org, Feb 28 2018

Issue description

Currently, the passwords export on Android handles serialisation and storing of passwords as follows:

(1) SavePasswordsPreferences (Java) requests serialisation.
(2) PasswordUIViewAndroid (C++) obtains the passwords, serialises them and send back over to Java.
(3) SavePasswordsPreferences create a file in Chrome's cache and write the serialised passwords to it.

Instead, we could do the following:

(1) SavePasswordsPreferences (Java) creates a file in Chrome's cache and request serialisation into it.
(2) PasswordUIViewAndroid (C++) obtains the passwords, serialises them, writes them into the prepared file and signals success or error back to Java.
(3) SavePasswordsPreferences report the error to the user or let them use the stored data.


Pointed out in https://chromium-review.googlesource.com/c/chromium/src/+/926527/2/chrome/browser/android/password_ui_view_android.cc#222 .
 

Comment 1 by kolos@chromium.org, Mar 12 2018

Status: Assigned (was: Untriaged)
As vabr@ assigned the but to himself, changing the status.  

Comment 2 by vabr@chromium.org, Mar 27 2018

Status: started (was: Assigned)
CL in progress at https://crrev.com/c/980882.
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aaa406a9f17e221b8f96e1cb20f8657352657f00

commit aaa406a9f17e221b8f96e1cb20f8657352657f00
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed Mar 28 16:00:05 2018

[Android] Write exported passwords to disk in C++

On Android, passwords exported from settings are serialized in native
code but written to disk in the Java code.

The Java code should focus on UI handling, whereas the native code
should provide backend services. Therefore it makes sense to move the
writing of the data to the native code as well. This is accomplised in
this CL.

As a bonus, this allows the code to go back to using single-parameter
callbacks and hence to remove the custom ByteArrayIntCallback class.

Bug:  817293 
Change-Id: I224263dd66106a193f05f8ab933d48ddd6cbab20
Reviewed-on: https://chromium-review.googlesource.com/980882
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546505}
[delete] https://crrev.com/eee63eee9be83197a081b054cc5e07d0a593e58d/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/ByteArrayIntCallback.java
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/ExportFlow.java
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordManagerHandler.java
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordUIView.java
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/android/java_sources.gni
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/browser/BUILD.gn
[delete] https://crrev.com/eee63eee9be83197a081b054cc5e07d0a593e58d/chrome/browser/android/byte_array_int_callback.cc
[delete] https://crrev.com/eee63eee9be83197a081b054cc5e07d0a593e58d/chrome/browser/android/byte_array_int_callback.h
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/browser/android/password_ui_view_android.cc
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/browser/android/password_ui_view_android.h
[modify] https://crrev.com/aaa406a9f17e221b8f96e1cb20f8657352657f00/chrome/browser/android/password_ui_view_android_unittest.cc

Comment 4 by vabr@chromium.org, Mar 28 2018

Status: Fixed (was: Started)

Sign in to add a comment