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

Unified Diff: chrome/renderer/resources/extensions/data_reduction_proxy.js

Issue 1048113003: Implementation of API to clear savings data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ClearSavingsData
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698