Skip to content

Commit

Permalink
Storage API
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Voytenko committed Jan 27, 2016
1 parent 179835b commit 02314e4
Show file tree
Hide file tree
Showing 8 changed files with 1,000 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build-system/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = {
// This does match dist.3p/current, so we run presubmit checks on the
// built 3p binary. This is done, so we make sure our special 3p checks
// run against the entire transitive closure of deps.
'!{node_modules,build,dist,dist.tools,' +
'!{node_modules,build,examples.build,dist,dist.tools,' +
'dist.3p/[0-9]*,dist.3p/current-min}/**/*.*',
'!validator/node_modules/**/*.*',
'!build-system/tasks/presubmit-checks.js',
Expand Down
22 changes: 22 additions & 0 deletions build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ var forbiddenTerms = {
'extensions/amp-analytics/0.1/amp-analytics.js',
],
},
'installStorageService': {
message: privateServiceFactory,
whitelist: [
'extensions/amp-analytics/0.1/amp-analytics.js',
'src/service/storage-impl.js',
],
},
'installViewerService': {
message: privateServiceFactory,
whitelist: [
Expand Down Expand Up @@ -111,6 +118,14 @@ var forbiddenTerms = {
'src/service/standard-actions-impl.js',
],
},
'sendMessage': {
message: privateServiceFactory,
whitelist: [
'src/service/viewer-impl.js',
'src/service/storage-impl.js',
'examples/viewer-integr-messaging.js',
],
},
// Privacy sensitive
'cidFor': {
message: requiresReviewPrivacy,
Expand Down Expand Up @@ -169,10 +184,17 @@ var forbiddenTerms = {
]
},
'eval\\(': '',
'storageFor': {
message: requiresReviewPrivacy,
whitelist: [
'src/storage.js',
],
},
'localStorage': {
message: requiresReviewPrivacy,
whitelist: [
'src/service/cid-impl.js',
'src/service/storage-impl.js',
],
},
'sessionStorage': requiresReviewPrivacy,
Expand Down
13 changes: 7 additions & 6 deletions extensions/amp-analytics/0.1/amp-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
* limitations under the License.
*/

import {ANALYTICS_CONFIG} from './vendors';
import {addListener} from './instrumentation';
import {assertHttpsUrl} from '../../../src/url';
import {expandTemplate} from '../../../src/string';
import {installCidService} from '../../../src/service/cid-impl';
import {installStorageService} from '../../../src/service/storage-impl';
import {isArray, isObject} from '../../../src/types';
import {log} from '../../../src/log';
import {sendRequest} from './transport';
import {urlReplacementsFor} from '../../../src/url-replacements';
import {expandTemplate} from '../../../src/string';
import {xhrFor} from '../../../src/xhr';
import {isArray, isObject} from '../../../src/types';

import {addListener} from './instrumentation';
import {sendRequest} from './transport';
import {ANALYTICS_CONFIG} from './vendors';


installCidService(AMP.win);
installStorageService(AMP.win);


export class AmpAnalytics extends AMP.BaseElement {
Expand Down
Loading

0 comments on commit 02314e4

Please sign in to comment.