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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" | 10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (!event->location.is_null()) { | 78 if (!event->location.is_null()) { |
79 ppapi::ProxyAutoLock lock; | 79 ppapi::ProxyAutoLock lock; |
80 | 80 |
81 // TODO(yzshen): Handle events. | 81 // TODO(yzshen): Handle events. |
82 } | 82 } |
83 callback.Run(); | 83 callback.Run(); |
84 } | 84 } |
85 | 85 |
86 // MojoPpapiGlobals::Delegate implementation. | 86 // MojoPpapiGlobals::Delegate implementation. |
87 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { | 87 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { |
88 MessagePipe gles2_pipe; | 88 CommandBufferPtr command_buffer; |
89 viewport_->CreateGLES2Context(gles2_pipe.handle1.Pass()); | 89 viewport_->CreateGLES2Context(Get(&command_buffer)); |
90 return gles2_pipe.handle0.Pass(); | 90 return command_buffer.PassMessagePipe(); |
91 } | 91 } |
92 | 92 |
93 private: | 93 private: |
94 MojoPpapiGlobals ppapi_globals_; | 94 MojoPpapiGlobals ppapi_globals_; |
95 | 95 |
96 NativeViewportPtr viewport_; | 96 NativeViewportPtr viewport_; |
97 scoped_refptr<PluginModule> plugin_module_; | 97 scoped_refptr<PluginModule> plugin_module_; |
98 scoped_ptr<PluginInstance> plugin_instance_; | 98 scoped_ptr<PluginInstance> plugin_instance_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(PepperContainerApp); | 100 DISALLOW_COPY_AND_ASSIGN(PepperContainerApp); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace examples | 103 } // namespace examples |
104 | 104 |
105 // static | 105 // static |
106 Application* Application::Create() { | 106 Application* Application::Create() { |
107 return new examples::PepperContainerApp(); | 107 return new examples::PepperContainerApp(); |
108 } | 108 } |
109 | 109 |
110 } // namespace mojo | 110 } // namespace mojo |
OLD | NEW |