This source file includes following definitions.
- fromString
- serialize
- createInvalid
- reset
- assign
- toString
- deserialize
#include "config.h"
#include "WebSerializedScriptValue.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "public/platform/WebString.h"
using namespace WebCore;
namespace blink {
WebSerializedScriptValue WebSerializedScriptValue::fromString(const WebString& s)
{
return SerializedScriptValue::createFromWire(s);
}
WebSerializedScriptValue WebSerializedScriptValue::serialize(v8::Handle<v8::Value> value)
{
WebCore::TrackExceptionState exceptionState;
WebSerializedScriptValue serializedValue = SerializedScriptValue::create(value, 0, 0, exceptionState, v8::Isolate::GetCurrent());
if (exceptionState.hadException())
return createInvalid();
return serializedValue;
}
WebSerializedScriptValue WebSerializedScriptValue::createInvalid()
{
return SerializedScriptValue::create();
}
void WebSerializedScriptValue::reset()
{
m_private.reset();
}
void WebSerializedScriptValue::assign(const WebSerializedScriptValue& other)
{
m_private = other.m_private;
}
WebString WebSerializedScriptValue::toString() const
{
return m_private->toWireString();
}
v8::Handle<v8::Value> WebSerializedScriptValue::deserialize()
{
return m_private->deserialize();
}
WebSerializedScriptValue::WebSerializedScriptValue(const PassRefPtr<SerializedScriptValue>& value)
: m_private(value)
{
}
WebSerializedScriptValue& WebSerializedScriptValue::operator=(const PassRefPtr<SerializedScriptValue>& value)
{
m_private = value;
return *this;
}
WebSerializedScriptValue::operator PassRefPtr<SerializedScriptValue>() const
{
return m_private.get();
}
}