Description[Sync] Migrate SyncInternalsMessageHandler off CallJavascriptFunctionUnsafe.
This CL is a result of comments in
https://codereview.chromium.org/2872023002/ that became too large to be
included in the original code review. These changes should make
SyncInternalsMessageHandler behave more safely in regards to when
javascript methods are invoked, as well as increasing test coverage.
* Replaced CallJavascriptFunctionUnsafe with CallJavascriptFunction.
This mostly worked by adding AllowJavascript to all callbacks from
javascript, and unregistering from model callbacks/observations in
OnJavascriptDisallowed(). However, this didn't work for
OnReceivedAllNodes, which is called asycronously. Instead we need to
manually verify IsJavascriptAllowed() is still true.
* Moved SigninManagerBase accessor from ProfileSyncService to
SyncService[Base]. This allowed us to remove the SyncManagerBase param
from the ConstructAboutInformation function. In general we want to move
things out of ProfileSyncService that don't have a reason to be there.
* Reworked how SyncInternalsMessageHandler accesses a SyncService to
facilitate unit tests.
* Replaced extractor with callback to be more similar to SyncService
injection pattern.
* Added test coverage for registration/unregistration.
BUG=719044
Review-Url: https://codereview.chromium.org/2898723003
Cr-Commit-Position: refs/heads/master@{#474755}
Committed: https://chromium.googlesource.com/chromium/src/+/b522e5fd22c3454dff23fc48b43bafebd160a543
Patch Set 1 #Patch Set 2 : Self review. #Patch Set 3 : Removed unused browser_state. #Patch Set 4 : Fix Android compile. #
Total comments: 6
Patch Set 5 : Updates for dbeam and fixing windows browser test. #
Total comments: 8
Patch Set 6 : More updates for dbeam. #Dependent Patchsets: Messages
Total messages: 31 (22 generated)
|