| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 PP_Resource image, | 204 PP_Resource image, |
| 205 const PP_Point* top_left) { | 205 const PP_Point* top_left) { |
| 206 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); | 206 EnterResource<PPB_Graphics2D_API> enter(device_context_2d, true); |
| 207 if (enter.failed()) | 207 if (enter.failed()) |
| 208 return PP_FALSE; | 208 return PP_FALSE; |
| 209 return BoolToPPBool(static_cast<PPB_Graphics2D_Impl*>(enter.object())-> | 209 return BoolToPPBool(static_cast<PPB_Graphics2D_Impl*>(enter.object())-> |
| 210 ReadImageData(image, top_left)); | 210 ReadImageData(image, top_left)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void RunMessageLoop(PP_Instance instance) { | 213 void RunMessageLoop(PP_Instance instance) { |
| 214 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 214 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
| 215 MessageLoop::current()->SetNestableTasksAllowed(true); | |
| 216 MessageLoop::current()->Run(); | 215 MessageLoop::current()->Run(); |
| 217 MessageLoop::current()->SetNestableTasksAllowed(old_state); | |
| 218 } | 216 } |
| 219 | 217 |
| 220 void QuitMessageLoop(PP_Instance instance) { | 218 void QuitMessageLoop(PP_Instance instance) { |
| 221 MessageLoop::current()->QuitNow(); | 219 MessageLoop::current()->QuitNow(); |
| 222 } | 220 } |
| 223 | 221 |
| 224 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { | 222 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { |
| 225 return HostGlobals::Get()->GetResourceTracker()->GetLiveObjectsForInstance( | 223 return HostGlobals::Get()->GetResourceTracker()->GetLiveObjectsForInstance( |
| 226 instance_id); | 224 instance_id); |
| 227 } | 225 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 599 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 602 if (retval != 0) { | 600 if (retval != 0) { |
| 603 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 601 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 604 return false; | 602 return false; |
| 605 } | 603 } |
| 606 return true; | 604 return true; |
| 607 } | 605 } |
| 608 | 606 |
| 609 } // namespace ppapi | 607 } // namespace ppapi |
| 610 } // namespace webkit | 608 } // namespace webkit |
| OLD | NEW |