| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void DOMURL::setSearch(const String& value) | 77 void DOMURL::setSearch(const String& value) |
| 78 { | 78 { |
| 79 DOMURLUtils::setSearch(value); | 79 DOMURLUtils::setSearch(value); |
| 80 if (!value.isEmpty() && value[0] == '?') | 80 if (!value.isEmpty() && value[0] == '?') |
| 81 updateSearchParams(value.substring(1)); | 81 updateSearchParams(value.substring(1)); |
| 82 else | 82 else |
| 83 updateSearchParams(value); | 83 updateSearchParams(value); |
| 84 } | 84 } |
| 85 | 85 |
| 86 String DOMURL::createObjectURL(ExecutionContext* executionContext, Blob* blob, E
xceptionState& exceptionState) | |
| 87 { | |
| 88 DCHECK(blob); | |
| 89 if (!executionContext) | |
| 90 return String(); | |
| 91 if (blob->hasBeenClosed()) { | |
| 92 exceptionState.throwDOMException(InvalidStateError, String(blob->isFile(
) ? "File" : "Blob") + " has been closed."); | |
| 93 return String(); | |
| 94 } | |
| 95 return createPublicURL(executionContext, blob, blob->uuid()); | |
| 96 } | |
| 97 | |
| 98 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable, const String& uuid) | 86 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable, const String& uuid) |
| 99 { | 87 { |
| 100 KURL publicURL = BlobURL::createPublicURL(executionContext->getSecurityOrigi
n()); | 88 KURL publicURL = BlobURL::createPublicURL(executionContext->getSecurityOrigi
n()); |
| 101 if (publicURL.isEmpty()) | 89 if (publicURL.isEmpty()) |
| 102 return String(); | 90 return String(); |
| 103 | 91 |
| 104 executionContext->publicURLManager().registerURL(executionContext->getSecuri
tyOrigin(), publicURL, registrable, uuid); | 92 executionContext->publicURLManager().registerURL(executionContext->getSecuri
tyOrigin(), publicURL, registrable, uuid); |
| 105 | 93 |
| 106 return publicURL.getString(); | 94 return publicURL.getString(); |
| 107 } | 95 } |
| 108 | 96 |
| 109 void DOMURL::revokeObjectURL(ExecutionContext* executionContext, const String& u
rlString) | |
| 110 { | |
| 111 if (!executionContext) | |
| 112 return; | |
| 113 | |
| 114 KURL url(KURL(), urlString); | |
| 115 executionContext->removeURLFromMemoryCache(url); | |
| 116 executionContext->publicURLManager().revoke(url); | |
| 117 } | |
| 118 | |
| 119 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String&
uuid) | 97 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String&
uuid) |
| 120 { | 98 { |
| 121 if (!executionContext) | 99 if (!executionContext) |
| 122 return; | 100 return; |
| 123 | 101 |
| 124 executionContext->publicURLManager().revoke(uuid); | 102 executionContext->publicURLManager().revoke(uuid); |
| 125 } | 103 } |
| 126 | 104 |
| 127 URLSearchParams* DOMURL::searchParams() | 105 URLSearchParams* DOMURL::searchParams() |
| 128 { | 106 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 141 { | 119 { |
| 142 if (!m_searchParams) | 120 if (!m_searchParams) |
| 143 return; | 121 return; |
| 144 | 122 |
| 145 TemporaryChange<bool> scope(m_isInUpdate, true); | 123 TemporaryChange<bool> scope(m_isInUpdate, true); |
| 146 ASSERT(m_searchParams->urlObject() == this); | 124 ASSERT(m_searchParams->urlObject() == this); |
| 147 m_searchParams->setInput(queryString); | 125 m_searchParams->setInput(queryString); |
| 148 } | 126 } |
| 149 | 127 |
| 150 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |