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

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

Issue 1840453002: [Extensions] More bindings hardening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Custom binding for the Identity API. 5 // Custom binding for the Identity API.
6 6
7 var binding = require('binding').Binding.create('identity'); 7 var binding = require('binding').Binding.create('identity');
8 8
9 binding.registerCustomHook(function(binding, id, contextType) { 9 binding.registerCustomHook(function(binding, id, contextType) {
10 var apiFunctions = binding.apiFunctions; 10 var apiFunctions = binding.apiFunctions;
11 var identity = binding.compiledApi; 11 var identity = binding.compiledApi;
12 12
13 apiFunctions.setHandleRequest('getRedirectURL', function(path) { 13 apiFunctions.setHandleRequest('getRedirectURL', function(path) {
14 if (path === null || path === undefined) 14 if (path === null || path === undefined)
15 path = '/'; 15 path = '/';
16 else 16 else
17 path = String(path); 17 path = String(path);
18 if (path[0] != '/') 18 if (path[0] != '/')
19 path = '/' + path; 19 path = '/' + path;
20 return 'https://' + id + '.chromiumapp.org' + path; 20 return 'https://' + id + '.chromiumapp.org' + path;
21 }); 21 });
22 }); 22 });
23 23
24 exports.binding = binding.generate(); 24 exports.$set('binding', binding.generate());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698