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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 30 matching lines...) Expand all Loading... |
41 : m_webStorageNamespace(std::move(webStorageNamespace)) {} | 41 : m_webStorageNamespace(std::move(webStorageNamespace)) {} |
42 | 42 |
43 StorageNamespace::~StorageNamespace() {} | 43 StorageNamespace::~StorageNamespace() {} |
44 | 44 |
45 StorageArea* StorageNamespace::localStorageArea(SecurityOrigin* origin) { | 45 StorageArea* StorageNamespace::localStorageArea(SecurityOrigin* origin) { |
46 ASSERT(isMainThread()); | 46 ASSERT(isMainThread()); |
47 static WebStorageNamespace* localStorageNamespace = nullptr; | 47 static WebStorageNamespace* localStorageNamespace = nullptr; |
48 if (!localStorageNamespace) | 48 if (!localStorageNamespace) |
49 localStorageNamespace = Platform::current()->createLocalStorageNamespace(); | 49 localStorageNamespace = Platform::current()->createLocalStorageNamespace(); |
50 return StorageArea::create( | 50 return StorageArea::create( |
51 wrapUnique( | 51 WTF::wrapUnique( |
52 localStorageNamespace->createStorageArea(WebSecurityOrigin(origin))), | 52 localStorageNamespace->createStorageArea(WebSecurityOrigin(origin))), |
53 LocalStorage); | 53 LocalStorage); |
54 } | 54 } |
55 | 55 |
56 StorageArea* StorageNamespace::storageArea(SecurityOrigin* origin) { | 56 StorageArea* StorageNamespace::storageArea(SecurityOrigin* origin) { |
57 return StorageArea::create( | 57 return StorageArea::create( |
58 wrapUnique( | 58 WTF::wrapUnique( |
59 m_webStorageNamespace->createStorageArea(WebSecurityOrigin(origin))), | 59 m_webStorageNamespace->createStorageArea(WebSecurityOrigin(origin))), |
60 SessionStorage); | 60 SessionStorage); |
61 } | 61 } |
62 | 62 |
63 bool StorageNamespace::isSameNamespace( | 63 bool StorageNamespace::isSameNamespace( |
64 const WebStorageNamespace& sessionNamespace) const { | 64 const WebStorageNamespace& sessionNamespace) const { |
65 return m_webStorageNamespace && | 65 return m_webStorageNamespace && |
66 m_webStorageNamespace->isSameNamespace(sessionNamespace); | 66 m_webStorageNamespace->isSameNamespace(sessionNamespace); |
67 } | 67 } |
68 | 68 |
69 } // namespace blink | 69 } // namespace blink |
OLD | NEW |