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

Unified Diff: chrome/renderer/resources/extensions/miscellaneous_bindings.js

Issue 10991044: Revert 158830 - Revert 156678 - Native messaging now uses the MessageService back-end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/resources/extensions/extension_custom_bindings.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/miscellaneous_bindings.js
===================================================================
--- chrome/renderer/resources/extensions/miscellaneous_bindings.js (revision 158832)
+++ chrome/renderer/resources/extensions/miscellaneous_bindings.js (working copy)
@@ -27,6 +27,7 @@
// Note: sendRequest is deprecated.
chromeHidden.kRequestChannel = "chrome.extension.sendRequest";
chromeHidden.kMessageChannel = "chrome.extension.sendMessage";
+ chromeHidden.kNativeMessageChannel = "chrome.extension.sendNativeMessage";
// Map of port IDs to port object.
var ports = {};
@@ -257,9 +258,10 @@
// Shared implementation used by tabs.sendMessage and extension.sendMessage.
chromeHidden.Port.sendMessageImpl = function(port, request,
responseCallback) {
- port.postMessage(request);
+ if (port.name != chromeHidden.kNativeMessageChannel)
+ port.postMessage(request);
- if (port.name == chromeHidden.kMessageChannel && !responseCallback) {
+ if (port.name != chromeHidden.kRequestChannel && !responseCallback) {
// TODO(mpcomplete): Do this for the old sendRequest API too, after
// verifying it doesn't break anything.
// Go ahead and disconnect immediately if the sender is not expecting
« no previous file with comments | « chrome/renderer/resources/extensions/extension_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698