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 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
17 #include "ppapi/c/ppb_console.h" | |
17 #include "ppapi/cpp/instance_handle.h" | 18 #include "ppapi/cpp/instance_handle.h" |
18 #include "ppapi/cpp/view.h" | 19 #include "ppapi/cpp/view.h" |
19 | 20 |
20 // Windows defines 'PostMessage', so we have to undef it. | 21 // Windows defines 'PostMessage', so we have to undef it. |
21 #ifdef PostMessage | 22 #ifdef PostMessage |
22 #undef PostMessage | 23 #undef PostMessage |
23 #endif | 24 #endif |
24 | 25 |
25 struct PP_InputEvent; | 26 struct PP_InputEvent; |
26 | 27 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 /// Refer to HandleMessage() for receiving events from JavaScript. | 466 /// Refer to HandleMessage() for receiving events from JavaScript. |
466 /// | 467 /// |
467 /// @param[in] message A <code>Var</code> containing the data to be sent to | 468 /// @param[in] message A <code>Var</code> containing the data to be sent to |
468 /// JavaScript. Message can have a numeric, boolean, or string value; arrays | 469 /// JavaScript. Message can have a numeric, boolean, or string value; arrays |
469 /// and dictionaries are not yet supported. Ref-counted var types are copied, | 470 /// and dictionaries are not yet supported. Ref-counted var types are copied, |
470 /// and are therefore not shared between the instance and the browser. | 471 /// and are therefore not shared between the instance and the browser. |
471 void PostMessage(const Var& message); | 472 void PostMessage(const Var& message); |
472 | 473 |
473 /// @} | 474 /// @} |
474 | 475 |
476 // @{ | |
477 /// @name PPB_Console methods for logging to the console: | |
478 | |
479 /// See PPB_Console.Log. | |
480 void LogToConsole(PP_LogLevel level, const Var& value); | |
481 | |
482 /// See PPB_Console.LogWithSource. | |
483 void LogToConsoleWithSource(PP_LogLevel level, | |
484 const Var& source, | |
485 const Var& value); | |
dmichael (off chromium)
2012/12/04 15:32:33
For public APIs, we try to keep the documentation
Nick Bray (chromium)
2012/12/04 23:14:56
Done.
| |
486 | |
487 // @} | |
488 | |
475 /// AddPerInstanceObject() associates an instance with an interface, | 489 /// AddPerInstanceObject() associates an instance with an interface, |
476 /// creating an object. | 490 /// creating an object. |
477 /// | 491 /// |
478 /// Many optional interfaces are associated with a plugin instance. For | 492 /// Many optional interfaces are associated with a plugin instance. For |
479 /// example, the find in PPP_Find interface receives updates on a per-instance | 493 /// example, the find in PPP_Find interface receives updates on a per-instance |
480 /// basis. This "per-instance" tracking allows such objects to associate | 494 /// basis. This "per-instance" tracking allows such objects to associate |
481 /// themselves with an instance as "the" handler for that interface name. | 495 /// themselves with an instance as "the" handler for that interface name. |
482 /// | 496 /// |
483 /// In the case of the find example, the find object registers with its | 497 /// In the case of the find example, the find object registers with its |
484 /// associated instance in its constructor and unregisters in its destructor. | 498 /// associated instance in its constructor and unregisters in its destructor. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 private: | 547 private: |
534 PP_Instance pp_instance_; | 548 PP_Instance pp_instance_; |
535 | 549 |
536 typedef std::map<std::string, void*> InterfaceNameToObjectMap; | 550 typedef std::map<std::string, void*> InterfaceNameToObjectMap; |
537 InterfaceNameToObjectMap interface_name_to_objects_; | 551 InterfaceNameToObjectMap interface_name_to_objects_; |
538 }; | 552 }; |
539 | 553 |
540 } // namespace pp | 554 } // namespace pp |
541 | 555 |
542 #endif // PPAPI_CPP_INSTANCE_H_ | 556 #endif // PPAPI_CPP_INSTANCE_H_ |
OLD | NEW |