Index: Source/web/WebDOMException.cpp |
diff --git a/Source/web/WebDOMException.cpp b/Source/web/WebDOMException.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20c7497d0638507b1cb87f9ff9046b44ba43f048 |
--- /dev/null |
+++ b/Source/web/WebDOMException.cpp |
@@ -0,0 +1,72 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "public/platform/WebDOMException.h" |
+ |
+#include "V8DOMException.h" |
+#include "bindings/v8/V8Binding.h" |
+#include "core/dom/DOMException.h" |
+#include "wtf/PassOwnPtr.h" |
+ |
+using namespace WebCore; |
+ |
+namespace blink { |
+ |
+WebDOMException WebDOMException::create(unsigned short code, const WebString& name, const WebString& message) |
+{ |
+ return WebDOMException(DOMException::create(code, name, message)); |
+} |
+ |
+void WebDOMException::reset() |
+{ |
+ m_private.reset(); |
+} |
+ |
+void WebDOMException::assign(const WebDOMException& other) |
+{ |
+ m_private = other.m_private; |
+} |
+ |
+unsigned short int WebDOMException::code() const |
+{ |
+ if (!m_private.get()) |
+ return 0; |
+ return m_private->code(); |
+} |
+ |
+WebString WebDOMException::name() const |
+{ |
+ if (!m_private.get()) |
+ return WebString(); |
+ return m_private->name(); |
+} |
+ |
+WebString WebDOMException::message() const |
+{ |
+ if (!m_private.get()) |
+ return WebString(); |
+ return m_private->message(); |
+} |
+ |
+v8::Handle<v8::Value> WebDOMException::toV8Value() |
+{ |
+ if (!m_private.get()) |
+ return v8::Handle<v8::Value>(); |
+ return toV8(m_private.get(), v8::Handle<v8::Object>(), v8::Isolate::GetCurrent()); |
+} |
+ |
+WebDOMException::WebDOMException(const PassRefPtrWillBeRawPtr<WebCore::DOMException>& error) |
+ : m_private(error) |
+{ |
+} |
+ |
+WebDOMException& WebDOMException::operator=(const PassRefPtrWillBeRawPtr<WebCore::DOMException>& error) |
+{ |
+ m_private = error; |
+ return *this; |
+} |
+ |
+} // namespace blink |
+ |