OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "base/files/scoped_file.h" | 6 #include "base/files/scoped_file.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
10 #include "mojo/application/content_handler_factory.h" | 10 #include "mojo/application/content_handler_factory.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 public mojo::ContentHandlerFactory::Delegate { | 74 public mojo::ContentHandlerFactory::Delegate { |
75 public: | 75 public: |
76 NaClContentHandler() : content_handler_factory_(this) {} | 76 NaClContentHandler() : content_handler_factory_(this) {} |
77 | 77 |
78 private: | 78 private: |
79 // Overridden from ApplicationDelegate: | 79 // Overridden from ApplicationDelegate: |
80 void Initialize(mojo::ApplicationImpl* app) override { | 80 void Initialize(mojo::ApplicationImpl* app) override { |
81 url_ = GURL(app->url()); | 81 url_ = GURL(app->url()); |
82 | 82 |
83 mojo::NetworkServicePtr network_service; | 83 mojo::NetworkServicePtr network_service; |
84 app->ConnectToService("mojo:network_service", &network_service); | 84 app->ConnectToServiceDeprecated("mojo:network_service", &network_service); |
85 | 85 |
86 network_service->CreateURLLoader(GetProxy(&url_loader_)); | 86 network_service->CreateURLLoader(GetProxy(&url_loader_)); |
87 } | 87 } |
88 | 88 |
89 void LoadIRT(mojo::URLLoaderPtr& url_loader) { | 89 void LoadIRT(mojo::URLLoaderPtr& url_loader) { |
90 // TODO(ncbray): support other architectures. | 90 // TODO(ncbray): support other architectures. |
91 GURL irt_url; | 91 GURL irt_url; |
92 #if defined(ARCH_CPU_X86_64) | 92 #if defined(ARCH_CPU_X86_64) |
93 irt_url = url_.Resolve("irt_x64/irt_mojo.nexe"); | 93 irt_url = url_.Resolve("irt_x64/irt_mojo.nexe"); |
94 #else | 94 #else |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 }; | 146 }; |
147 | 147 |
148 } // namespace content_handler | 148 } // namespace content_handler |
149 } // namespace nacl | 149 } // namespace nacl |
150 | 150 |
151 MojoResult MojoMain(MojoHandle application_request) { | 151 MojoResult MojoMain(MojoHandle application_request) { |
152 mojo::ApplicationRunnerChromium runner( | 152 mojo::ApplicationRunnerChromium runner( |
153 new nacl::content_handler::NaClContentHandler()); | 153 new nacl::content_handler::NaClContentHandler()); |
154 return runner.Run(application_request); | 154 return runner.Run(application_request); |
155 } | 155 } |
OLD | NEW |