FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
size_t NPObjectAPI::getMemberCount ( ) const
virtual

Gets the member count.

Returns
The member count.

Implements FB::JSAPI.

Definition at line 79 of file NPObjectAPI.cpp.

80 {
81  if (m_browser.expired())
82  return 0;
83 
84  NpapiBrowserHostPtr browser(getHost());
85  if (!browser->isMainThread()) {
86  return browser->CallOnMainThread(boost::bind(&NPObjectAPI::getMemberCount, this));
87  }
88  if (is_JSAPI) {
89  FB::JSAPIPtr tmp = inner.lock();
90  if (tmp)
91  return tmp->getMemberCount();
92  else
93  return 0;
94  }
95  NPIdentifier *idArray(NULL);
96  uint32_t count;
97  browser->Enumerate(obj, &idArray, &count);
98  browser->MemFree(idArray);
99  return (size_t)count;
100 }
size_t getMemberCount() const
Gets the member count.
Definition: NPObjectAPI.cpp:79
boost::shared_ptr< FB::JSAPI > JSAPIPtr
Defines an alias for a JSAPI shared_ptr (you should never use a JSAPI* directly)
Definition: APITypes.h:94