OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 }; | 197 }; |
198 | 198 |
199 // PPB_Testing ----------------------------------------------------------------- | 199 // PPB_Testing ----------------------------------------------------------------- |
200 | 200 |
201 PP_Bool ReadImageData(PP_Resource device_context_2d, | 201 PP_Bool ReadImageData(PP_Resource device_context_2d, |
202 PP_Resource image, | 202 PP_Resource image, |
203 const PP_Point* top_left) { | 203 const PP_Point* top_left) { |
204 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); | 204 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); |
205 if (enter.failed()) | 205 if (enter.failed()) |
206 return PP_FALSE; | 206 return PP_FALSE; |
207 return BoolToPPBool(static_cast<PPB_Graphics2D_Impl*>(enter.object())-> | 207 return BoolToPPBool(enter.object()->ReadImageData(image, top_left)); |
208 ReadImageData(image, top_left)); | |
209 } | 208 } |
210 | 209 |
211 void RunMessageLoop(PP_Instance instance) { | 210 void RunMessageLoop(PP_Instance instance) { |
212 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 211 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
213 MessageLoop::current()->Run(); | 212 MessageLoop::current()->Run(); |
214 } | 213 } |
215 | 214 |
216 void QuitMessageLoop(PP_Instance instance) { | 215 void QuitMessageLoop(PP_Instance instance) { |
217 MessageLoop::current()->QuitNow(); | 216 MessageLoop::current()->QuitNow(); |
218 } | 217 } |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 620 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
622 if (retval != 0) { | 621 if (retval != 0) { |
623 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 622 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
624 return false; | 623 return false; |
625 } | 624 } |
626 return true; | 625 return true; |
627 } | 626 } |
628 | 627 |
629 } // namespace ppapi | 628 } // namespace ppapi |
630 } // namespace webkit | 629 } // namespace webkit |
OLD | NEW |