FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
bool NPObjectAPI::HasProperty ( const std::string &  propertyName) const
virtual

Query if 'propertyName' is a valid property.

Parameters
propertyNameName of the property.
Returns
true if property exists, false if not.

Implements FB::JSAPI.

Definition at line 122 of file NPObjectAPI.cpp.

123 {
124  if (m_browser.expired())
125  return false;
126 
127  NpapiBrowserHostPtr browser(getHost());
128  if (!browser->isMainThread()) {
129  typedef bool (NPObjectAPI::*curtype)(const std::string&) const;
130  return browser->CallOnMainThread(boost::bind((curtype)&NPObjectAPI::HasProperty, this, propertyName));
131  }
132  if (is_JSAPI) {
133  FB::JSAPIPtr tmp = inner.lock();
134  if (tmp)
135  return tmp->HasProperty(propertyName);
136  else
137  return false;
138  }
139  return browser->HasProperty(obj, browser->GetStringIdentifier(propertyName.c_str()));
140 }
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
Provides a FB::JSObject implementation that wraps a NPObject*.
Definition: NPObjectAPI.h:32
bool HasProperty(const std::string &propertyName) const
Query if 'propertyName' is a valid property.