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