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 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 #include "public/web/WebSecurityOrigin.h" | 32 #include "public/web/WebSecurityOrigin.h" |
33 | 33 |
34 #include "platform/weborigin/DatabaseIdentifier.h" | 34 #include "platform/weborigin/DatabaseIdentifier.h" |
35 #include "platform/weborigin/KURL.h" | 35 #include "platform/weborigin/KURL.h" |
36 #include "platform/weborigin/SecurityOrigin.h" | 36 #include "platform/weborigin/SecurityOrigin.h" |
37 #include "public/platform/WebString.h" | 37 #include "public/platform/WebString.h" |
38 #include "public/platform/WebURL.h" | 38 #include "public/platform/WebURL.h" |
39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
40 | 40 |
41 using namespace WebCore; | 41 using namespace blink; |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class WebSecurityOriginPrivate : public SecurityOrigin { | 45 class WebSecurityOriginPrivate : public SecurityOrigin { |
46 }; | 46 }; |
47 | 47 |
48 WebSecurityOrigin WebSecurityOrigin::createFromDatabaseIdentifier(const WebStrin
g& databaseIdentifier) | 48 WebSecurityOrigin WebSecurityOrigin::createFromDatabaseIdentifier(const WebStrin
g& databaseIdentifier) |
49 { | 49 { |
50 return WebSecurityOrigin(createSecurityOriginFromDatabaseIdentifier(database
Identifier)); | 50 return WebSecurityOrigin(createSecurityOriginFromDatabaseIdentifier(database
Identifier)); |
51 } | 51 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ASSERT(m_private); | 121 ASSERT(m_private); |
122 return createDatabaseIdentifierFromSecurityOrigin(m_private); | 122 return createDatabaseIdentifierFromSecurityOrigin(m_private); |
123 } | 123 } |
124 | 124 |
125 bool WebSecurityOrigin::canAccessPasswordManager() const | 125 bool WebSecurityOrigin::canAccessPasswordManager() const |
126 { | 126 { |
127 ASSERT(m_private); | 127 ASSERT(m_private); |
128 return m_private->canAccessPasswordManager(); | 128 return m_private->canAccessPasswordManager(); |
129 } | 129 } |
130 | 130 |
131 WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrig
in>& origin) | 131 WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<blink::SecurityOrigin
>& origin) |
132 : m_private(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())) | 132 : m_private(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())) |
133 { | 133 { |
134 } | 134 } |
135 | 135 |
136 WebSecurityOrigin& WebSecurityOrigin::operator=(const WTF::PassRefPtr<WebCore::S
ecurityOrigin>& origin) | 136 WebSecurityOrigin& WebSecurityOrigin::operator=(const WTF::PassRefPtr<blink::Sec
urityOrigin>& origin) |
137 { | 137 { |
138 assign(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())); | 138 assign(static_cast<WebSecurityOriginPrivate*>(origin.leakRef())); |
139 return *this; | 139 return *this; |
140 } | 140 } |
141 | 141 |
142 WebSecurityOrigin::operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const | 142 WebSecurityOrigin::operator WTF::PassRefPtr<blink::SecurityOrigin>() const |
143 { | 143 { |
144 return PassRefPtr<SecurityOrigin>(const_cast<WebSecurityOriginPrivate*>(m_pr
ivate)); | 144 return PassRefPtr<SecurityOrigin>(const_cast<WebSecurityOriginPrivate*>(m_pr
ivate)); |
145 } | 145 } |
146 | 146 |
147 SecurityOrigin* WebSecurityOrigin::get() const | 147 SecurityOrigin* WebSecurityOrigin::get() const |
148 { | 148 { |
149 return m_private; | 149 return m_private; |
150 } | 150 } |
151 | 151 |
152 void WebSecurityOrigin::assign(WebSecurityOriginPrivate* p) | 152 void WebSecurityOrigin::assign(WebSecurityOriginPrivate* p) |
153 { | 153 { |
154 // p is already ref'd for us by the caller | 154 // p is already ref'd for us by the caller |
155 if (m_private) | 155 if (m_private) |
156 m_private->deref(); | 156 m_private->deref(); |
157 m_private = p; | 157 m_private = p; |
158 } | 158 } |
159 | 159 |
160 void WebSecurityOrigin::grantLoadLocalResources() const | 160 void WebSecurityOrigin::grantLoadLocalResources() const |
161 { | 161 { |
162 get()->grantLoadLocalResources(); | 162 get()->grantLoadLocalResources(); |
163 } | 163 } |
164 | 164 |
165 } // namespace blink | 165 } // namespace blink |
OLD | NEW |