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

Side by Side Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 42680: Add more of the server-side plumbing for extension APIs. Also (Closed)
Patch Set: Introduce SyncExtensionFunction Created 11 years, 9 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
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var chromium; 1 var chromium;
2 (function() { 2 (function() {
3 if (!chromium) 3 if (!chromium)
4 chromium = {}; 4 chromium = {};
5 5
6 // callback handling 6 // callback handling
7 var callbacks = []; 7 var callbacks = [];
8 chromium._dispatchCallback = function(callbackId, str) { 8 chromium._dispatchCallback = function(callbackId, str) {
9 // We shouldn't be receiving evil JSON unless the browser is owned, but just 9 // We shouldn't be receiving evil JSON unless the browser is owned, but just
10 // to be safe, we sanitize it. This regex mania was borrowed from json2, 10 // to be safe, we sanitize it. This regex mania was borrowed from json2,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (callback) { 57 if (callback) {
58 native function GetNextCallbackId(); 58 native function GetNextCallbackId();
59 callbackId = GetNextCallbackId(); 59 callbackId = GetNextCallbackId();
60 callbacks[callbackId] = callback; 60 callbacks[callbackId] = callback;
61 } 61 }
62 request(sargs, callbackId); 62 request(sargs, callbackId);
63 } 63 }
64 64
65 // Tabs 65 // Tabs
66 chromium.tabs = {}; 66 chromium.tabs = {};
67 // TODO(aa): This should eventually take an optional windowId param.
68 chromium.tabs.getTabsForWindow = function(callback) {
69 native function GetTabsForWindow();
70 sendRequest(GetTabsForWindow, null, callback);
71 };
67 chromium.tabs.createTab = function(tab, callback) { 72 chromium.tabs.createTab = function(tab, callback) {
68 native function CreateTab(); 73 native function CreateTab();
69 sendRequest(CreateTab, tab, callback); 74 sendRequest(CreateTab, tab, callback);
70 }; 75 };
71 })(); 76 })();
OLDNEW
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698