| 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 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/dom/DOMURL.h" | 28 #include "core/dom/DOMURL.h" |
| 29 | 29 |
| 30 #include "bindings/core/v8/ExceptionMessages.h" | 30 #include "bindings/core/v8/ExceptionMessages.h" |
| 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 "core/html/PublicURLManager.h" | |
| 36 #include "wtf/MainThread.h" | 35 #include "wtf/MainThread.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta
te) | 39 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta
te) |
| 41 { | 40 { |
| 42 ScriptWrappable::init(this); | 41 ScriptWrappable::init(this); |
| 43 if (!base.isValid()) | 42 if (!base.isValid()) |
| 44 exceptionState.throwDOMException(SyntaxError, "Invalid base URL"); | 43 exceptionState.throwDOMException(SyntaxError, "Invalid base URL"); |
| 45 | 44 |
| 46 m_url = KURL(base, url); | 45 m_url = KURL(base, url); |
| 47 if (!m_url.isValid()) | 46 if (!m_url.isValid()) |
| 48 exceptionState.throwDOMException(SyntaxError, "Invalid URL"); | 47 exceptionState.throwDOMException(SyntaxError, "Invalid URL"); |
| 49 } | 48 } |
| 50 | 49 |
| 51 void DOMURL::setInput(const String& value) | 50 void DOMURL::setInput(const String& value) |
| 52 { | 51 { |
| 53 KURL url(blankURL(), value); | 52 KURL url(blankURL(), value); |
| 54 if (url.isValid()) { | 53 if (url.isValid()) { |
| 55 m_url = url; | 54 m_url = url; |
| 56 m_input = String(); | 55 m_input = String(); |
| 57 } else { | 56 } else { |
| 58 m_url = KURL(); | 57 m_url = KURL(); |
| 59 m_input = value; | 58 m_input = value; |
| 60 } | 59 } |
| 61 } | 60 } |
| 62 | 61 |
| 63 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String&
uuid) | |
| 64 { | |
| 65 if (!executionContext) | |
| 66 return; | |
| 67 | |
| 68 executionContext->publicURLManager().revoke(uuid); | |
| 69 } | |
| 70 | |
| 71 } // namespace blink | 62 } // namespace blink |
| OLD | NEW |