OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 425 |
426 // The special case is runtime.lastError which is only occasionally set, so | 426 // The special case is runtime.lastError which is only occasionally set, so |
427 // specifically check its availability. | 427 // specifically check its availability. |
428 if (schema.namespace == 'runtime' && | 428 if (schema.namespace == 'runtime' && |
429 GetAvailability('runtime.lastError').is_available) { | 429 GetAvailability('runtime.lastError').is_available) { |
430 success = true; | 430 success = true; |
431 } | 431 } |
432 | 432 |
433 if (!success) { | 433 if (!success) { |
434 // If an API was available it should have been successfully generated. | 434 // If an API was available it should have been successfully generated. |
435 logging.DCHECK(!GetAvailability(schema.namespace).is_available); | 435 var availability = GetAvailability(schema.namespace); |
| 436 logging.DCHECK(!availability.is_available); |
436 console.error('chrome.' + schema.namespace + ' is not available: ' + | 437 console.error('chrome.' + schema.namespace + ' is not available: ' + |
437 availability.message); | 438 availability.message); |
438 return; | 439 return; |
439 } | 440 } |
440 | 441 |
441 this.runHooks_(mod); | 442 this.runHooks_(mod); |
442 return mod; | 443 return mod; |
443 } | 444 } |
444 }; | 445 }; |
445 | 446 |
446 exports.Binding = Binding; | 447 exports.Binding = Binding; |
OLD | NEW |