|
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}
Total comments: 30
Total comments: 30
Total comments: 17
Total comments: 4
|
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
|
Total messages: 25 (12 generated)
|