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

Unified Diff: remoting/host/setup/me2me_native_messaging_host.h

Issue 103693006: Me2me Native Messaging host on Windows: restructure NativeMessagingHost and NativeMessagingChannel.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: remoting/host/setup/me2me_native_messaging_host.h
diff --git a/remoting/host/setup/me2me_native_messaging_host.h b/remoting/host/setup/me2me_native_messaging_host.h
index 704e5db8a2959ba099ad3f63df15ee14df646df5..71c115fe4af38e96b7196fafeace145440571ad7 100644
--- a/remoting/host/setup/me2me_native_messaging_host.h
+++ b/remoting/host/setup/me2me_native_messaging_host.h
@@ -28,8 +28,8 @@ namespace protocol {
class PairingRegistry;
} // namespace protocol
-// Implementation of the native messaging host process.
-class NativeMessagingHost : public NativeMessagingChannel::Delegate {
+// Implementation of the me2me native messaging host.
+class NativeMessagingHost {
public:
typedef NativeMessagingChannel::SendMessageCallback SendMessageCallback;
@@ -39,13 +39,15 @@ class NativeMessagingHost : public NativeMessagingChannel::Delegate {
scoped_ptr<OAuthClient> oauth_client);
virtual ~NativeMessagingHost();
- // NativeMessagingChannel::Delegate interface.
- virtual void SetSendMessageCallback(
- const SendMessageCallback& send_message) OVERRIDE;
- virtual void ProcessMessage(
- scoped_ptr<base::DictionaryValue> message) OVERRIDE;
+ void Start(
+ base::PlatformFile input,
+ base::PlatformFile output,
+ const base::Closure& quit_closure);
+ void ShutDown();
private:
+ void ProcessMessage(scoped_ptr<base::DictionaryValue> message);
+
// These "Process.." methods handle specific request types. The |response|
// dictionary is pre-filled by ProcessMessage() with the parts of the
// response already known ("id" and "type" fields).
@@ -114,6 +116,9 @@ class NativeMessagingHost : public NativeMessagingChannel::Delegate {
const std::string& user_email,
const std::string& refresh_token);
+ base::Closure quit_closure_;
+
+ scoped_ptr<NativeMessagingChannel> channel_;
scoped_refptr<DaemonController> daemon_controller_;
// Used to load and update the paired clients for this host.
@@ -124,7 +129,6 @@ class NativeMessagingHost : public NativeMessagingChannel::Delegate {
base::ThreadChecker thread_checker_;
- SendMessageCallback send_message_;
base::WeakPtr<NativeMessagingHost> weak_ptr_;
base::WeakPtrFactory<NativeMessagingHost> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698