Chromium Code Reviews

Side by Side Diff: services/nacl/content_handler_main_nonsfi.cc

Issue 1429953003: Belated code review regarding pexe content handler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 <fcntl.h> 5 #include <fcntl.h>
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/application/content_handler_factory.h" 9 #include "mojo/application/content_handler_factory.h"
10 #include "mojo/data_pipe_utils/data_pipe_utils.h" 10 #include "mojo/data_pipe_utils/data_pipe_utils.h"
(...skipping 14 matching lines...)
25 // Overridden from ApplicationDelegate: 25 // Overridden from ApplicationDelegate:
26 void Initialize(mojo::ApplicationImpl* app) override {} 26 void Initialize(mojo::ApplicationImpl* app) override {}
27 27
28 // Overridden from ApplicationDelegate: 28 // Overridden from ApplicationDelegate:
29 bool ConfigureIncomingConnection( 29 bool ConfigureIncomingConnection(
30 mojo::ApplicationConnection* connection) override { 30 mojo::ApplicationConnection* connection) override {
31 connection->AddService(&content_handler_factory_); 31 connection->AddService(&content_handler_factory_);
32 return true; 32 return true;
33 } 33 }
34 34
35 // Overridden from ContentHandlerFactory::ManagedDelegate: 35 // Overridden from ContentHandlerFactory::Delegate:
36 void RunApplication( 36 void RunApplication(
37 mojo::InterfaceRequest<mojo::Application> application_request, 37 mojo::InterfaceRequest<mojo::Application> application_request,
38 mojo::URLResponsePtr response) override { 38 mojo::URLResponsePtr response) override {
39 // Needed to use Mojo interfaces on this thread. 39 // Needed to use Mojo interfaces on this thread.
40 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); 40 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create());
41 // Acquire the nexe. 41 // Acquire the nexe.
42 base::ScopedFILE nexe_fp = 42 base::ScopedFILE nexe_fp =
43 mojo::common::BlockingCopyToTempFile(response->body.Pass()); 43 mojo::common::BlockingCopyToTempFile(response->body.Pass());
44 if (!nexe_fp) { 44 if (!nexe_fp) {
45 LOG(FATAL) << "Could not redirect nexe to temp file"; 45 LOG(FATAL) << "Could not redirect nexe to temp file";
(...skipping 23 matching lines...)
69 }; 69 };
70 70
71 } // namespace content_handler 71 } // namespace content_handler
72 } // namespace nacl 72 } // namespace nacl
73 73
74 MojoResult MojoMain(MojoHandle application_request) { 74 MojoResult MojoMain(MojoHandle application_request) {
75 mojo::ApplicationRunnerChromium runner( 75 mojo::ApplicationRunnerChromium runner(
76 new nacl::content_handler::NaClContentHandler()); 76 new nacl::content_handler::NaClContentHandler());
77 return runner.Run(application_request); 77 return runner.Run(application_request);
78 } 78 }
OLDNEW
« no previous file with comments | « services/nacl/content_handler_main.cc ('k') | services/nacl/content_handler_main_nonsfi_pexe.cc » ('j') | no next file with comments »

Powered by Google App Engine