| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 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 "public/platform/WebSecurityOrigin.h" | 31 #include "public/platform/WebSecurityOrigin.h" |
| 32 | 32 |
| 33 #include "platform/weborigin/DatabaseIdentifier.h" | |
| 34 #include "platform/weborigin/KURL.h" | 33 #include "platform/weborigin/KURL.h" |
| 35 #include "platform/weborigin/SecurityOrigin.h" | 34 #include "platform/weborigin/SecurityOrigin.h" |
| 36 #include "public/platform/WebString.h" | 35 #include "public/platform/WebString.h" |
| 37 #include "public/platform/WebURL.h" | 36 #include "public/platform/WebURL.h" |
| 38 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 39 | 38 |
| 40 namespace blink { | 39 namespace blink { |
| 41 | 40 |
| 42 class WebSecurityOriginPrivate : public SecurityOrigin { | 41 class WebSecurityOriginPrivate : public SecurityOrigin { |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 WebSecurityOrigin WebSecurityOrigin::createFromDatabaseIdentifier(const WebStrin
g& databaseIdentifier) | |
| 46 { | |
| 47 return WebSecurityOrigin(createSecurityOriginFromDatabaseIdentifier(database
Identifier)); | |
| 48 } | |
| 49 | |
| 50 WebSecurityOrigin WebSecurityOrigin::createFromString(const WebString& origin) | 44 WebSecurityOrigin WebSecurityOrigin::createFromString(const WebString& origin) |
| 51 { | 45 { |
| 52 return WebSecurityOrigin(SecurityOrigin::createFromString(origin)); | 46 return WebSecurityOrigin(SecurityOrigin::createFromString(origin)); |
| 53 } | 47 } |
| 54 | 48 |
| 55 WebSecurityOrigin WebSecurityOrigin::create(const WebURL& url) | 49 WebSecurityOrigin WebSecurityOrigin::create(const WebURL& url) |
| 56 { | 50 { |
| 57 return WebSecurityOrigin(SecurityOrigin::create(url)); | 51 return WebSecurityOrigin(SecurityOrigin::create(url)); |
| 58 } | 52 } |
| 59 | 53 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ASSERT(m_private); | 122 ASSERT(m_private); |
| 129 return m_private->isPotentiallyTrustworthy(); | 123 return m_private->isPotentiallyTrustworthy(); |
| 130 } | 124 } |
| 131 | 125 |
| 132 WebString WebSecurityOrigin::toString() const | 126 WebString WebSecurityOrigin::toString() const |
| 133 { | 127 { |
| 134 ASSERT(m_private); | 128 ASSERT(m_private); |
| 135 return m_private->toString(); | 129 return m_private->toString(); |
| 136 } | 130 } |
| 137 | 131 |
| 138 WebString WebSecurityOrigin::databaseIdentifier() const | |
| 139 { | |
| 140 ASSERT(m_private); | |
| 141 return createDatabaseIdentifierFromSecurityOrigin(m_private); | |
| 142 } | |
| 143 | |
| 144 bool WebSecurityOrigin::canAccessPasswordManager() const | 132 bool WebSecurityOrigin::canAccessPasswordManager() const |
| 145 { | 133 { |
| 146 ASSERT(m_private); | 134 ASSERT(m_private); |
| 147 return m_private->canAccessPasswordManager(); | 135 return m_private->canAccessPasswordManager(); |
| 148 } | 136 } |
| 149 | 137 |
| 150 WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<SecurityOrigin>& orig
in) | 138 WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<SecurityOrigin>& orig
in) |
| 151 : m_private(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())) | 139 : m_private(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())) |
| 152 { | 140 { |
| 153 } | 141 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 175 m_private->deref(); | 163 m_private->deref(); |
| 176 m_private = p; | 164 m_private = p; |
| 177 } | 165 } |
| 178 | 166 |
| 179 void WebSecurityOrigin::grantLoadLocalResources() const | 167 void WebSecurityOrigin::grantLoadLocalResources() const |
| 180 { | 168 { |
| 181 get()->grantLoadLocalResources(); | 169 get()->grantLoadLocalResources(); |
| 182 } | 170 } |
| 183 | 171 |
| 184 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |