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

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

Issue 347283004: Convert mock4js line endings to LF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 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
OLDNEW
1 /** 1 /**
2 * Subscriber 2 * Subscriber
3 */ 3 */
4 function Subscriber() { 4 function Subscriber() {
5 } 5 }
6 6
7 Subscriber.prototype = { 7 Subscriber.prototype = {
8 receive: function(message) { 8 receive: function(message) {
9 } 9 }
10 } 10 }
11 11
12 /** 12 /**
13 * Publisher 13 * Publisher
14 */ 14 */
15 function Publisher() { 15 function Publisher() {
16 this._subscribers = []; 16 this._subscribers = [];
17 } 17 }
18 18
19 Publisher.prototype = { 19 Publisher.prototype = {
20 publish: function(message) { 20 publish: function(message) {
21 for(var i=0; i<this._subscribers.length; i++) { 21 for(var i=0; i<this._subscribers.length; i++) {
22 var subscriber = this._subscribers[i]; 22 var subscriber = this._subscribers[i];
23 subscriber.receive(message); 23 subscriber.receive(message);
24 } 24 }
25 }, 25 },
26 add: function(subscriber) { 26 add: function(subscriber) {
27 this._subscribers.push(subscriber); 27 this._subscribers.push(subscriber);
28 } 28 }
29 } 29 }
OLDNEW
« no previous file with comments | « chrome/third_party/mock4js/examples/PriceServiceTest.html ('k') | chrome/third_party/mock4js/examples/PublisherTest.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698