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

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

Issue 157363003: Implement Blob.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid warning from PHP's fread() on empty reads Created 6 years, 10 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
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)
michaeln 2014/02/12 20:33:04 Not sure we need the addition of the uuid? The bal
sof 2014/02/12 22:28:26 I like the idea of using the URLRegistrable* as th
michaeln 2014/02/12 22:34:11 Right, that's sounds like a very good reason to no
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 } // namespace WebCore 94 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698