OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Custom binding for the dataReductionProxy API |
| 6 |
| 7 var sendRequest = require('sendRequest').sendRequest; |
| 8 var validate = require('schemaUtils').validate; |
| 9 |
| 10 function extendSchema(schema) { |
| 11 var extendedSchema = $Array.slice(schema); |
| 12 extendedSchema.unshift({'type': 'string'}); |
| 13 return extendedSchema; |
| 14 } |
| 15 |
| 16 function DataSavings(contentType, settingSchema) { |
| 17 this.clear = function(details, callback) { |
| 18 var clearSchema = this.functionSchemas.clear.definition.parameters; |
| 19 validate([details, callback], clearSchema); |
| 20 return sendRequest('dataReductionProxy.dataSavings.clear', |
| 21 [contentType, details, callback], |
| 22 extendSchema(clearSchema)); |
| 23 }; |
| 24 } |
| 25 |
| 26 exports.DataSavings = DataSavings; |
OLD | NEW |