Index: mojo/shell/in_process_dynamic_service_runner.cc |
diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc |
index 3bfb163462ce500a29cc80b8d3d235397d6ea136..c0b5df98fd8804d33c0e6a3b7537d81f825b1234 100644 |
--- a/mojo/shell/in_process_dynamic_service_runner.cc |
+++ b/mojo/shell/in_process_dynamic_service_runner.cc |
@@ -9,6 +9,7 @@ |
#include "base/location.h" |
#include "base/logging.h" |
#include "base/message_loop/message_loop_proxy.h" |
+#include "mojo/public/platform/native/gles2_thunks.h" |
#include "mojo/public/platform/native/system_thunks.h" |
namespace mojo { |
@@ -86,6 +87,22 @@ void InProcessDynamicServiceRunner::Run() { |
#endif |
} |
+ MojoSetGLES2ThunksFn mojo_set_gles2_thunks_fn = |
+ reinterpret_cast<MojoSetGLES2ThunksFn>(app_library_.GetFunctionPointer( |
+ "MojoSetGLES2Thunks")); |
+ if (mojo_set_gles2_thunks_fn) { |
+ MojoGLES2Thunks gles2_thunks = MojoMakeGLES2Thunks(); |
+ size_t expected_size = mojo_set_gles2_thunks_fn(&gles2_thunks); |
+ if (expected_size > sizeof(MojoGLES2Thunks)) { |
+ LOG(ERROR) |
+ << "Invalid app library: expected MojoGLES2Thunks size: " |
+ << expected_size; |
+ break; |
+ } |
+ } |
+ // Unlike system thunks, we don't warn on a lack of GLES2 thunks because |
+ // not everything is a visual app. |
+ |
typedef MojoResult (*MojoMainFunction)(MojoHandle); |
MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( |
app_library_.GetFunctionPointer("MojoMain")); |