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 chrome = chrome || {}; | 5 var GetChromeHidden = natives.GetChromeHidden; |
6 (function () { | 6 var AttachEvent = natives.AttachEvent; |
7 native function GetChromeHidden(); | 7 var DetachEvent = natives.DetachEvent; |
8 native function AttachEvent(eventName); | 8 var Print = natives.Print; |
9 native function DetachEvent(eventName); | |
10 native function Print(); | |
11 | 9 |
12 var chromeHidden = GetChromeHidden(); | 10 var chromeHidden = GetChromeHidden(); |
13 | 11 |
14 // Local implementation of JSON.parse & JSON.stringify that protect us | 12 // Local implementation of JSON.parse & JSON.stringify that protect us |
15 // from being clobbered by an extension. | 13 // from being clobbered by an extension. |
16 // | 14 // |
17 // TODO(aa): This makes me so sad. We shouldn't need it, as we can just pass | 15 // TODO(aa): This makes me so sad. We shouldn't need it, as we can just pass |
18 // Values directly over IPC without serializing to strings and use | 16 // Values directly over IPC without serializing to strings and use |
19 // JSONValueConverter. | 17 // JSONValueConverter. |
20 chromeHidden.JSON = new (function() { | 18 chromeHidden.JSON = new (function() { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 for (var i = 0; i < allAttachedEvents.length; ++i) { | 239 for (var i = 0; i < allAttachedEvents.length; ++i) { |
242 var event = allAttachedEvents[i]; | 240 var event = allAttachedEvents[i]; |
243 if (event) | 241 if (event) |
244 event.detach_(); | 242 event.detach_(); |
245 } | 243 } |
246 }; | 244 }; |
247 | 245 |
248 chromeHidden.dispatchError = function(msg) { | 246 chromeHidden.dispatchError = function(msg) { |
249 console.error(msg); | 247 console.error(msg); |
250 }; | 248 }; |
251 })(); | |
OLD | NEW |