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

Side by Side Diff: remoting/host/setup/me2me_native_messaging_host_main.cc

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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter( 68 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter(
69 new URLRequestContextGetter(io_thread.message_loop_proxy())); 69 new URLRequestContextGetter(io_thread.message_loop_proxy()));
70 scoped_ptr<OAuthClient> oauth_client( 70 scoped_ptr<OAuthClient> oauth_client(
71 new OAuthClient(url_request_context_getter)); 71 new OAuthClient(url_request_context_getter));
72 72
73 net::URLFetcher::SetIgnoreCertificateRequests(true); 73 net::URLFetcher::SetIgnoreCertificateRequests(true);
74 74
75 // Create the pairing registry and native messaging host. 75 // Create the pairing registry and native messaging host.
76 scoped_refptr<protocol::PairingRegistry> pairing_registry = 76 scoped_refptr<protocol::PairingRegistry> pairing_registry =
77 CreatePairingRegistry(io_thread.message_loop_proxy()); 77 CreatePairingRegistry(io_thread.message_loop_proxy());
78 scoped_ptr<NativeMessagingChannel::Delegate> host( 78
79 scoped_ptr<NativeMessagingHost> host(
79 new NativeMessagingHost(daemon_controller, 80 new NativeMessagingHost(daemon_controller,
80 pairing_registry, 81 pairing_registry,
81 oauth_client.Pass())); 82 oauth_client.Pass()));
82 83 host->Start(read_file, write_file, run_loop.QuitClosure());
83 // Set up the native messaging channel.
84 scoped_ptr<NativeMessagingChannel> channel(
85 new NativeMessagingChannel(host.Pass(), read_file, write_file));
86 channel->Start(run_loop.QuitClosure());
87 84
88 // Run the loop until channel is alive. 85 // Run the loop until channel is alive.
89 run_loop.Run(); 86 run_loop.Run();
90 return kSuccessExitCode; 87 return kSuccessExitCode;
91 } 88 }
92 89
93 } // namespace remoting 90 } // namespace remoting
94 91
95 int main(int argc, char** argv) { 92 int main(int argc, char** argv) {
96 // This object instance is required by Chrome code (such as MessageLoop). 93 // This object instance is required by Chrome code (such as MessageLoop).
97 base::AtExitManager exit_manager; 94 base::AtExitManager exit_manager;
98 95
99 CommandLine::Init(argc, argv); 96 CommandLine::Init(argc, argv);
100 remoting::InitHostLogging(); 97 remoting::InitHostLogging();
101 98
102 return remoting::NativeMessagingHostMain(); 99 return remoting::NativeMessagingHostMain();
103 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698