| Index: chrome/third_party/mock4js/examples/PriceService.js
|
| diff --git a/chrome/third_party/mock4js/examples/PriceService.js b/chrome/third_party/mock4js/examples/PriceService.js
|
| index f20aa9394c53dfd3f35f04e934951d2e2df212b4..825fd8823d5868c927f385ea375f959d98838115 100644
|
| --- a/chrome/third_party/mock4js/examples/PriceService.js
|
| +++ b/chrome/third_party/mock4js/examples/PriceService.js
|
| @@ -1,43 +1,43 @@
|
| -/**
|
| - * PriceCache
|
| - */
|
| -function PriceCache() {
|
| -}
|
| -
|
| -PriceCache.prototype = {
|
| - getCachedPrice: function(instrumentId) {
|
| - },
|
| - setCachedPrice: function(instrumentId, price) {
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * PriceFetcher
|
| - */
|
| -function PriceFetcher() {
|
| -}
|
| -
|
| -PriceFetcher.prototype = {
|
| - getPriceFromServer: function(instrumentId) {
|
| - }
|
| -}
|
| -
|
| -
|
| -/**
|
| - * PriceService
|
| - */
|
| -function PriceService(priceFetcher, priceCache) {
|
| - this._priceFetcher = priceFetcher;
|
| - this._priceCache = priceCache;
|
| -}
|
| -
|
| -PriceService.prototype = {
|
| - getPrice: function(instrumentId) {
|
| - var price = this._priceCache.getCachedPrice(instrumentId);
|
| - if(price==null) {
|
| - price = this._priceFetcher.getPriceFromServer(instrumentId);
|
| - this._priceCache.setCachedPrice(instrumentId, price);
|
| - }
|
| - return price;
|
| - }
|
| -}
|
| +/**
|
| + * PriceCache
|
| + */
|
| +function PriceCache() {
|
| +}
|
| +
|
| +PriceCache.prototype = {
|
| + getCachedPrice: function(instrumentId) {
|
| + },
|
| + setCachedPrice: function(instrumentId, price) {
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * PriceFetcher
|
| + */
|
| +function PriceFetcher() {
|
| +}
|
| +
|
| +PriceFetcher.prototype = {
|
| + getPriceFromServer: function(instrumentId) {
|
| + }
|
| +}
|
| +
|
| +
|
| +/**
|
| + * PriceService
|
| + */
|
| +function PriceService(priceFetcher, priceCache) {
|
| + this._priceFetcher = priceFetcher;
|
| + this._priceCache = priceCache;
|
| +}
|
| +
|
| +PriceService.prototype = {
|
| + getPrice: function(instrumentId) {
|
| + var price = this._priceCache.getCachedPrice(instrumentId);
|
| + if(price==null) {
|
| + price = this._priceFetcher.getPriceFromServer(instrumentId);
|
| + this._priceCache.setCachedPrice(instrumentId, price);
|
| + }
|
| + return price;
|
| + }
|
| +}
|
|
|