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 <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <python2.7/Python.h> | 6 #include <python2.7/Python.h> |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "mojo/application/content_handler_factory.h" | 13 #include "mojo/application/content_handler_factory.h" |
14 #include "mojo/data_pipe_utils/data_pipe_utils.h" | 14 #include "mojo/data_pipe_utils/data_pipe_utils.h" |
| 15 #include "mojo/environment/scoped_chromium_init.h" |
15 #include "mojo/public/c/system/main.h" | 16 #include "mojo/public/c/system/main.h" |
16 #include "mojo/public/cpp/application/application_impl_base.h" | 17 #include "mojo/public/cpp/application/application_impl_base.h" |
17 #include "mojo/public/cpp/application/run_application.h" | 18 #include "mojo/public/cpp/application/run_application.h" |
18 #include "mojo/public/python/src/common.h" | 19 #include "mojo/public/python/src/common.h" |
19 #include "third_party/zlib/google/zip_reader.h" | 20 #include "third_party/zlib/google/zip_reader.h" |
20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
21 | 22 |
22 char kMojoSystem[] = "mojo_system"; | 23 char kMojoSystem[] = "mojo_system"; |
23 char kMojoSystemImpl[] = "mojo_system_impl"; | 24 char kMojoSystemImpl[] = "mojo_system_impl"; |
24 char kMojoMain[] = "MojoMain"; | 25 char kMojoMain[] = "MojoMain"; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 PythonContentHandler debug_content_handler_; | 236 PythonContentHandler debug_content_handler_; |
236 | 237 |
237 DISALLOW_COPY_AND_ASSIGN(PythonContentHandlerApp); | 238 DISALLOW_COPY_AND_ASSIGN(PythonContentHandlerApp); |
238 }; | 239 }; |
239 | 240 |
240 } // namespace content_handler | 241 } // namespace content_handler |
241 } // namespace python | 242 } // namespace python |
242 } // namespace services | 243 } // namespace services |
243 | 244 |
244 MojoResult MojoMain(MojoHandle application_request) { | 245 MojoResult MojoMain(MojoHandle application_request) { |
| 246 mojo::ScopedChromiumInit init; |
245 services::python::content_handler::PythonContentHandlerApp | 247 services::python::content_handler::PythonContentHandlerApp |
246 python_content_handler_app; | 248 python_content_handler_app; |
247 return mojo::RunMainApplication(application_request, | 249 return mojo::RunApplication(application_request, &python_content_handler_app); |
248 &python_content_handler_app); | |
249 } | 250 } |
OLD | NEW |