diff options
Diffstat (limited to 'WebCore/page/SecurityOrigin.cpp')
-rw-r--r-- | WebCore/page/SecurityOrigin.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index 14a1b59..8274e0e 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -32,15 +32,10 @@ #include "CString.h" #include "FrameLoader.h" #include "KURL.h" -#include "PlatformString.h" -#include "StringHash.h" -#include <wtf/HashSet.h> #include <wtf/StdLibExtras.h> namespace WebCore { -typedef HashSet<String, CaseFoldingHash> URLSchemesMap; - static URLSchemesMap& localSchemes() { DEFINE_STATIC_LOCAL(URLSchemesMap, localSchemes, ()); @@ -346,6 +341,28 @@ void SecurityOrigin::registerURLSchemeAsLocal(const String& scheme) } // static +void SecurityOrigin::removeURLSchemeRegisteredAsLocal(const String& scheme) +{ + if (scheme == "file") + return; +#if PLATFORM(MAC) + if (scheme == "applewebdata") + return; +#endif +#if PLATFORM(QT) + if (scheme == "qrc") + return; +#endif + localSchemes().remove(scheme); +} + +// static +const URLSchemesMap& SecurityOrigin::localURLSchemes() +{ + return localSchemes(); +} + +// static bool SecurityOrigin::shouldTreatURLAsLocal(const String& url) { // This avoids an allocation of another String and the HashSet contains() |