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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-jigged to use ModuleSystem Created 8 years, 10 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 | Annotate | Revision Log
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 chrome = chrome || {};
6 (function () { 5 (function () {
7 native function GetChromeHidden(); 6 var natives = requireNative('event_bindings');
Aaron Boodman 2012/02/28 02:42:59 eventBindingsNatives?
koz (OOO until 15th September) 2012/03/01 03:41:56 Done, here and elsewhere.
8 native function AttachEvent(eventName); 7 var AttachEvent = natives.AttachEvent;
9 native function DetachEvent(eventName, manual); 8 var DetachEvent = natives.DetachEvent;
10 native function Print(); 9 var Print = natives.Print;
11 10
12 var chromeHidden = GetChromeHidden(); 11 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
13 12
14 // Local implementation of JSON.parse & JSON.stringify that protect us 13 // Local implementation of JSON.parse & JSON.stringify that protect us
15 // from being clobbered by an extension. 14 // from being clobbered by an extension.
16 // 15 //
17 // TODO(aa): This makes me so sad. We shouldn't need it, as we can just pass 16 // 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 17 // Values directly over IPC without serializing to strings and use
19 // JSONValueConverter. 18 // JSONValueConverter.
20 chromeHidden.JSON = new (function() { 19 chromeHidden.JSON = new (function() {
21 var $Object = Object; 20 var $Object = Object;
22 var $Array = Array; 21 var $Array = Array;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 var event = allAttachedEvents[i]; 304 var event = allAttachedEvents[i];
306 if (event) 305 if (event)
307 event.detach_(false); 306 event.detach_(false);
308 } 307 }
309 }; 308 };
310 309
311 chromeHidden.dispatchError = function(msg) { 310 chromeHidden.dispatchError = function(msg) {
312 console.error(msg); 311 console.error(msg);
313 }; 312 };
314 })(); 313 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698