Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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; |
| OLD | NEW |