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

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

Issue 38573008: Add "platforms" key in IDL schema compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 7 years, 1 month 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 (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 var Event = require('event_bindings').Event; 5 var Event = require('event_bindings').Event;
6 var forEach = require('utils').forEach; 6 var forEach = require('utils').forEach;
7 var GetAvailability = requireNative('v8_context').GetAvailability; 7 var GetAvailability = requireNative('v8_context').GetAvailability;
8 var logActivity = requireNative('activityLogger'); 8 var logActivity = requireNative('activityLogger');
9 var logging = requireNative('logging'); 9 var logging = requireNative('logging');
10 var process = requireNative('process'); 10 var process = requireNative('process');
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 for (var i = 0; i < platforms.length; i++) { 108 for (var i = 0; i < platforms.length; i++) {
109 if ($RegExp.test(platforms[i][0], navigator.appVersion)) { 109 if ($RegExp.test(platforms[i][0], navigator.appVersion)) {
110 return platforms[i][1]; 110 return platforms[i][1];
111 } 111 }
112 } 112 }
113 return "unknown"; 113 return "unknown";
114 } 114 }
115 115
116 function isPlatformSupported(schemaNode, platform) { 116 function isPlatformSupported(schemaNode, platform) {
117 return !schemaNode.platforms || 117 return !schemaNode.platforms || schemaNode.platforms.length == 0 ||
not at google - send to devlin 2013/10/25 17:00:08 if something specificies "platforms: []" then it s
Haojian Wu 2013/10/26 03:15:51 Done.
118 schemaNode.platforms.indexOf(platform) > -1; 118 schemaNode.platforms.indexOf(platform) > -1;
119 } 119 }
120 120
121 function isManifestVersionSupported(schemaNode, manifestVersion) { 121 function isManifestVersionSupported(schemaNode, manifestVersion) {
122 return !schemaNode.maximumManifestVersion || 122 return !schemaNode.maximumManifestVersion ||
123 manifestVersion <= schemaNode.maximumManifestVersion; 123 manifestVersion <= schemaNode.maximumManifestVersion;
124 } 124 }
125 125
126 function isSchemaNodeSupported(schemaNode, platform, manifestVersion) { 126 function isSchemaNodeSupported(schemaNode, platform, manifestVersion) {
127 return isPlatformSupported(schemaNode, platform) && 127 return isPlatformSupported(schemaNode, platform) &&
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 availability.message); 425 availability.message);
426 return; 426 return;
427 } 427 }
428 428
429 this.runHooks_(mod); 429 this.runHooks_(mod);
430 return mod; 430 return mod;
431 } 431 }
432 }; 432 };
433 433
434 exports.Binding = Binding; 434 exports.Binding = Binding;
OLDNEW
« no previous file with comments | « no previous file | tools/json_schema_compiler/idl_schema.py » ('j') | tools/json_schema_compiler/idl_schema.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698