Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: Source/core/dom/DOMURL.cpp

Issue 870053004: Make URL constructor failure throw TypeError (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change test expectation Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/domurl/url-constructor.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 #include "core/html/PublicURLManager.h" 36 #include "core/html/PublicURLManager.h"
37 #include "platform/blob/BlobURL.h" 37 #include "platform/blob/BlobURL.h"
38 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
39 #include "wtf/MainThread.h" 39 #include "wtf/MainThread.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta te) 43 DOMURL::DOMURL(const String& url, const KURL& base, ExceptionState& exceptionSta te)
44 { 44 {
45 if (!base.isValid()) 45 if (!base.isValid())
46 exceptionState.throwDOMException(SyntaxError, "Invalid base URL"); 46 exceptionState.throwTypeError("Invalid base URL");
47 47
48 m_url = KURL(base, url); 48 m_url = KURL(base, url);
49 if (!m_url.isValid()) 49 if (!m_url.isValid())
50 exceptionState.throwDOMException(SyntaxError, "Invalid URL"); 50 exceptionState.throwTypeError("Invalid URL");
51 } 51 }
52 52
53 void DOMURL::setInput(const String& value) 53 void DOMURL::setInput(const String& value)
54 { 54 {
55 KURL url(blankURL(), value); 55 KURL url(blankURL(), value);
56 if (url.isValid()) { 56 if (url.isValid()) {
57 m_url = url; 57 m_url = url;
58 m_input = String(); 58 m_input = String();
59 } else { 59 } else {
60 m_url = KURL(); 60 m_url = KURL();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String& uuid) 97 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String& uuid)
98 { 98 {
99 if (!executionContext) 99 if (!executionContext)
100 return; 100 return;
101 101
102 executionContext->publicURLManager().revoke(uuid); 102 executionContext->publicURLManager().revoke(uuid);
103 } 103 }
104 104
105 } // namespace blink 105 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/domurl/url-constructor.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698