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

Side by Side Diff: chrome/third_party/mock4js/examples/Publisher.js

Issue 7237030: Added options browser_tests using the generator and js handler framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestNavigationController in ui_test_utils, renamed LoadStart->JsInjectionReady, reordered methods. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /**
2 * Subscriber
3 */
4 function Subscriber() {
5 }
6
7 Subscriber.prototype = {
8 receive: function(message) {
9 }
10 }
11
12 /**
13 * Publisher
14 */
15 function Publisher() {
16 this._subscribers = [];
17 }
18
19 Publisher.prototype = {
20 publish: function(message) {
21 for(var i=0; i<this._subscribers.length; i++) {
22 var subscriber = this._subscribers[i];
23 subscriber.receive(message);
24 }
25 },
26 add: function(subscriber) {
27 this._subscribers.push(subscriber);
28 }
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698