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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host.h

Issue 12389041: Require manifests for native messaging hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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_process_host.h
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.h b/chrome/browser/extensions/api/messaging/native_message_process_host.h
index 834eb43e83c3c1880d1cd02aff866989a96d52fb..8e942d2a46a197ab8139c96bb4db735bab19f586 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.h
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.h
@@ -40,8 +40,7 @@ class NativeMessageProcessHost
#endif // !defined(OS_POSIX)
{
public:
- // Interface for classes that which to recieve messages from the native
- // process.
+ // Interface for the object that receives messages from the native process.
class Client {
public:
virtual ~Client() {}
@@ -55,12 +54,14 @@ class NativeMessageProcessHost
static scoped_ptr<NativeMessageProcessHost> Create(
base::WeakPtr<Client> weak_client_ui,
+ const std::string& source_extension_id,
const std::string& native_host_name,
int destination_port);
// Create using specified |launcher|. Used in tests.
static scoped_ptr<NativeMessageProcessHost> CreateWithLauncher(
base::WeakPtr<Client> weak_client_ui,
+ const std::string& source_extension_id,
const std::string& native_host_name,
int destination_port,
scoped_ptr<NativeProcessLauncher> launcher);
@@ -80,6 +81,7 @@ class NativeMessageProcessHost
private:
NativeMessageProcessHost(base::WeakPtr<Client> weak_client_ui,
+ const std::string& source_extension_id,
const std::string& native_host_name,
int destination_port,
scoped_ptr<NativeProcessLauncher> launcher);
@@ -115,6 +117,9 @@ class NativeMessageProcessHost
// UI thread.
base::WeakPtr<Client> weak_client_ui_;
+ // ID of the calling extension.
+ std::string source_extension_id_;
+
// Name of the native messaging host.
std::string native_host_name_;

Powered by Google App Engine
This is Rietveld 408576698