| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebKit.h" | 32 #include "WebKit.h" |
| 33 | 33 |
| 34 #include "WebMediaPlayerClientImpl.h" | 34 #include "WebMediaPlayerClientImpl.h" |
| 35 #include "WebString.h" | |
| 36 | 35 |
| 37 #include "AtomicString.h" | 36 #include "AtomicString.h" |
| 38 #include "DOMTimer.h" | 37 #include "DOMTimer.h" |
| 39 #include "FrameLoader.h" | |
| 40 #include "Page.h" | 38 #include "Page.h" |
| 41 #include "SecurityOrigin.h" | |
| 42 #include "TextEncoding.h" | 39 #include "TextEncoding.h" |
| 43 #include "WebSocket.h" | 40 #include "WebSocket.h" |
| 44 #include "WorkerContextExecutionProxy.h" | 41 #include "WorkerContextExecutionProxy.h" |
| 45 #include <wtf/Assertions.h> | 42 #include <wtf/Assertions.h> |
| 46 #include <wtf/Threading.h> | 43 #include <wtf/Threading.h> |
| 47 | 44 |
| 48 namespace WebKit { | 45 namespace WebKit { |
| 49 | 46 |
| 50 static WebKitClient* s_webKitClient = 0; | 47 static WebKitClient* s_webKitClient = 0; |
| 51 static bool s_layoutTestMode = false; | 48 static bool s_layoutTestMode = false; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 void setLayoutTestMode(bool value) | 87 void setLayoutTestMode(bool value) |
| 91 { | 88 { |
| 92 s_layoutTestMode = value; | 89 s_layoutTestMode = value; |
| 93 } | 90 } |
| 94 | 91 |
| 95 bool layoutTestMode() | 92 bool layoutTestMode() |
| 96 { | 93 { |
| 97 return s_layoutTestMode; | 94 return s_layoutTestMode; |
| 98 } | 95 } |
| 99 | 96 |
| 100 void registerURLSchemeAsLocal(const WebString& scheme) | |
| 101 { | |
| 102 WebCore::SecurityOrigin::registerURLSchemeAsLocal(scheme); | |
| 103 } | |
| 104 | |
| 105 void registerURLSchemeAsNoAccess(const WebString& scheme) | |
| 106 { | |
| 107 WebCore::SecurityOrigin::registerURLSchemeAsNoAccess(scheme); | |
| 108 } | |
| 109 | |
| 110 void enableMediaPlayer() | 97 void enableMediaPlayer() |
| 111 { | 98 { |
| 112 #if ENABLE(VIDEO) | 99 #if ENABLE(VIDEO) |
| 113 WebMediaPlayerClientImpl::setIsEnabled(true); | 100 WebMediaPlayerClientImpl::setIsEnabled(true); |
| 114 #endif | 101 #endif |
| 115 } | 102 } |
| 116 | 103 |
| 117 void resetPluginCache(bool reloadPages) | 104 void resetPluginCache(bool reloadPages) |
| 118 { | 105 { |
| 119 WebCore::Page::refreshPlugins(reloadPages); | 106 WebCore::Page::refreshPlugins(reloadPages); |
| 120 } | 107 } |
| 121 | 108 |
| 122 void enableDatabases() | 109 void enableDatabases() |
| 123 { | 110 { |
| 124 #if ENABLE(DATABASE) | 111 #if ENABLE(DATABASE) |
| 125 s_databasesEnabled = true; | 112 s_databasesEnabled = true; |
| 126 #endif | 113 #endif |
| 127 } | 114 } |
| 128 | 115 |
| 129 bool databasesEnabled() | 116 bool databasesEnabled() |
| 130 { | 117 { |
| 131 return s_databasesEnabled; | 118 return s_databasesEnabled; |
| 132 } | 119 } |
| 133 | 120 |
| 134 void whiteListAccessFromOrigin(const WebURL& sourceOrigin, | |
| 135 const WebString& destinationProtocol, | |
| 136 const WebString& destinationHost, | |
| 137 bool allowDestinationSubdomains) | |
| 138 { | |
| 139 WebCore::SecurityOrigin::whiteListAccessFromOrigin( | |
| 140 *WebCore::SecurityOrigin::create(sourceOrigin), destinationProtocol, | |
| 141 destinationHost, allowDestinationSubdomains); | |
| 142 } | |
| 143 | |
| 144 void resetOriginAccessWhiteLists() | |
| 145 { | |
| 146 WebCore::SecurityOrigin::resetOriginAccessWhiteLists(); | |
| 147 } | |
| 148 | |
| 149 void enableWebSockets() | 121 void enableWebSockets() |
| 150 { | 122 { |
| 151 #if ENABLE(WEB_SOCKETS) | 123 #if ENABLE(WEB_SOCKETS) |
| 152 WebCore::WebSocket::setIsAvailable(true); | 124 WebCore::WebSocket::setIsAvailable(true); |
| 153 #endif | 125 #endif |
| 154 } | 126 } |
| 155 | 127 |
| 156 bool webSocketsEnabled() | 128 bool webSocketsEnabled() |
| 157 { | 129 { |
| 158 #if ENABLE(WEB_SOCKETS) | 130 #if ENABLE(WEB_SOCKETS) |
| 159 return WebCore::WebSocket::isAvailable(); | 131 return WebCore::WebSocket::isAvailable(); |
| 160 #else | 132 #else |
| 161 return false; | 133 return false; |
| 162 #endif | 134 #endif |
| 163 } | 135 } |
| 164 | 136 |
| 165 } // namespace WebKit | 137 } // namespace WebKit |
| OLD | NEW |