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

Issue 719044 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 701032



Sign in to add a comment

[Sync] Add a way to emit user events from sync-internals

Project Member Reported by s...@chromium.org, May 5 2017

Issue description

It should be fairly easy to emit a generic event with just timestamps. It'd be neat if we could have some free form json and a event type int that could be used to parse into a MessageLite object. Alternatively we could have custom UI for each event type, but that'd be a large maintenance burden.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 25 2017

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

commit b522e5fd22c3454dff23fc48b43bafebd160a543
Author: skym <skym@chromium.org>
Date: Thu May 25 19:36:06 2017

[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}

[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/sync/profile_sync_service_android.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/ui/webui/sync_internals_message_handler.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/ui/webui/sync_internals_message_handler.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/browser_sync/profile_sync_service.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/browser_sync/profile_sync_service.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/about_sync_util.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/about_sync_util.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/about_sync_util_unittest.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/fake_sync_service.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/fake_sync_service.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/sync_service.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/sync_service_base.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/driver/sync_service_base.h
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/components/sync/engine/events/protocol_event.cc
[modify] https://crrev.com/b522e5fd22c3454dff23fc48b43bafebd160a543/ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.cc

Project Member

Comment 2 by bugdroid1@chromium.org, May 25 2017

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

commit 6c146620037bf6c1222d5a0255be9a6ef2ce5137
Author: skym <skym@chromium.org>
Date: Thu May 25 21:39:04 2017

[Sync] Add a simple UI to sync-internals to create UserEvents.

Very simple UI and plumbing to create UserEvents from
chrome://sync-internals. Since there are not currently any defined
event types, we cannot do anything interesting. Currently expose text
fields to specify int64 event time and navigation time. Invalid
navigation time will result in meaningless event. Tab should be hidden
if the feature is not enabled (disabled is the default).

BUG= 719044 

Review-Url: https://codereview.chromium.org/2872023002
Cr-Commit-Position: refs/heads/master@{#474814}

[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/chrome/browser/ui/webui/sync_internals_message_handler.cc
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/chrome/browser/ui/webui/sync_internals_message_handler.h
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/chrome/browser/ui/webui/sync_internals_ui.cc
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/resources/OWNERS
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/resources/sync_driver_resources.grdp
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/about_sync_util.cc
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/about_sync_util.h
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/resources/chrome_sync.js
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/resources/index.html
[modify] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/resources/sync_index.js
[add] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/resources/user_events.html
[add] https://crrev.com/6c146620037bf6c1222d5a0255be9a6ef2ce5137/components/sync/driver/resources/user_events.js

Comment 3 by s...@chromium.org, Jun 1 2017

A bare bones solution exists and has been checked in. However, after https://codereview.chromium.org/2916133002/ lands, it will increase the nudge delay on user events to be extremely long, which is obnoxious when trying to create events from sync-internals. We should think about possible workarounds.

Comment 4 by s...@chromium.org, Jan 17 2018

Status: Fixed (was: Assigned)
This is done well enough. Our nudge is still slow, but everything else works fine.

Sign in to add a comment