| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 // PPB_Testing ----------------------------------------------------------------- | 195 // PPB_Testing ----------------------------------------------------------------- |
| 196 | 196 |
| 197 PP_Bool ReadImageData(PP_Resource device_context_2d, | 197 PP_Bool ReadImageData(PP_Resource device_context_2d, |
| 198 PP_Resource image, | 198 PP_Resource image, |
| 199 const PP_Point* top_left) { | 199 const PP_Point* top_left) { |
| 200 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); | 200 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); |
| 201 if (enter.failed()) | 201 if (enter.failed()) |
| 202 return PP_FALSE; | 202 return PP_FALSE; |
| 203 return BoolToPPBool(static_cast<PPB_Graphics2D_Impl*>(enter.object())-> | 203 return BoolToPPBool(enter.object()->ReadImageData(image, top_left)); |
| 204 ReadImageData(image, top_left)); | |
| 205 } | 204 } |
| 206 | 205 |
| 207 void RunMessageLoop(PP_Instance instance) { | 206 void RunMessageLoop(PP_Instance instance) { |
| 208 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 207 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
| 209 MessageLoop::current()->Run(); | 208 MessageLoop::current()->Run(); |
| 210 } | 209 } |
| 211 | 210 |
| 212 void QuitMessageLoop(PP_Instance instance) { | 211 void QuitMessageLoop(PP_Instance instance) { |
| 213 MessageLoop::current()->QuitNow(); | 212 MessageLoop::current()->QuitNow(); |
| 214 } | 213 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 615 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 617 if (retval != 0) { | 616 if (retval != 0) { |
| 618 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 617 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 619 return false; | 618 return false; |
| 620 } | 619 } |
| 621 return true; | 620 return true; |
| 622 } | 621 } |
| 623 | 622 |
| 624 } // namespace ppapi | 623 } // namespace ppapi |
| 625 } // namespace webkit | 624 } // namespace webkit |
| OLD | NEW |