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