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

Side by Side Diff: chrome/third_party/mock4js/examples/PriceService.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 * PriceCache
3 */
4 function PriceCache() {
5 }
6
7 PriceCache.prototype = {
8 getCachedPrice: function(instrumentId) {
9 },
10 setCachedPrice: function(instrumentId, price) {
11 }
12 }
13
14 /**
15 * PriceFetcher
16 */
17 function PriceFetcher() {
18 }
19
20 PriceFetcher.prototype = {
21 getPriceFromServer: function(instrumentId) {
22 }
23 }
24
25
26 /**
27 * PriceService
28 */
29 function PriceService(priceFetcher, priceCache) {
30 this._priceFetcher = priceFetcher;
31 this._priceCache = priceCache;
32 }
33
34 PriceService.prototype = {
35 getPrice: function(instrumentId) {
36 var price = this._priceCache.getCachedPrice(instrumentId);
37 if(price==null) {
38 price = this._priceFetcher.getPriceFromServer(instrument Id);
39 this._priceCache.setCachedPrice(instrumentId, price);
40 }
41 return price;
42 }
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698