Home | History | Annotate | Download | only in CPP
      1 /*
      2  * This file is part of the WebKit open source project.
      3  * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Library General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2 of the License, or (at your option) any later version.
      9  *
     10  * This library is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  * Library General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU Library General Public License
     16  * along with this library; see the file COPYING.LIB.  If not, write to
     17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18  * Boston, MA 02110-1301, USA.
     19  */
     20 
     21 #include "config.h"
     22 
     23 #if ENABLE(Condition1) || ENABLE(Condition2)
     24 
     25 #include "WebDOMTestSerializedScriptValueInterface.h"
     26 
     27 #include "SerializedScriptValue.h"
     28 #include "TestSerializedScriptValueInterface.h"
     29 #include "WebExceptionHandler.h"
     30 #include <wtf/GetPtr.h>
     31 #include <wtf/RefPtr.h>
     32 
     33 struct WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterfacePrivate {
     34     WebDOMTestSerializedScriptValueInterfacePrivate(WebCore::TestSerializedScriptValueInterface* object = 0)
     35         : impl(object)
     36     {
     37     }
     38 
     39     RefPtr<WebCore::TestSerializedScriptValueInterface> impl;
     40 };
     41 
     42 WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterface()
     43     : WebDOMObject()
     44     , m_impl(0)
     45 {
     46 }
     47 
     48 WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterface(WebCore::TestSerializedScriptValueInterface* impl)
     49     : WebDOMObject()
     50     , m_impl(new WebDOMTestSerializedScriptValueInterfacePrivate(impl))
     51 {
     52 }
     53 
     54 WebDOMTestSerializedScriptValueInterface::WebDOMTestSerializedScriptValueInterface(const WebDOMTestSerializedScriptValueInterface& copy)
     55     : WebDOMObject()
     56 {
     57     m_impl = copy.impl() ? new WebDOMTestSerializedScriptValueInterfacePrivate(copy.impl()) : 0;
     58 }
     59 
     60 WebDOMTestSerializedScriptValueInterface& WebDOMTestSerializedScriptValueInterface::operator=(const WebDOMTestSerializedScriptValueInterface& copy)
     61 {
     62     delete m_impl;
     63     m_impl = copy.impl() ? new WebDOMTestSerializedScriptValueInterfacePrivate(copy.impl()) : 0;
     64     return *this;
     65 }
     66 
     67 WebCore::TestSerializedScriptValueInterface* WebDOMTestSerializedScriptValueInterface::impl() const
     68 {
     69     return m_impl ? m_impl->impl.get() : 0;
     70 }
     71 
     72 WebDOMTestSerializedScriptValueInterface::~WebDOMTestSerializedScriptValueInterface()
     73 {
     74     delete m_impl;
     75     m_impl = 0;
     76 }
     77 
     78 WebDOMString WebDOMTestSerializedScriptValueInterface::value() const
     79 {
     80     if (!impl())
     81         return WebDOMString();
     82 
     83     return impl()->value()->toString();
     84 }
     85 
     86 WebCore::TestSerializedScriptValueInterface* toWebCore(const WebDOMTestSerializedScriptValueInterface& wrapper)
     87 {
     88     return wrapper.impl();
     89 }
     90 
     91 WebDOMTestSerializedScriptValueInterface toWebKit(WebCore::TestSerializedScriptValueInterface* value)
     92 {
     93     return WebDOMTestSerializedScriptValueInterface(value);
     94 }
     95 
     96 #endif // ENABLE(Condition1) || ENABLE(Condition2)
     97