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

Side by Side Diff: chrome/renderer/resources/extensions/schema_generated_bindings.js

Issue 10890002: Make V8ValueConverter.FromV8Value behave similarly to JSON.stringify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use the actual objects, not empty objects Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This script contains privileged chrome extension related javascript APIs. 5 // This script contains privileged chrome extension related javascript APIs.
6 // It is loaded by pages whose URL has the chrome-extension protocol. 6 // It is loaded by pages whose URL has the chrome-extension protocol.
7 7
8 // TODO(battre): cleanup the usage of packages everywhere, as described here 8 // TODO(battre): cleanup the usage of packages everywhere, as described here
9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e xtensions/schema_generated_bindings.js 9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e xtensions/schema_generated_bindings.js
10 10
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 args = this.updateArgumentsPreValidate.apply(this, args); 304 args = this.updateArgumentsPreValidate.apply(this, args);
305 305
306 args = schemaUtils.normalizeArgumentsAndValidate(args, this); 306 args = schemaUtils.normalizeArgumentsAndValidate(args, this);
307 if (this.updateArgumentsPostValidate) 307 if (this.updateArgumentsPostValidate)
308 args = this.updateArgumentsPostValidate.apply(this, args); 308 args = this.updateArgumentsPostValidate.apply(this, args);
309 309
310 var retval; 310 var retval;
311 if (this.handleRequest) { 311 if (this.handleRequest) {
312 retval = this.handleRequest.apply(this, args); 312 retval = this.handleRequest.apply(this, args);
313 } else { 313 } else {
314 var optArgs = {
315 customCallback: this.customCallback,
316 allowFunctionsInObjects: functionDef.allow_functions_in_objects
317 };
314 retval = sendRequest(this.name, args, 318 retval = sendRequest(this.name, args,
315 this.definition.parameters, 319 this.definition.parameters,
316 {customCallback: this.customCallback}); 320 optArgs);
317 } 321 }
318 322
319 // Validate return value if defined - only in debug. 323 // Validate return value if defined - only in debug.
320 if (chromeHidden.validateCallbacks && 324 if (chromeHidden.validateCallbacks &&
321 this.definition.returns) { 325 this.definition.returns) {
322 schemaUtils.validate([retval], [this.definition.returns]); 326 schemaUtils.validate([retval], [this.definition.returns]);
323 } 327 }
324 return retval; 328 return retval;
325 }).bind(apiFunction); 329 }).bind(apiFunction);
326 }); 330 });
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // beginInstallWithManifest2. 442 // beginInstallWithManifest2.
439 // See http://crbug.com/100242 443 // See http://crbug.com/100242
440 if (chrome.webstorePrivate) { 444 if (chrome.webstorePrivate) {
441 chrome.webstorePrivate.beginInstallWithManifest2 = 445 chrome.webstorePrivate.beginInstallWithManifest2 =
442 chrome.webstorePrivate.beginInstallWithManifest3; 446 chrome.webstorePrivate.beginInstallWithManifest3;
443 } 447 }
444 448
445 if (chrome.test) 449 if (chrome.test)
446 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; 450 chrome.test.getApiDefinitions = GetExtensionAPIDefinition;
447 }); 451 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698