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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_port.cc

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/:/ / Created 4 years, 11 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
Index: chrome/browser/extensions/api/messaging/native_message_port.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_port.cc b/chrome/browser/extensions/api/messaging/native_message_port.cc
index 51e8478c7f3a6b05c286283372d0c468fb41b91f..dc97cf83018edb61ab752fb3fac294c4476efc5c 100644
--- a/chrome/browser/extensions/api/messaging/native_message_port.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_port.cc
@@ -102,9 +102,16 @@ NativeMessagePort::~NativeMessagePort() {
host_task_runner_->DeleteSoon(FROM_HERE, core_.release());
}
-void NativeMessagePort::DispatchOnMessage(
- const Message& message,
- int target_port_id) {
+bool NativeMessagePort::IsValidPort() {
+ // The native message port is immediately connected after construction, so it
+ // is not possible to invalidate the port between construction and connection.
+ // The return value doesn't matter since native messaging follows a code path
+ // where IsValidPort() is never called.
+ NOTREACHED();
+ return true;
+}
+
+void NativeMessagePort::DispatchOnMessage(const Message& message) {
DCHECK(thread_checker_.CalledOnValidThread());
core_->OnMessageFromChrome(message.data);
}

Powered by Google App Engine
This is Rietveld 408576698