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

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

Issue 145463002: Extensions: Send the tab id to platform apps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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/message_service.h
===================================================================
--- chrome/browser/extensions/api/messaging/message_service.h (revision 246091)
+++ chrome/browser/extensions/api/messaging/message_service.h (working copy)
@@ -144,6 +144,12 @@
const std::string& source_extension_id,
const std::string& native_app_name);
+ // NativeMessageProcessHost::Client
+ virtual void PostMessageFromNativeProcess(
+ int port_id,
+ const std::string& message) OVERRIDE;
+
+ // NativeMessageProcessHost::Client
// Closes the message channel associated with the given port, and notifies
// the other side.
virtual void CloseChannel(int port_id,
@@ -153,10 +159,7 @@
// port if the channel isn't pending.
void PostMessage(int port_id, const Message& message);
- // NativeMessageProcessHost::Client
- virtual void PostMessageFromNativeProcess(
- int port_id,
- const std::string& message) OVERRIDE;
+ bool CanPlatformAppAccessTab(const std::string app_id, int tab_id) const;
not at google - send to devlin 2014/01/23 16:41:59 const std::string&
Lei Zhang 2014/01/23 20:53:12 It sounds like CanPlatformAppAccessTab() isn't nee
private:
friend class MockMessageService;
@@ -179,6 +182,10 @@
typedef std::map<int, PendingLazyBackgroundPageChannel>
PendingLazyBackgroundPageChannelMap;
+ // A map of channel ID to (target platform app id, tab id).
+ typedef std::map<int, std::pair<std::string, int> >
+ PendingDispatchesToPlatformAppsMap;
+
// Common among OpenChannel* variants.
bool OpenChannelImpl(scoped_ptr<OpenChannelParams> params);
@@ -262,6 +269,7 @@
PendingTlsChannelIdMap pending_tls_channel_id_channels_;
PendingLazyBackgroundPageChannelMap pending_lazy_background_page_channels_;
MessagePropertyProvider property_provider_;
+ PendingDispatchesToPlatformAppsMap pending_dispatches_to_platform_apps_;
// Weak pointer. Guaranteed to outlive this class.
LazyBackgroundTaskQueue* lazy_background_task_queue_;

Powered by Google App Engine
This is Rietveld 408576698