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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 }; | 200 }; |
201 | 201 |
202 // PPB_Testing ----------------------------------------------------------------- | 202 // PPB_Testing ----------------------------------------------------------------- |
203 | 203 |
204 PP_Bool ReadImageData(PP_Resource device_context_2d, | 204 PP_Bool ReadImageData(PP_Resource device_context_2d, |
205 PP_Resource image, | 205 PP_Resource image, |
206 const PP_Point* top_left) { | 206 const PP_Point* top_left) { |
207 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); | 207 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); |
208 if (enter.failed()) | 208 if (enter.failed()) |
209 return PP_FALSE; | 209 return PP_FALSE; |
210 return BoolToPPBool(static_cast<PPB_Graphics2D_Impl*>(enter.object())-> | 210 return BoolToPPBool(enter.object()->ReadImageData(image, top_left)); |
211 ReadImageData(image, top_left)); | |
212 } | 211 } |
213 | 212 |
214 void RunMessageLoop(PP_Instance instance) { | 213 void RunMessageLoop(PP_Instance instance) { |
215 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 214 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
216 MessageLoop::current()->Run(); | 215 MessageLoop::current()->Run(); |
217 } | 216 } |
218 | 217 |
219 void QuitMessageLoop(PP_Instance instance) { | 218 void QuitMessageLoop(PP_Instance instance) { |
220 MessageLoop::current()->QuitNow(); | 219 MessageLoop::current()->QuitNow(); |
221 } | 220 } |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 628 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
630 if (retval != 0) { | 629 if (retval != 0) { |
631 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 630 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
632 return false; | 631 return false; |
633 } | 632 } |
634 return true; | 633 return true; |
635 } | 634 } |
636 | 635 |
637 } // namespace ppapi | 636 } // namespace ppapi |
638 } // namespace webkit | 637 } // namespace webkit |
OLD | NEW |