OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlwin.h> | 6 #include <atlwin.h> |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 INITCOMMONCONTROLSEX info; | 32 INITCOMMONCONTROLSEX info; |
33 info.dwSize = sizeof(info); | 33 info.dwSize = sizeof(info); |
34 info.dwICC = ICC_STANDARD_CLASSES; | 34 info.dwICC = ICC_STANDARD_CLASSES; |
35 InitCommonControlsEx(&info); | 35 InitCommonControlsEx(&info); |
36 | 36 |
37 // This object instance is required by Chrome code (for example, | 37 // This object instance is required by Chrome code (for example, |
38 // FilePath, LazyInstance, MessageLoop). | 38 // FilePath, LazyInstance, MessageLoop). |
39 base::AtExitManager exit_manager; | 39 base::AtExitManager exit_manager; |
40 | 40 |
41 // Provide message loops and threads for the URLRequestContextGetter. | 41 // Provide message loops and threads for the URLRequestContextGetter. |
42 MessageLoop message_loop(MessageLoop::TYPE_UI); | 42 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
43 base::Thread io_thread("IO thread"); | 43 base::Thread io_thread("IO thread"); |
44 base::Thread::Options io_thread_options(MessageLoop::TYPE_IO, 0); | 44 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); |
45 io_thread.StartWithOptions(io_thread_options); | 45 io_thread.StartWithOptions(io_thread_options); |
46 | 46 |
47 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_( | 47 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_( |
48 new remoting::URLRequestContextGetter( | 48 new remoting::URLRequestContextGetter( |
49 message_loop.message_loop_proxy(), io_thread.message_loop_proxy())); | 49 message_loop.message_loop_proxy(), io_thread.message_loop_proxy())); |
50 | 50 |
51 OleInitialize(NULL); | 51 OleInitialize(NULL); |
52 | 52 |
53 // Run a HostConfigurerWindow. | 53 // Run a HostConfigurerWindow. |
54 remoting::HostConfigurerWindow host_configurer_window( | 54 remoting::HostConfigurerWindow host_configurer_window( |
55 url_request_context_getter_, message_loop.message_loop_proxy(), | 55 url_request_context_getter_, message_loop.message_loop_proxy(), |
56 message_loop.QuitClosure()); | 56 message_loop.QuitClosure()); |
57 host_configurer_window.Create(NULL); | 57 host_configurer_window.Create(NULL); |
58 | 58 |
59 base::RunLoop run_loop; | 59 base::RunLoop run_loop; |
60 run_loop.Run(); | 60 run_loop.Run(); |
61 | 61 |
62 io_thread.Stop(); | 62 io_thread.Stop(); |
63 | 63 |
64 OleUninitialize(); | 64 OleUninitialize(); |
65 } | 65 } |
OLD | NEW |