| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Motorola Mobility Inc. | 3 * Copyright (C) 2012 Motorola Mobility Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
| 32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
| 33 #include "core/dom/ExecutionContext.h" | 33 #include "core/dom/ExecutionContext.h" |
| 34 #include "core/fetch/MemoryCache.h" | 34 #include "core/fetch/MemoryCache.h" |
| 35 #include "wtf/MainThread.h" | 35 #include "wtf/MainThread.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta
te) | 39 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta
te) |
| 40 { | 40 { |
| 41 ScriptWrappable::init(this); | |
| 42 if (!base.isValid()) | 41 if (!base.isValid()) |
| 43 exceptionState.throwDOMException(SyntaxError, "Invalid base URL"); | 42 exceptionState.throwDOMException(SyntaxError, "Invalid base URL"); |
| 44 | 43 |
| 45 m_url = KURL(base, url); | 44 m_url = KURL(base, url); |
| 46 if (!m_url.isValid()) | 45 if (!m_url.isValid()) |
| 47 exceptionState.throwDOMException(SyntaxError, "Invalid URL"); | 46 exceptionState.throwDOMException(SyntaxError, "Invalid URL"); |
| 48 } | 47 } |
| 49 | 48 |
| 50 void DOMURL::setInput(const String& value) | 49 void DOMURL::setInput(const String& value) |
| 51 { | 50 { |
| 52 KURL url(blankURL(), value); | 51 KURL url(blankURL(), value); |
| 53 if (url.isValid()) { | 52 if (url.isValid()) { |
| 54 m_url = url; | 53 m_url = url; |
| 55 m_input = String(); | 54 m_input = String(); |
| 56 } else { | 55 } else { |
| 57 m_url = KURL(); | 56 m_url = KURL(); |
| 58 m_input = value; | 57 m_input = value; |
| 59 } | 58 } |
| 60 } | 59 } |
| 61 | 60 |
| 62 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |