|
|
Created:
6 years, 10 months ago by mferreria Modified:
6 years, 9 months ago CC:
chromium-reviews, arv+watch_chromium.org, rlarocque Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
Description[invalidations] Added list of registered handlers to about:invalidations
This patch is a follow-up to issue 147353011 (SVN Rev 250458)
This patch adds the list of every InvalidationHandler registered in the
active InvalidationService. This was needed because potentially an
InvalidationHandler can be registered for invalidations but have no
ObjectsId registered yet, so they wouldn't appear on neither the table
nor the event log. This patch allows listing those handlers.
BUG=263863
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=253677
Patch Set 1 #
Total comments: 18
Patch Set 2 : Fixed nits and some refactoring #
Total comments: 6
Patch Set 3 : Added some JSDoc, improved readability #
Total comments: 8
Patch Set 4 : Fixed nits and some unittests #Patch Set 5 : Fixed a bad use of multiset erase #Patch Set 6 : Rebased and restart the CQ #Messages
Total messages: 41 (0 generated)
I've marked down which files you should review for this patch. Thank you. rlarocque/zea: chrome/browser/invalidation/invalidation_logger.cc chrome/browser/invalidation/invalidation_logger.h chrome/browser/invalidation/invalidation_logger_observer.h chrome/browser/invalidation/invalidation_logger_unittest.cc chrome/browser/invalidation/ticl_invalidation_service.cc dbeam: chrome/browser/resources/about_invalidations.html chrome/browser/resources/about_invalidations.js chrome/browser/ui/webui/invalidations_message_handler.cc chrome/browser/ui/webui/invalidations_message_handler.h
mainly nits https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... File chrome/browser/resources/about_invalidations.html (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.html:20: <span class='lead'>Registered InvalidationHandlers:</span> class="lead" (everywhere, sorry you found a bad example to copy) https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... File chrome/browser/resources/about_invalidations.js (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:131: * nit: remove blank line (this isn't common in most other js code in chrome) https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:132: * @param {Array of strings} allHandlers An array of Strings that are @param {!Array.<string>} ... https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:183: updateState: updateState nit: , at end https://codereview.chromium.org/166903013/diff/1/chrome/browser/ui/webui/inva... File chrome/browser/ui/webui/invalidations_message_handler.cc (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/ui/webui/inva... chrome/browser/ui/webui/invalidations_message_handler.cc:105: scoped_ptr<base::ListValue> InvalidationsMessageHandler::HandlersToList( just inline HandlersToList() in OnRegistrationChange so you don't need another method in the header (as it's only used once) https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... File chrome/test/data/webui/about_invalidations_browsertest.js (right): https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:106: chrome.invalidations.updateHandlers(registeredHandlers); chrome.invalidations.updateHandlers(['FakeApi', 'FakeClient']); https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:108: expectTrue($('registered-handlers').textContent.indexOf('FakeClient') != -1); nit: expectNE($('registered-handlers').textContent.indexOf('FakeApi'), -1); etc. https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:111: chrome.invalidations.updateHandlers(registeredHandlers); chrome.invalidations.updateHandlers(['FakeClient']); https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:113: expectTrue($('registered-handlers').textContent.indexOf('FakeClient') != -1); expectEquals($('registered-handlers').textContent.indexOf('FakeClient'), -1);
Thank you for your comments Dan. https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... File chrome/browser/resources/about_invalidations.html (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.html:20: <span class='lead'>Registered InvalidationHandlers:</span> On 2014/02/22 00:44:16, Dan Beam wrote: > class="lead" (everywhere, sorry you found a bad example to copy) Done. https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... File chrome/browser/resources/about_invalidations.js (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:131: * On 2014/02/22 00:44:16, Dan Beam wrote: > nit: remove blank line (this isn't common in most other js code in chrome) Done. https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:132: * @param {Array of strings} allHandlers An array of Strings that are On 2014/02/22 00:44:16, Dan Beam wrote: > @param {!Array.<string>} ... Done. https://codereview.chromium.org/166903013/diff/1/chrome/browser/resources/abo... chrome/browser/resources/about_invalidations.js:183: updateState: updateState On 2014/02/22 00:44:16, Dan Beam wrote: > nit: , at end Done. https://codereview.chromium.org/166903013/diff/1/chrome/browser/ui/webui/inva... File chrome/browser/ui/webui/invalidations_message_handler.cc (right): https://codereview.chromium.org/166903013/diff/1/chrome/browser/ui/webui/inva... chrome/browser/ui/webui/invalidations_message_handler.cc:105: scoped_ptr<base::ListValue> InvalidationsMessageHandler::HandlersToList( On 2014/02/22 00:44:16, Dan Beam wrote: > just inline HandlersToList() in OnRegistrationChange so you don't need another > method in the header (as it's only used once) Done. Applying the same criteria, I inlined another method that did the same thing. https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... File chrome/test/data/webui/about_invalidations_browsertest.js (right): https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:106: chrome.invalidations.updateHandlers(registeredHandlers); On 2014/02/22 00:44:16, Dan Beam wrote: > chrome.invalidations.updateHandlers(['FakeApi', 'FakeClient']); Done. https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:108: expectTrue($('registered-handlers').textContent.indexOf('FakeClient') != -1); On 2014/02/22 00:44:16, Dan Beam wrote: > nit: expectNE($('registered-handlers').textContent.indexOf('FakeApi'), -1); etc. Done. https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:111: chrome.invalidations.updateHandlers(registeredHandlers); On 2014/02/22 00:44:16, Dan Beam wrote: > chrome.invalidations.updateHandlers(['FakeClient']); Done. https://codereview.chromium.org/166903013/diff/1/chrome/test/data/webui/about... chrome/test/data/webui/about_invalidations_browsertest.js:113: expectTrue($('registered-handlers').textContent.indexOf('FakeClient') != -1); On 2014/02/22 00:44:16, Dan Beam wrote: > expectEquals($('registered-handlers').textContent.indexOf('FakeClient'), -1); Done.
lgtm https://codereview.chromium.org/166903013/diff/110001/chrome/browser/resource... File chrome/browser/resources/about_invalidations.js (right): https://codereview.chromium.org/166903013/diff/110001/chrome/browser/resource... chrome/browser/resources/about_invalidations.js:59: * @param {Array.<object>} allInvalidations The array of ObjectId nit: technically !Array.<Object> or !Array.<!Object> if none of the members can be null (jsdoc is weird, I know) https://developers.google.com/closure/compiler/docs/js-for-compiler https://codereview.chromium.org/166903013/diff/110001/chrome/browser/ui/webui... File chrome/browser/ui/webui/invalidations_message_handler.cc (right): https://codereview.chromium.org/166903013/diff/110001/chrome/browser/ui/webui... chrome/browser/ui/webui/invalidations_message_handler.cc:83: base::DictionaryValue* dic = new base::DictionaryValue; nit: leave this as scoped_ptr<> -> .release() as if you added a: base::DictionaryValue* dic = new base::DictionValue; if (blah) continue; // or break; you'd then have a leak https://codereview.chromium.org/166903013/diff/110001/chrome/test/data/webui/... File chrome/test/data/webui/about_invalidations_browsertest.js (right): https://codereview.chromium.org/166903013/diff/110001/chrome/test/data/webui/... chrome/test/data/webui/about_invalidations_browsertest.js:104: TEST_F('InvalidationsWebUITest', 'testUpdatingRegisteredHandlers', function() { nit: function text() { return $('registered-handlers').textContent; } // re-use text() to reduce wrapping
https://codereview.chromium.org/166903013/diff/110001/chrome/browser/resource... File chrome/browser/resources/about_invalidations.js (right): https://codereview.chromium.org/166903013/diff/110001/chrome/browser/resource... chrome/browser/resources/about_invalidations.js:59: * @param {Array.<object>} allInvalidations The array of ObjectId On 2014/02/22 01:59:49, Dan Beam wrote: > nit: technically !Array.<Object> or !Array.<!Object> if none of the members can > be null (jsdoc is weird, I know) > > https://developers.google.com/closure/compiler/docs/js-for-compiler Wasn't familiar with that piece of documentation. Bookmarked for future reference, thanks. Done. https://codereview.chromium.org/166903013/diff/110001/chrome/browser/ui/webui... File chrome/browser/ui/webui/invalidations_message_handler.cc (right): https://codereview.chromium.org/166903013/diff/110001/chrome/browser/ui/webui... chrome/browser/ui/webui/invalidations_message_handler.cc:83: base::DictionaryValue* dic = new base::DictionaryValue; On 2014/02/22 01:59:49, Dan Beam wrote: > nit: leave this as scoped_ptr<> -> .release() as if you added a: > > base::DictionaryValue* dic = new base::DictionValue; > if (blah) > continue; // or break; > > you'd then have a leak Valid concern. Done. https://codereview.chromium.org/166903013/diff/110001/chrome/test/data/webui/... File chrome/test/data/webui/about_invalidations_browsertest.js (right): https://codereview.chromium.org/166903013/diff/110001/chrome/test/data/webui/... chrome/test/data/webui/about_invalidations_browsertest.js:104: TEST_F('InvalidationsWebUITest', 'testUpdatingRegisteredHandlers', function() { On 2014/02/22 01:59:49, Dan Beam wrote: > nit: > > function text() { return $('registered-handlers').textContent; } > // re-use text() to reduce wrapping Great idea. Done.
Nicolas, We just discussed with Richard that you should review these files and then he will gloss over them for his LGTM (because you are not in the OWNER file for them). Thanks! chrome/browser/invalidation/invalidation_logger.cc chrome/browser/invalidation/invalidation_logger.h chrome/browser/invalidation/invalidation_logger_observer.h chrome/browser/invalidation/invalidation_logger_unittest.cc chrome/browser/invalidation/ticl_invalidation_service.cc
LGTM with nits and a style comment. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/invalidation_logger.h (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger.h:8: #include <map> #include set also, newline between the std includes and the chromium ones https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/invalidation_logger_unittest.cc (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger_unittest.cc:12: class InvalidationLoggerTest : public testing::Test { Style comment: Typically we have the test logic be within the InvalidationLoggerTest class, rather than have a separate InvalidationLoggerObserverTest class and this class not doing anything. That way you don't need to instantiate a observer_test in all of your tests, and can make all the member variables protected. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger_unittest.cc:56: bool registration_change_received; newline above. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/ticl_invalidation_service.cc (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/ticl_invalidation_service.cc:115: // Log this registration nit: No need for this comment (and the one below). It's pretty clear that we're logging the registration/unregistration calls without it.
https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/invalidation_logger.h (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger.h:8: #include <map> On 2014/02/24 21:44:19, Nicolas Zea wrote: > #include set > > also, newline between the std includes and the chromium ones Done. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/invalidation_logger_unittest.cc (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger_unittest.cc:12: class InvalidationLoggerTest : public testing::Test { On 2014/02/24 21:44:19, Nicolas Zea wrote: > Style comment: Typically we have the test logic be within the > InvalidationLoggerTest class, rather than have a separate > InvalidationLoggerObserverTest class and this class not doing anything. That way > you don't need to instantiate a observer_test in all of your tests, and can make > all the member variables protected. Makes sense. Ended up deleting class InvalidationLoggerTest and changed TEST_F into TEST, because there was no need for a fixture in this case. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/invalidation_logger_unittest.cc:56: bool registration_change_received; On 2014/02/24 21:44:19, Nicolas Zea wrote: > newline above. Done. https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... File chrome/browser/invalidation/ticl_invalidation_service.cc (right): https://codereview.chromium.org/166903013/diff/210001/chrome/browser/invalida... chrome/browser/invalidation/ticl_invalidation_service.cc:115: // Log this registration On 2014/02/24 21:44:19, Nicolas Zea wrote: > nit: No need for this comment (and the one below). It's pretty clear that we're > logging the registration/unregistration calls without it. Done.
nit for commit message: I think we usually refer to other CLs by SVN revision number rather than codereview issue number. lgtm.
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/240001
The CQ bit was unchecked by [email protected]
Retried try job too often on win_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/240001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/240001
The CQ bit was unchecked by [email protected]
Retried try job too often on win_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/240001
The CQ bit was unchecked by [email protected]
Try jobs failed on following builders: mac_chromium_rel
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
The CQ bit was unchecked by [email protected]
The CQ bit was checked by [email protected]
The CQ bit was unchecked by [email protected]
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/260001
The CQ bit was unchecked by [email protected]
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/280001
The CQ bit was unchecked by [email protected]
Try jobs failed on following builders: linux_chromium_rel
The CQ bit was checked by [email protected]
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/166903013/280001
Message was sent while issue was closed.
Change committed as 253677 |