Skip to content

Commit

Permalink
Remove CachedXhr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Vializ committed Mar 16, 2017
1 parent d0a25ea commit e47c3f1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 373 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-list/0.1/amp-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import {assertHttpsUrl, getFragment} from '../../../src/url';
import {cachedXhrFor} from '../../../src/cached-xhr';
import {xhrFor} from '../../../src/xhr';
import {getPath} from '../../../src/utils/object';
import {getValueForExpr} from '../../../src/json';
import {isLayoutSizeDefined} from '../../../src/layout';
Expand Down Expand Up @@ -65,7 +65,7 @@ export class AmpList extends AMP.BaseElement {
if (!opts.credentials) {
opts.requireAmpResponseSourceOrigin = false;
}
const fetchPromise = cachedXhrFor(this.win).fetchJson(src, opts);
const fetchPromise = xhrFor(this.win).fetchJson(src, opts);
const fragment = getFragment(src).slice(1);
return fragment ?
fetchPromise.then(json => getPath(json, fragment)) :
Expand Down
6 changes: 2 additions & 4 deletions extensions/amp-list/0.1/test/test-amp-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

import {AmpList} from '../amp-list';
import {ampdocServiceFor} from '../../../../src/ampdoc';
import {
cachedXhrServiceForTesting,
} from '../../../../src/service/cached-xhr-impl';
import {xhrServiceForTesting} from '../../../../src/service/xhr-impl';
import {templatesFor} from '../../../../src/template';
import * as sinon from 'sinon';

Expand All @@ -40,7 +38,7 @@ describe('amp-list component', () => {
templates = templatesFor(window);
templatesMock = sandbox.mock(templates);

xhr = cachedXhrServiceForTesting(window);
xhr = xhrServiceForTesting(window);
xhrMock = sandbox.mock(xhr);

const ampdoc = ampdocServiceFor(window).getAmpDoc();
Expand Down
27 changes: 0 additions & 27 deletions src/cached-xhr.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import {installViewerServiceForDoc, setViewerVisibilityState,} from
import {installViewportServiceForDoc} from './service/viewport-impl';
import {installVsyncService} from './service/vsync-impl';
import {installXhrService} from './service/xhr-impl';
import {installCachedXhrService} from './service/cached-xhr-impl';
import {isExperimentOn, toggleExperiment} from './experiments';
import {parseUrl} from './url';
import {platformFor} from './platform';
Expand Down Expand Up @@ -119,7 +118,6 @@ export function installRuntimeServices(global) {
installTimerService(global);
installVsyncService(global);
installXhrService(global);
installCachedXhrService(global);
installTemplatesService(global);
}

Expand Down
117 changes: 0 additions & 117 deletions src/service/cached-xhr-impl.js

This file was deleted.

Loading

0 comments on commit e47c3f1

Please sign in to comment.