#define CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
#pragma once
-#include "include/cef_base.h"
-#include "include/cef_xml_reader.h"
#include <map>
#include <vector>
+#include "include/base/cef_lock.h"
+#include "include/base/cef_macros.h"
+#include "include/base/cef_ref_counted.h"
+#include "include/cef_base.h"
+#include "include/cef_xml_reader.h"
+
class CefStreamReader;
///
// (c) Element nodes are represented by their outer XML string.
// </pre>
///
-class CefXmlObject : public CefBase {
+class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
public:
typedef std::vector<CefRefPtr<CefXmlObject> > ObjectVector;
typedef std::map<CefString, CefString > AttributeMap;
// at least one character long.
///
explicit CefXmlObject(const CefString& name);
- virtual ~CefXmlObject();
///
// Load the contents of the specified XML stream into this object. The
size_t FindChildren(const CefString& name, ObjectVector& children);
private:
+ // Protect against accidental deletion of this object.
+ friend class base::RefCountedThreadSafe<CefXmlObject>;
+ ~CefXmlObject();
+
void SetParent(CefXmlObject* parent);
CefString name_;
AttributeMap attributes_;
ObjectVector children_;
- IMPLEMENT_REFCOUNTING(CefXmlObject);
- IMPLEMENT_LOCKING(CefXmlObject);
+ base::Lock lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(CefXmlObject);
};
#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_