OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 scoped_ptr<mojo::NetworkContext> context_; | 59 scoped_ptr<mojo::NetworkContext> context_; |
60 }; | 60 }; |
61 | 61 |
62 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( | 62 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( |
63 MojoHandle shell_handle) { | 63 MojoHandle shell_handle) { |
64 base::CommandLine::Init(0, NULL); | 64 base::CommandLine::Init(0, NULL); |
| 65 #if !defined(COMPONENT_BUILD) |
65 base::AtExitManager at_exit; | 66 base::AtExitManager at_exit; |
| 67 #endif |
66 | 68 |
67 // The IO message loop allows us to use net::URLRequest on this thread. | 69 // The IO message loop allows us to use net::URLRequest on this thread. |
68 base::MessageLoopForIO loop; | 70 base::MessageLoopForIO loop; |
69 | 71 |
70 Delegate delegate; | 72 Delegate delegate; |
71 mojo::ApplicationImpl app( | 73 mojo::ApplicationImpl app( |
72 &delegate, mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle))); | 74 &delegate, mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle))); |
73 | 75 |
74 loop.Run(); | 76 loop.Run(); |
75 return MOJO_RESULT_OK; | 77 return MOJO_RESULT_OK; |
76 } | 78 } |
OLD | NEW |