OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #ifndef SecurityOrigin_h | 29 #ifndef SecurityOrigin_h |
30 #define SecurityOrigin_h | 30 #define SecurityOrigin_h |
31 | 31 |
32 #include "base/gtest_prod_util.h" | 32 #include "base/gtest_prod_util.h" |
33 #include "platform/PlatformExport.h" | 33 #include "platform/PlatformExport.h" |
34 #include "platform/weborigin/Suborigin.h" | 34 #include "platform/weborigin/Suborigin.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 #include "wtf/ThreadSafeRefCounted.h" | 36 #include "wtf/ThreadSafeRefCounted.h" |
37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
38 #include <memory> | |
39 | 38 |
40 namespace blink { | 39 namespace blink { |
41 | 40 |
42 class KURL; | 41 class KURL; |
43 class SecurityOriginCache; | 42 class SecurityOriginCache; |
44 | 43 |
45 class PLATFORM_EXPORT SecurityOrigin : public RefCounted<SecurityOrigin> { | 44 class PLATFORM_EXPORT SecurityOrigin : public RefCounted<SecurityOrigin> { |
46 WTF_MAKE_NONCOPYABLE(SecurityOrigin); | 45 WTF_MAKE_NONCOPYABLE(SecurityOrigin); |
47 public: | 46 public: |
48 static PassRefPtr<SecurityOrigin> create(const KURL&); | 47 static PassRefPtr<SecurityOrigin> create(const KURL&); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // The following privileges are currently copied over: | 244 // The following privileges are currently copied over: |
246 // | 245 // |
247 // - Grant universal access. | 246 // - Grant universal access. |
248 // - Grant loading of local resources. | 247 // - Grant loading of local resources. |
249 // - Use path-based file:// origins. | 248 // - Use path-based file:// origins. |
250 struct PrivilegeData { | 249 struct PrivilegeData { |
251 bool m_universalAccess; | 250 bool m_universalAccess; |
252 bool m_canLoadLocalResources; | 251 bool m_canLoadLocalResources; |
253 bool m_blockLocalAccessFromLocalOrigin; | 252 bool m_blockLocalAccessFromLocalOrigin; |
254 }; | 253 }; |
255 std::unique_ptr<PrivilegeData> createPrivilegeData() const; | 254 PassOwnPtr<PrivilegeData> createPrivilegeData() const; |
256 void transferPrivilegesFrom(std::unique_ptr<PrivilegeData>); | 255 void transferPrivilegesFrom(PassOwnPtr<PrivilegeData>); |
257 | 256 |
258 void setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOriginPotentiallyT
rustworthy); | 257 void setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOriginPotentiallyT
rustworthy); |
259 | 258 |
260 private: | 259 private: |
261 friend class SecurityOriginTest; | 260 friend class SecurityOriginTest; |
262 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, Suborigins); | 261 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, Suborigins); |
263 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, SuboriginsParsing); | 262 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, SuboriginsParsing); |
264 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, SuboriginsIsSameSchemeHostPortA
ndSuborigin); | 263 FRIEND_TEST_ALL_PREFIXES(SecurityOriginTest, SuboriginsIsSameSchemeHostPortA
ndSuborigin); |
265 | 264 |
266 SecurityOrigin(); | 265 SecurityOrigin(); |
(...skipping 17 matching lines...) Expand all Loading... |
284 bool m_universalAccess; | 283 bool m_universalAccess; |
285 bool m_domainWasSetInDOM; | 284 bool m_domainWasSetInDOM; |
286 bool m_canLoadLocalResources; | 285 bool m_canLoadLocalResources; |
287 bool m_blockLocalAccessFromLocalOrigin; | 286 bool m_blockLocalAccessFromLocalOrigin; |
288 bool m_isUniqueOriginPotentiallyTrustworthy; | 287 bool m_isUniqueOriginPotentiallyTrustworthy; |
289 }; | 288 }; |
290 | 289 |
291 } // namespace blink | 290 } // namespace blink |
292 | 291 |
293 #endif // SecurityOrigin_h | 292 #endif // SecurityOrigin_h |
OLD | NEW |