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 #ifndef PPAPI_CPP_INSTANCE_H_ | 5 #ifndef PPAPI_CPP_INSTANCE_H_ |
6 #define PPAPI_CPP_INSTANCE_H_ | 6 #define PPAPI_CPP_INSTANCE_H_ |
7 | 7 |
8 /// @file | 8 /// @file |
9 /// This file defines the C++ wrapper for an instance. | 9 /// This file defines the C++ wrapper for an instance. |
10 | 10 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 /// get the C calls in the first place. | 480 /// get the C calls in the first place. |
481 /// | 481 /// |
482 /// Refer to RemovePerInstanceObject() and GetPerInstanceObject() for further | 482 /// Refer to RemovePerInstanceObject() and GetPerInstanceObject() for further |
483 /// information. | 483 /// information. |
484 /// | 484 /// |
485 /// @param[in] interface_name The name of the interface to associate with the | 485 /// @param[in] interface_name The name of the interface to associate with the |
486 /// instance | 486 /// instance |
487 /// @param[in] object | 487 /// @param[in] object |
488 void AddPerInstanceObject(const std::string& interface_name, void* object); | 488 void AddPerInstanceObject(const std::string& interface_name, void* object); |
489 | 489 |
490 /// Static version of AddPerInstanceObject that takes an InstanceHandle. As | |
491 /// with all other instance functions, this must only be called on the main | |
492 /// thread. | |
493 static void AddPerInstanceObject(const InstanceHandle& instance, | |
494 const std::string& interface_name, | |
495 void* object); | |
496 | |
497 // {PENDING: summarize Remove method here} | 490 // {PENDING: summarize Remove method here} |
498 /// | 491 /// |
499 /// Refer to AddPerInstanceObject() for further information. | 492 /// Refer to AddPerInstanceObject() for further information. |
500 /// | 493 /// |
501 /// @param[in] interface_name The name of the interface to associate with the | 494 /// @param[in] interface_name The name of the interface to associate with the |
502 /// instance | 495 /// instance |
503 /// @param[in] object | 496 /// @param[in] object |
504 void RemovePerInstanceObject(const std::string& interface_name, void* object); | 497 void RemovePerInstanceObject(const std::string& interface_name, void* object); |
505 | 498 |
506 /// Static version of AddPerInstanceObject that takes an InstanceHandle. As | 499 /// Static version of AddPerInstanceObject that takes an InstanceHandle. As |
(...skipping 18 matching lines...) Expand all Loading... |
525 private: | 518 private: |
526 PP_Instance pp_instance_; | 519 PP_Instance pp_instance_; |
527 | 520 |
528 typedef std::map<std::string, void*> InterfaceNameToObjectMap; | 521 typedef std::map<std::string, void*> InterfaceNameToObjectMap; |
529 InterfaceNameToObjectMap interface_name_to_objects_; | 522 InterfaceNameToObjectMap interface_name_to_objects_; |
530 }; | 523 }; |
531 | 524 |
532 } // namespace pp | 525 } // namespace pp |
533 | 526 |
534 #endif // PPAPI_CPP_INSTANCE_H_ | 527 #endif // PPAPI_CPP_INSTANCE_H_ |
OLD | NEW |