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

Issue 245923002: Bring events to JavaScript components (Closed)

Created:
6 years, 8 months ago by kelvinp
Modified:
6 years, 8 months ago
CC:
chromium-reviews, chromoting-reviews_chromium.org
Visibility:
Public.

Description

A simple implementation to augment JavaScript objects with events For example, to create an alarm event for SmokeDetector function SmokeDetector() { this.defineEvents(['alarm']); }; base.augment(SmokeDetector, base.Events); To fire an event SmokeDetector.prototype.onCarbonMonoxideDetected = function () { var param = {} // optional parameters this.raiseEvent('alarm', param); } To listen to an event var smokeDetector = new SmokeDetector(); smokeDetector.addEventListener('alarm',listenerObj.someCallback,listenerObj); The code lives in (base.js), a module that contains JavaScript utility components and methods for the web app. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266164

Patch Set 1 : Add base.js and Event Listeners #

Total comments: 80

Patch Set 2 : Address feedbacks #

Total comments: 20

Patch Set 3 : Address feedbacks - format nit and remove this #

Patch Set 4 : Simplify event handling #

Total comments: 18

Patch Set 5 : Last round of CL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+233 lines, -1 line) Patch
M remoting/remoting_webapp_files.gypi View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M remoting/webapp/all_js_load.gtestjs View 1 chunk +1 line, -0 lines 0 comments Download
A remoting/webapp/base.js View 1 2 3 4 1 chunk +228 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
kelvinp
6 years, 8 months ago (2014-04-21 22:30:20 UTC) #1
Sergey Ulanov
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode1 remoting/webapp/base.js:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
6 years, 8 months ago (2014-04-22 00:43:20 UTC) #2
Jamie
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode15 remoting/webapp/base.js:15: var Debug = {}; Is there a reason for ...
6 years, 8 months ago (2014-04-22 01:23:21 UTC) #3
rmsousa
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode50 remoting/webapp/base.js:50: * @param {Disposable} obj Disposable isn't base JS. Are ...
6 years, 8 months ago (2014-04-22 02:25:35 UTC) #4
kelvinp
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode1 remoting/webapp/base.js:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
6 years, 8 months ago (2014-04-23 00:24:20 UTC) #5
kelvinp
6 years, 8 months ago (2014-04-23 18:39:26 UTC) #6
Jamie
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode77 remoting/webapp/base.js:77: * @suppress {checkTypes} On 2014/04/23 00:24:20, kelvinp wrote: > ...
6 years, 8 months ago (2014-04-23 21:52:57 UTC) #7
Sergey Ulanov
I just have style nits - will let Jamie finish the review. https://codereview.chromium.org/245923002/diff/60001/remoting/webapp/base.js File remoting/webapp/base.js ...
6 years, 8 months ago (2014-04-23 22:40:26 UTC) #8
kelvinp
https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/20001/remoting/webapp/base.js#newcode121 remoting/webapp/base.js:121: ev[type] = { On 2014/04/23 21:52:57, Jamie wrote: > ...
6 years, 8 months ago (2014-04-24 01:15:38 UTC) #9
kelvinp
6 years, 8 months ago (2014-04-24 19:59:38 UTC) #10
kelvinp
6 years, 8 months ago (2014-04-24 20:19:08 UTC) #11
Wez
Looks like the latest patch set is corrupt?
6 years, 8 months ago (2014-04-24 20:28:29 UTC) #12
kelvinp
On 2014/04/24 20:28:29, Wez wrote: > Looks like the latest patch set is corrupt? Are ...
6 years, 8 months ago (2014-04-24 20:36:19 UTC) #13
Jamie
lgtm once my comments are addressed. Happy to take another look if any of them ...
6 years, 8 months ago (2014-04-24 20:38:33 UTC) #14
Wez
LGTM once Jamie's comments are addressed. https://codereview.chromium.org/245923002/diff/110001/remoting/webapp/base.js File remoting/webapp/base.js (right): https://codereview.chromium.org/245923002/diff/110001/remoting/webapp/base.js#newcode170 remoting/webapp/base.js:170: /** nit: I ...
6 years, 8 months ago (2014-04-24 20:45:14 UTC) #15
kelvinp
Last round of CL
6 years, 8 months ago (2014-04-24 21:35:28 UTC) #16
kelvinp
https://codereview.chromium.org/245923002/diff/110001/remoting/remoting_webapp_files.gypi File remoting/remoting_webapp_files.gypi (right): https://codereview.chromium.org/245923002/diff/110001/remoting/remoting_webapp_files.gypi#newcode123 remoting/remoting_webapp_files.gypi:123: '<@(remoting_webapp_js_core_files)', On 2014/04/24 20:38:34, Jamie wrote: > Please keep ...
6 years, 8 months ago (2014-04-24 21:38:32 UTC) #17
kelvinp
The CQ bit was checked by kelvinp@chromium.org
6 years, 8 months ago (2014-04-24 21:38:38 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kelvinp@chromium.org/245923002/130001
6 years, 8 months ago (2014-04-24 22:02:06 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 23:11:02 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-24 23:11:02 UTC) #21
kelvinp
The CQ bit was checked by kelvinp@chromium.org
6 years, 8 months ago (2014-04-24 23:58:21 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kelvinp@chromium.org/245923002/130001
6 years, 8 months ago (2014-04-24 23:58:34 UTC) #23
commit-bot: I haz the power
6 years, 8 months ago (2014-04-25 08:55:21 UTC) #24
Message was sent while issue was closed.
Change committed as 266164

Powered by Google App Engine
This is Rietveld 408576698