| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } else { | 60 } else { |
| 61 m_url = KURL(); | 61 m_url = KURL(); |
| 62 m_input = value; | 62 m_input = value; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 String DOMURL::createObjectURL(ExecutionContext* executionContext, Blob* blob) | 66 String DOMURL::createObjectURL(ExecutionContext* executionContext, Blob* blob) |
| 67 { | 67 { |
| 68 if (!executionContext || !blob) | 68 if (!executionContext || !blob) |
| 69 return String(); | 69 return String(); |
| 70 return createPublicURL(executionContext, blob); | 70 return createPublicURL(executionContext, blob, blob->uuid()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable) | 73 String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrabl
e* registrable, const String& uuid) |
| 74 { | 74 { |
| 75 KURL publicURL = BlobURL::createPublicURL(executionContext->securityOrigin()
); | 75 KURL publicURL = BlobURL::createPublicURL(executionContext->securityOrigin()
); |
| 76 if (publicURL.isEmpty()) | 76 if (publicURL.isEmpty()) |
| 77 return String(); | 77 return String(); |
| 78 | 78 |
| 79 executionContext->publicURLManager().registerURL(executionContext->securityO
rigin(), publicURL, registrable); | 79 executionContext->publicURLManager().registerURL(executionContext->securityO
rigin(), publicURL, registrable, uuid); |
| 80 | 80 |
| 81 return publicURL.string(); | 81 return publicURL.string(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DOMURL::revokeObjectURL(ExecutionContext* executionContext, const String& u
rlString) | 84 void DOMURL::revokeObjectURL(ExecutionContext* executionContext, const String& u
rlString) |
| 85 { | 85 { |
| 86 if (!executionContext) | 86 if (!executionContext) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 KURL url(KURL(), urlString); | 89 KURL url(KURL(), urlString); |
| 90 MemoryCache::removeURLFromCache(executionContext, url); | 90 MemoryCache::removeURLFromCache(executionContext, url); |
| 91 executionContext->publicURLManager().revoke(url); | 91 executionContext->publicURLManager().revoke(url); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void DOMURL::revokeObjectUUID(ExecutionContext* executionContext, const String&
uuid) |
| 95 { |
| 96 if (!executionContext) |
| 97 return; |
| 98 |
| 99 executionContext->publicURLManager().revoke(uuid); |
| 100 } |
| 101 |
| 94 } // namespace WebCore | 102 } // namespace WebCore |
| OLD | NEW |