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 "shell/native_application_support.h" | 5 #include "shell/native_application_support.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "mojo/public/platform/native/gles2_impl_chromium_bind_uniform_location_ thunks.h" | 10 #include "mojo/public/platform/native/gles2_impl_chromium_bind_uniform_location_ thunks.h" |
11 #include "mojo/public/platform/native/gles2_impl_chromium_map_sub_thunks.h" | 11 #include "mojo/public/platform/native/gles2_impl_chromium_map_sub_thunks.h" |
12 #include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h " | 12 #include "mojo/public/platform/native/gles2_impl_chromium_miscellaneous_thunks.h " |
13 #include "mojo/public/platform/native/gles2_impl_chromium_resize_thunks.h" | 13 #include "mojo/public/platform/native/gles2_impl_chromium_resize_thunks.h" |
14 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h" | 14 #include "mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h" |
15 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks .h" | 15 #include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks .h" |
16 #include "mojo/public/platform/native/gles2_impl_ext_debug_marker_thunks.h" | 16 #include "mojo/public/platform/native/gles2_impl_ext_debug_marker_thunks.h" |
17 #include "mojo/public/platform/native/gles2_impl_ext_discard_framebuffer_thunks. h" | 17 #include "mojo/public/platform/native/gles2_impl_ext_discard_framebuffer_thunks. h" |
18 #include "mojo/public/platform/native/gles2_impl_ext_multisampled_render_to_text ure_thunks.h" | 18 #include "mojo/public/platform/native/gles2_impl_ext_multisampled_render_to_text ure_thunks.h" |
19 #include "mojo/public/platform/native/gles2_impl_ext_occlusion_query_thunks.h" | 19 #include "mojo/public/platform/native/gles2_impl_ext_occlusion_query_thunks.h" |
20 #include "mojo/public/platform/native/gles2_impl_ext_texture_storage_thunks.h" | 20 #include "mojo/public/platform/native/gles2_impl_ext_texture_storage_thunks.h" |
21 #include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thu nks.h" | 21 #include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thu nks.h" |
22 #include "mojo/public/platform/native/gles2_impl_oes_vertex_array_object_thunks. h" | 22 #include "mojo/public/platform/native/gles2_impl_oes_vertex_array_object_thunks. h" |
23 #include "mojo/public/platform/native/gles2_impl_thunks.h" | 23 #include "mojo/public/platform/native/gles2_impl_thunks.h" |
24 #include "mojo/public/platform/native/mgl_onscreen_thunks.h" | 24 #include "mojo/public/platform/native/mgl_onscreen_thunks.h" |
25 #include "mojo/public/platform/native/mgl_signal_sync_point_thunks.h" | 25 #include "mojo/public/platform/native/mgl_signal_sync_point_thunks.h" |
26 #include "mojo/public/platform/native/mgl_thunks.h" | 26 #include "mojo/public/platform/native/mgl_thunks.h" |
27 #include "mojo/public/platform/native/platform_handle_private_thunks.h" | |
27 #include "mojo/public/platform/native/system_impl_private_thunks.h" | 28 #include "mojo/public/platform/native/system_impl_private_thunks.h" |
28 #include "mojo/public/platform/native/system_thunks.h" | 29 #include "mojo/public/platform/native/system_thunks.h" |
29 | 30 |
30 namespace shell { | 31 namespace shell { |
31 | 32 |
32 namespace { | 33 namespace { |
33 | 34 |
34 template <typename Thunks> | 35 template <typename Thunks> |
35 bool SetThunks(Thunks (*make_thunks)(), | 36 bool SetThunks(Thunks (*make_thunks)(), |
36 const char* function_name, | 37 const char* function_name, |
(...skipping 30 matching lines...) Expand all Loading... | |
67 mojo::InterfaceRequest<mojo::Application> application_request) { | 68 mojo::InterfaceRequest<mojo::Application> application_request) { |
68 // Tolerate |app_library| being null, to make life easier for callers. | 69 // Tolerate |app_library| being null, to make life easier for callers. |
69 if (!app_library) | 70 if (!app_library) |
70 return false; | 71 return false; |
71 | 72 |
72 if (!SetThunks(&MojoMakeSystemThunks, "MojoSetSystemThunks", app_library)) { | 73 if (!SetThunks(&MojoMakeSystemThunks, "MojoSetSystemThunks", app_library)) { |
73 LOG(ERROR) << "MojoSetSystemThunks not found"; | 74 LOG(ERROR) << "MojoSetSystemThunks not found"; |
74 return false; | 75 return false; |
75 } | 76 } |
76 | 77 |
78 SetThunks(&MojoMakePlatformHandlePrivateThunks, | |
viettrungluu
2016/02/18 01:10:07
This needs a TODO along the lines of the TODO(ncbr
Forrest Reiling
2016/02/23 23:48:45
Sure. Not gonna lie, I dont really understand what
| |
79 "MojoSetPlatformHandlePrivateThunks", app_library); | |
80 | |
77 // TODO(ncbray): enforce the private nature of this API, somehow? | 81 // TODO(ncbray): enforce the private nature of this API, somehow? |
78 SetThunks(&MojoMakeSystemImplControlThunksPrivate, | 82 SetThunks(&MojoMakeSystemImplControlThunksPrivate, |
79 "MojoSetSystemImplControlThunksPrivate", app_library); | 83 "MojoSetSystemImplControlThunksPrivate", app_library); |
80 SetThunks(&MojoMakeSystemImplThunksPrivate, "MojoSetSystemImplThunksPrivate", | 84 SetThunks(&MojoMakeSystemImplThunksPrivate, "MojoSetSystemImplThunksPrivate", |
81 app_library); | 85 app_library); |
82 | 86 |
83 SetThunks(&MojoMakeGLES2ImplThunks, "MojoSetGLES2ImplThunks", | 87 SetThunks(&MojoMakeGLES2ImplThunks, "MojoSetGLES2ImplThunks", |
84 app_library); | 88 app_library); |
85 SetThunks(MojoMakeGLES2ImplEXTDebugMarkerThunks, | 89 SetThunks(MojoMakeGLES2ImplEXTDebugMarkerThunks, |
86 "MojoSetGLES2ImplEXTDebugMarkerThunks", app_library); | 90 "MojoSetGLES2ImplEXTDebugMarkerThunks", app_library); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 } | 138 } |
135 // |MojoMain()| takes ownership of the Application request handle. | 139 // |MojoMain()| takes ownership of the Application request handle. |
136 MojoHandle handle = application_request.PassMessagePipe().release().value(); | 140 MojoHandle handle = application_request.PassMessagePipe().release().value(); |
137 MojoResult result = main_function(handle); | 141 MojoResult result = main_function(handle); |
138 LOG_IF(ERROR, result != MOJO_RESULT_OK) | 142 LOG_IF(ERROR, result != MOJO_RESULT_OK) |
139 << "MojoMain returned error (result: " << result << ")"; | 143 << "MojoMain returned error (result: " << result << ")"; |
140 return true; | 144 return true; |
141 } | 145 } |
142 | 146 |
143 } // namespace shell | 147 } // namespace shell |
OLD | NEW |