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

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: Add override specifier to destructor Created 5 years 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 8d26d306b144f2f5716cc62c38121c83cb696394..d07bf9711620f8c4599cb820070e380b994352a4 100644
--- a/chrome/browser/extensions/api/messaging/native_message_port.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_port.cc
@@ -100,9 +100,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