| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return String(); | 68 return String(); |
| 69 if (blob->hasBeenClosed()) { | 69 if (blob->hasBeenClosed()) { |
| 70 exceptionState.throwDOMException(InvalidStateError, String(blob->isFile(
) ? "File" : "Blob") + " has been closed."); | 70 exceptionState.throwDOMException(InvalidStateError, String(blob->isFile(
) ? "File" : "Blob") + " has been closed."); |
| 71 return String(); | 71 return String(); |
| 72 } | 72 } |
| 73 return createPublicURL(executionContext, blob, blob->uuid()); | 73 return createPublicURL(executionContext, blob, blob->uuid()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable, const String& uuid) | 76 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable, const String& uuid) |
| 77 { | 77 { |
| 78 KURL publicURL = BlobURL::createPublicURL(executionContext->securityOrigin()
); | 78 KURL publicURL = BlobURL::createPublicURL(executionContext->getSecurityOrigi
n()); |
| 79 if (publicURL.isEmpty()) | 79 if (publicURL.isEmpty()) |
| 80 return String(); | 80 return String(); |
| 81 | 81 |
| 82 executionContext->publicURLManager().registerURL(executionContext->securityO
rigin(), publicURL, registrable, uuid); | 82 executionContext->publicURLManager().registerURL(executionContext->getSecuri
tyOrigin(), publicURL, registrable, uuid); |
| 83 | 83 |
| 84 return publicURL.getString(); | 84 return publicURL.getString(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void DOMURL::revokeObjectURL(ExecutionContext* executionContext, const String& u
rlString) | 87 void DOMURL::revokeObjectURL(ExecutionContext* executionContext, const String& u
rlString) |
| 88 { | 88 { |
| 89 if (!executionContext) | 89 if (!executionContext) |
| 90 return; | 90 return; |
| 91 | 91 |
| 92 KURL url(KURL(), urlString); | 92 KURL url(KURL(), urlString); |
| 93 executionContext->removeURLFromMemoryCache(url); | 93 executionContext->removeURLFromMemoryCache(url); |
| 94 executionContext->publicURLManager().revoke(url); | 94 executionContext->publicURLManager().revoke(url); |
| 95 } | 95 } |
| 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 |
| OLD | NEW |