| Index: chrome/renderer/resources/extensions/data_reduction_proxy.js
|
| diff --git a/chrome/renderer/resources/extensions/data_reduction_proxy.js b/chrome/renderer/resources/extensions/data_reduction_proxy.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9265b2c196950264644c5275f8dc17c581a422f6
|
| --- /dev/null
|
| +++ b/chrome/renderer/resources/extensions/data_reduction_proxy.js
|
| @@ -0,0 +1,26 @@
|
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// Custom binding for the dataReductionProxy API
|
| +
|
| +var sendRequest = require('sendRequest').sendRequest;
|
| +var validate = require('schemaUtils').validate;
|
| +
|
| +function extendSchema(schema) {
|
| + var extendedSchema = $Array.slice(schema);
|
| + extendedSchema.unshift({'type': 'string'});
|
| + return extendedSchema;
|
| +}
|
| +
|
| +function DataSavings(contentType, settingSchema) {
|
| + this.clear = function(details, callback) {
|
| + var clearSchema = this.functionSchemas.clear.definition.parameters;
|
| + validate([details, callback], clearSchema);
|
| + return sendRequest('dataReductionProxy.dataSavings.clear',
|
| + [contentType, details, callback],
|
| + extendSchema(clearSchema));
|
| + };
|
| +}
|
| +
|
| +exports.DataSavings = DataSavings;
|
|
|