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

Side by Side Diff: WebCore/page/SecurityOrigin.cpp

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « WebCore/html/PublicURLManager.h ('k') | WebCore/platform/AsyncFileSystemCallbacks.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "SecurityOrigin.h" 30 #include "SecurityOrigin.h"
31 31
32 #include "BlobURL.h" 32 #include "BlobURL.h"
33 #include "BlobRegistry.h"
33 #include "Document.h" 34 #include "Document.h"
34 #include "FileSystem.h" 35 #include "FileSystem.h"
35 #include "KURL.h" 36 #include "KURL.h"
36 #include "SchemeRegistry.h" 37 #include "SchemeRegistry.h"
37 #include "SecurityPolicy.h" 38 #include "SecurityPolicy.h"
38 #include "ThreadableBlobRegistry.h"
39 #include <wtf/MainThread.h> 39 #include <wtf/MainThread.h>
40 #include <wtf/StdLibExtras.h> 40 #include <wtf/StdLibExtras.h>
41 #include <wtf/text/StringBuilder.h> 41 #include <wtf/text/StringBuilder.h>
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 const int InvalidPort = 0; 45 const int InvalidPort = 0;
46 const int MaxAllowedPort = 65535; 46 const int MaxAllowedPort = 65535;
47 47
48 static bool schemeRequiresAuthority(const KURL& url) 48 static bool schemeRequiresAuthority(const KURL& url)
(...skipping 27 matching lines...) Expand all
76 return *url.innerURL(); 76 return *url.innerURL();
77 // FIXME: Update this callsite to use the innerURL member function when 77 // FIXME: Update this callsite to use the innerURL member function when
78 // we finish implementing it. 78 // we finish implementing it.
79 return KURL(ParsedURLString, decodeURLEscapeSequences(url.path())); 79 return KURL(ParsedURLString, decodeURLEscapeSequences(url.path()));
80 } 80 }
81 81
82 static PassRefPtr<SecurityOrigin> getCachedOrigin(const KURL& url) 82 static PassRefPtr<SecurityOrigin> getCachedOrigin(const KURL& url)
83 { 83 {
84 #if ENABLE(BLOB) 84 #if ENABLE(BLOB)
85 if (url.protocolIs("blob")) 85 if (url.protocolIs("blob"))
86 return ThreadableBlobRegistry::getCachedOrigin(url); 86 return blobRegistry().cachedUniqueOrigin(url);
87 #endif 87 #endif
88 return 0; 88 return 0;
89 } 89 }
90 90
91 static bool shouldTreatAsUniqueOrigin(const KURL& url) 91 static bool shouldTreatAsUniqueOrigin(const KURL& url)
92 { 92 {
93 if (!url.isValid()) 93 if (!url.isValid())
94 return true; 94 return true;
95 95
96 // FIXME: Do we need to unwrap the URL further? 96 // FIXME: Do we need to unwrap the URL further?
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (m_port != other->m_port) 570 if (m_port != other->m_port)
571 return false; 571 return false;
572 572
573 if (isLocal() && !passesFileCheck(other)) 573 if (isLocal() && !passesFileCheck(other))
574 return false; 574 return false;
575 575
576 return true; 576 return true;
577 } 577 }
578 578
579 } // namespace WebCore 579 } // namespace WebCore
OLDNEW
« no previous file with comments | « WebCore/html/PublicURLManager.h ('k') | WebCore/platform/AsyncFileSystemCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698