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

Issue 1415533013: Fix password manager internals renderer reporting (Closed)

Created:
5 years, 1 month ago by vabr (Chromium)
Modified:
5 years, 1 month ago
Reviewers:
vasilii
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, rouslan+autofill_chromium.org, jam, vabr+watchlist_chromium.org, browser-components-watch_chromium.org, jdonnelly+autofillwatch_chromium.org, bondd+autofillwatch_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, estade+watch_chromium.org, gcasto+watchlist_chromium.org, mkwst+watchlist-passwords_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix password manager internals renderer reporting Background: Logs for chrome://password-manager-internals are collected both from renderer and from browser code. While browser code passes the data directly, renderer code needs to send it via IPC. IPC is also used to signal whether the internals page is open or not (so that logs are not generated if not needed). Issue: The IPC communication browser->renderer was done via RenderViewHost. Due to the switch from RenderViewHost to RenderFrameHost, this silently broke, the renderer code never got the message "internals page open, start sending logs", and hence renderer logs have been missing on the internals page for some time. This CL: Fixes the situation by sending IPCs through RenderFrameHost. However, while there has been a single RVH per WebContent, there is a single RFH per frame, of which there is a number per WebContents. In password manager, PasswordManagerClient corresponds to a WebContent, while PasswordManagerDriver corresponds to a frame. This CL thus needs to move the reporting methods from the client to the drivers. It also improves the abstraction of the reporting framework (see below). New reporting framework: Consists of 3 abstract interfaces: LogRouter, LogReceiver and LogManager. LogReceiver: Is an object able to receive a string to log, and display it to the user. This is implemented by the chrome://password-manager-internals WebUI. Potentially many instances (e.g., multiple internals tabs open). LogManager: Is an object able to gather logs from the code and tell whether logging is active (receivers ready) or not. After this CL, this is implemented by PasswordManager. The interface did not exist before, but its function used to be fulfilled by PasswordManagerClient. One per tab. LogRouter: This coordinates the managers and receivers. Both managers and receivers register with the router. The router keeps track of the "availability of logging" -- whether there are any receivers to receive logs or not, and distributes that information to the managers. It also routes the logs from the managers to the receivers. This is implemented by PasswordManagerInternalsService. One per profile. Old framework + introduced change: * There was no formal LogManager, although that function was fulfilled by PasswordManagerClient. The client also took care of the IPC communication. * The "manager-part" was shifted from the client to PasswordManager, while the IPC part was shifted to PasswordManagerDriver instances (of which the client owns a number). * The full chain of command when sending IPC messages is now: 1. LogReceiver instances register with LogRouter. 2. LogRouter notifies LogManager=PasswordManager. 3. PasswordManager asks PasswordManagerClient to notify the renderer. 4. PMC delegates to its ContentPasswordManagerDriverFactory. 5. The factory notifies each of the drivers. 6. Each driver sends the IPC. The steps 3-6 are new, they used to be a single step "PMC sends the IPC". FAQ: Why is LoginManager implemented by PasswordManager and not by PMC, as it used to be? -> The PMC should be a thin abstraction of embedder-dependent code. There is nothing embedder-dependent about the LoginManager. Notes: This has not been implemented on iOS yet, so the only client and driver implementations for this are ChromePMC and ContentPMD. BUG=549167 Committed: https://crrev.com/cb4ed16a9881ec356b26e9ffd250a5e018a7a18a Cr-Commit-Position: refs/heads/master@{#360313}

Patch Set 1 : All compiles #

Patch Set 2 : More tests pass #

Patch Set 3 : Added integration test #

Patch Set 4 : Fix Mac tests #

Patch Set 5 : Rebased #

Total comments: 30

Patch Set 6 : Just rebased #

Patch Set 7 : Comments addressed #

Patch Set 8 : Remove unused LogRouter #

Patch Set 9 : Rebased again #

Patch Set 10 : Fix tests #

Patch Set 11 : Separate dummy log manager #

Total comments: 30

Patch Set 12 : Just rebased #

Patch Set 13 : Comments addressed fixed broken suspending on WebUI renamed DummyLogManager to StubLogManager #

Patch Set 14 : Fix failing test #

Total comments: 17

Patch Set 15 : Just rebased #

Patch Set 16 : Further review comments #

Total comments: 4

Patch Set 17 : Just rebased #

Patch Set 18 : All comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+832 lines, -404 lines) Patch
M chrome/browser/password_manager/chrome_password_manager_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +5 lines, -10 lines 0 comments Download
M chrome/browser/password_manager/chrome_password_manager_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +29 lines, -54 lines 0 comments Download
M chrome/browser/password_manager/chrome_password_manager_client_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +42 lines, -101 lines 0 comments Download
M chrome/browser/password_manager/password_manager_browsertest.cc View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/browser/ui/login/login_prompt.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_state.cc View 1 2 3 4 5 6 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_state_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +4 lines, -14 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -37 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -17 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -0 lines 0 comments Download
M components/password_manager.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -1 line 0 comments Download
M components/password_manager/content/browser/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M components/password_manager/content/browser/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M components/password_manager/content/browser/content_password_manager_driver.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M components/password_manager/content/browser/content_password_manager_driver.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +14 lines, -4 lines 0 comments Download
M components/password_manager/content/browser/content_password_manager_driver_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -1 line 0 comments Download
M components/password_manager/content/browser/content_password_manager_driver_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +19 lines, -7 lines 0 comments Download
A components/password_manager/content/browser/content_password_manager_driver_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +115 lines, -0 lines 0 comments Download
M components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +2 lines, -12 lines 0 comments Download
M components/password_manager/core/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/browser_save_password_progress_logger.h View 1 2 chunks +6 lines, -7 lines 0 comments Download
M components/password_manager/core/browser/browser_save_password_progress_logger.cc View 1 3 chunks +6 lines, -5 lines 0 comments Download
M components/password_manager/core/browser/browser_save_password_progress_logger_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +7 lines, -7 lines 0 comments Download
A components/password_manager/core/browser/log_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +51 lines, -0 lines 0 comments Download
A components/password_manager/core/browser/log_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +94 lines, -0 lines 0 comments Download
A components/password_manager/core/browser/log_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +164 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/log_router.h View 1 2 3 4 5 6 2 chunks +16 lines, -14 lines 0 comments Download
M components/password_manager/core/browser/log_router.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +16 lines, -16 lines 0 comments Download
M components/password_manager/core/browser/log_router_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +44 lines, -36 lines 0 comments Download
M components/password_manager/core/browser/password_form_manager.cc View 1 2 3 4 5 6 4 chunks +10 lines, -6 lines 0 comments Download
M components/password_manager/core/browser/password_manager.cc View 1 2 3 4 5 6 7 9 chunks +25 lines, -16 lines 0 comments Download
M components/password_manager/core/browser/password_manager_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +4 lines, -13 lines 0 comments Download
M components/password_manager/core/browser/password_manager_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -12 lines 0 comments Download
M components/password_manager/core/browser/password_manager_driver.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
A components/password_manager/core/browser/stub_log_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +33 lines, -0 lines 0 comments Download
A components/password_manager/core/browser/stub_log_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +19 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/stub_password_manager_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +3 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/stub_password_manager_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (12 generated)
vabr (Chromium)
Hi Vasilii, Could you PTAL? Sorry that it is a big CL, I did shave ...
5 years, 1 month ago (2015-11-11 22:51:33 UTC) #11
vasilii
What is the benefit of moving the logic from the client to PasswordManager? Wouldn't it ...
5 years, 1 month ago (2015-11-12 16:27:35 UTC) #12
vabr (Chromium)
Hi Vasilii, PTAL. Guide: Diff patch set 8 versus 6 gives you how I addressed ...
5 years, 1 month ago (2015-11-12 21:55:44 UTC) #13
vasilii
https://codereview.chromium.org/1415533013/diff/300001/chrome/browser/password_manager/chrome_password_manager_client.cc File chrome/browser/password_manager/chrome_password_manager_client.cc (left): https://codereview.chromium.org/1415533013/diff/300001/chrome/browser/password_manager/chrome_password_manager_client.cc#oldcode432 chrome/browser/password_manager/chrome_password_manager_client.cc:432: IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordAutofillAgentConstructed, What happened to this message? https://codereview.chromium.org/1415533013/diff/300001/chrome/browser/password_manager/chrome_password_manager_client.h File chrome/browser/password_manager/chrome_password_manager_client.h ...
5 years, 1 month ago (2015-11-13 12:17:31 UTC) #14
vabr (Chromium)
Thanks, Vasilii! The saga continues. :) Sorry for renaming the Dummy to a Stub, I ...
5 years, 1 month ago (2015-11-13 20:48:19 UTC) #16
vasilii
https://codereview.chromium.org/1415533013/diff/300001/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc File chrome/browser/ui/passwords/manage_passwords_state_unittest.cc (right): https://codereview.chromium.org/1415533013/diff/300001/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc#newcode35 chrome/browser/ui/passwords/manage_passwords_state_unittest.cc:35: MOCK_CONST_METHOD0(GetLogManager, const password_manager::LogManager*()); On 2015/11/13 20:48:18, vabr (Chromium) wrote: ...
5 years, 1 month ago (2015-11-16 14:12:25 UTC) #17
vabr (Chromium)
Thanks, Vasilii! Some comments addressed, on the rest I pushed back. :) PTAL. Cheers, Vaclav ...
5 years, 1 month ago (2015-11-16 16:08:48 UTC) #18
vasilii
https://codereview.chromium.org/1415533013/diff/360001/components/password_manager/content/browser/content_password_manager_driver_unittest.cc File components/password_manager/content/browser/content_password_manager_driver_unittest.cc (right): https://codereview.chromium.org/1415533013/diff/360001/components/password_manager/content/browser/content_password_manager_driver_unittest.cc#newcode87 components/password_manager/content/browser/content_password_manager_driver_unittest.cc:87: logging_activated); On 2015/11/16 16:08:48, vabr (Chromium) wrote: > On ...
5 years, 1 month ago (2015-11-17 11:12:05 UTC) #19
vabr (Chromium)
All addressed, PTAL! Thanks, Vaclav https://codereview.chromium.org/1415533013/diff/360001/components/password_manager/content/browser/content_password_manager_driver_unittest.cc File components/password_manager/content/browser/content_password_manager_driver_unittest.cc (right): https://codereview.chromium.org/1415533013/diff/360001/components/password_manager/content/browser/content_password_manager_driver_unittest.cc#newcode87 components/password_manager/content/browser/content_password_manager_driver_unittest.cc:87: logging_activated); On 2015/11/17 11:12:05, ...
5 years, 1 month ago (2015-11-17 17:23:47 UTC) #20
vasilii
lgtm
5 years, 1 month ago (2015-11-17 19:05:24 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1415533013/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1415533013/440001
5 years, 1 month ago (2015-11-18 08:11:19 UTC) #23
commit-bot: I haz the power
Committed patchset #18 (id:440001)
5 years, 1 month ago (2015-11-18 09:49:35 UTC) #24
commit-bot: I haz the power
5 years, 1 month ago (2015-11-18 09:50:35 UTC) #25
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/cb4ed16a9881ec356b26e9ffd250a5e018a7a18a
Cr-Commit-Position: refs/heads/master@{#360313}

Powered by Google App Engine
This is Rietveld 408576698