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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js

Issue 2295863002: Remove window.postMessage(message, transferables, targetOrigin) legacy overload (Closed)
Patch Set: leave milestoneString alone Created 4 years, 3 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 this._lastRequestId = 0; 849 this._lastRequestId = 0;
850 this._lastObjectId = 0; 850 this._lastObjectId = 0;
851 851
852 this.registerHandler("callback", this._onCallback.bind(this)); 852 this.registerHandler("callback", this._onCallback.bind(this));
853 853
854 var channel = new MessageChannel(); 854 var channel = new MessageChannel();
855 this._port = channel.port1; 855 this._port = channel.port1;
856 this._port.addEventListener("message", this._onMessage.bind(this), false); 856 this._port.addEventListener("message", this._onMessage.bind(this), false);
857 this._port.start(); 857 this._port.start();
858 858
859 window.parent.postMessage("registerExtension", [ channel.port2 ], "*"); 859 window.parent.postMessage("registerExtension", "*", [ channel.port2 ]);
860 } 860 }
861 861
862 ExtensionServerClient.prototype = { 862 ExtensionServerClient.prototype = {
863 /** 863 /**
864 * @param {!Object} message 864 * @param {!Object} message
865 * @param {function()=} callback 865 * @param {function()=} callback
866 */ 866 */
867 sendRequest: function(message, callback) 867 sendRequest: function(message, callback)
868 { 868 {
869 if (typeof callback === "function") 869 if (typeof callback === "function")
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 { 1013 {
1014 return "(function(injectedScriptId){ " + 1014 return "(function(injectedScriptId){ " +
1015 "var extensionServer;" + 1015 "var extensionServer;" +
1016 defineCommonExtensionSymbols.toString() + ";" + 1016 defineCommonExtensionSymbols.toString() + ";" +
1017 injectedExtensionAPI.toString() + ";" + 1017 injectedExtensionAPI.toString() + ";" +
1018 buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName) + "; " + 1018 buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName) + "; " +
1019 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + 1019 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" +
1020 "return {};" + 1020 "return {};" +
1021 "})"; 1021 "})";
1022 } 1022 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698