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

Side by Side Diff: WebCore/fileapi/BlobURL.cpp

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 years, 1 month 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 namespace WebCore { 40 namespace WebCore {
41 41
42 const char BlobURL::kBlobProtocol[] = "blob"; 42 const char BlobURL::kBlobProtocol[] = "blob";
43 43
44 KURL BlobURL::createPublicURL(SecurityOrigin* securityOrigin) 44 KURL BlobURL::createPublicURL(SecurityOrigin* securityOrigin)
45 { 45 {
46 ASSERT(securityOrigin); 46 ASSERT(securityOrigin);
47 return createBlobURL(securityOrigin->toString()); 47 return createBlobURL(securityOrigin->toString());
48 } 48 }
49 49
50 /*
50 KURL BlobURL::createInternalURL() 51 KURL BlobURL::createInternalURL()
51 { 52 {
52 return createBlobURL("blobinternal://"); 53 return createBlobURL("blobinternal://");
53 } 54 }
55 */
54 56
55 String BlobURL::getOrigin(const KURL& url) 57 String BlobURL::getOrigin(const KURL& url)
56 { 58 {
57 ASSERT(url.protocolIs(kBlobProtocol)); 59 ASSERT(url.protocolIs(kBlobProtocol));
58 60
59 unsigned startIndex = url.pathStart(); 61 unsigned startIndex = url.pathStart();
60 unsigned endIndex = url.pathAfterLastSlash(); 62 unsigned endIndex = url.pathAfterLastSlash();
61 return url.string().substring(startIndex, endIndex - startIndex - 1); 63 return url.string().substring(startIndex, endIndex - startIndex - 1);
62 } 64 }
63 65
66 /*
64 String BlobURL::getIdentifier(const KURL& url) 67 String BlobURL::getIdentifier(const KURL& url)
65 { 68 {
66 ASSERT(url.protocolIs(kBlobProtocol)); 69 ASSERT(url.protocolIs(kBlobProtocol));
67 70
68 unsigned startIndex = url.pathAfterLastSlash(); 71 unsigned startIndex = url.pathAfterLastSlash();
69 return url.string().substring(startIndex); 72 return url.string().substring(startIndex);
70 } 73 }
74 */
71 75
72 KURL BlobURL::createBlobURL(const String& originString) 76 KURL BlobURL::createBlobURL(const String& originString)
73 { 77 {
74 ASSERT(!originString.isEmpty()); 78 ASSERT(!originString.isEmpty());
75 String urlString = "blob:" + encodeWithURLEscapeSequences(originString) + '/ ' + createCanonicalUUIDString(); 79 String urlString = "blob:" + encodeWithURLEscapeSequences(originString) + '/ ' + createCanonicalUUIDString();
76 return KURL(ParsedURLString, urlString); 80 return KURL(ParsedURLString, urlString);
77 } 81 }
78 82
79 } // namespace WebCore 83 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698