| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { | 253 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { |
| 254 std::vector<PP_Var> vars = | 254 std::vector<PP_Var> vars = |
| 255 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); | 255 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); |
| 256 for (size_t i = 0u; | 256 for (size_t i = 0u; |
| 257 i < std::min(static_cast<size_t>(array_size), vars.size()); | 257 i < std::min(static_cast<size_t>(array_size), vars.size()); |
| 258 ++i) | 258 ++i) |
| 259 live_vars[i] = vars[i]; | 259 live_vars[i] = vars[i]; |
| 260 return vars.size(); | 260 return vars.size(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void SetMinimumArrayBufferSizeForShmem(PP_Instance /*instance*/, |
| 264 uint32_t /*threshold*/) { |
| 265 // Does nothing. Not needed in-process. |
| 266 } |
| 267 |
| 263 const PPB_Testing_Dev testing_interface = { | 268 const PPB_Testing_Dev testing_interface = { |
| 264 &ReadImageData, | 269 &ReadImageData, |
| 265 &RunMessageLoop, | 270 &RunMessageLoop, |
| 266 &QuitMessageLoop, | 271 &QuitMessageLoop, |
| 267 &GetLiveObjectsForInstance, | 272 &GetLiveObjectsForInstance, |
| 268 &IsOutOfProcess, | 273 &IsOutOfProcess, |
| 269 &SimulateInputEvent, | 274 &SimulateInputEvent, |
| 270 &GetDocumentURL, | 275 &GetDocumentURL, |
| 271 &GetLiveVars | 276 &GetLiveVars, |
| 277 &SetMinimumArrayBufferSizeForShmem |
| 272 }; | 278 }; |
| 273 | 279 |
| 274 // GetInterface ---------------------------------------------------------------- | 280 // GetInterface ---------------------------------------------------------------- |
| 275 | 281 |
| 276 const void* InternalGetInterface(const char* name) { | 282 const void* InternalGetInterface(const char* name) { |
| 277 // Allow custom interface factories first stab at the GetInterface call. | 283 // Allow custom interface factories first stab at the GetInterface call. |
| 278 const void* custom_interface = | 284 const void* custom_interface = |
| 279 PpapiInterfaceFactoryManager::GetInstance()->GetInterface(name); | 285 PpapiInterfaceFactoryManager::GetInstance()->GetInterface(name); |
| 280 if (custom_interface) | 286 if (custom_interface) |
| 281 return custom_interface; | 287 return custom_interface; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 int retval = entry_points.initialize_module(pp_module(), &GetInterface); | 648 int retval = entry_points.initialize_module(pp_module(), &GetInterface); |
| 643 if (retval != 0) { | 649 if (retval != 0) { |
| 644 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 650 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 645 return false; | 651 return false; |
| 646 } | 652 } |
| 647 return true; | 653 return true; |
| 648 } | 654 } |
| 649 | 655 |
| 650 } // namespace ppapi | 656 } // namespace ppapi |
| 651 } // namespace webkit | 657 } // namespace webkit |
| OLD | NEW |