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 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "web/StorageClientImpl.h" | 26 #include "web/StorageClientImpl.h" |
27 | 27 |
28 #include "modules/storage/StorageNamespace.h" | 28 #include "modules/storage/StorageNamespace.h" |
29 #include "public/platform/WebStorageNamespace.h" | 29 #include "public/platform/WebStorageNamespace.h" |
30 #include "public/web/WebContentSettingsClient.h" | 30 #include "public/web/WebContentSettingsClient.h" |
31 #include "public/web/WebViewClient.h" | 31 #include "public/web/WebViewClient.h" |
32 #include "web/WebLocalFrameImpl.h" | 32 #include "web/WebLocalFrameImpl.h" |
33 #include "web/WebViewImpl.h" | 33 #include "web/WebViewImpl.h" |
| 34 #include "wtf/PtrUtil.h" |
| 35 #include <memory> |
34 | 36 |
35 namespace blink { | 37 namespace blink { |
36 | 38 |
37 StorageClientImpl::StorageClientImpl(WebViewImpl* webView) | 39 StorageClientImpl::StorageClientImpl(WebViewImpl* webView) |
38 : m_webView(webView) | 40 : m_webView(webView) |
39 { | 41 { |
40 } | 42 } |
41 | 43 |
42 PassOwnPtr<StorageNamespace> StorageClientImpl::createSessionStorageNamespace() | 44 std::unique_ptr<StorageNamespace> StorageClientImpl::createSessionStorageNamespa
ce() |
43 { | 45 { |
44 if (!m_webView->client()) | 46 if (!m_webView->client()) |
45 return nullptr; | 47 return nullptr; |
46 return adoptPtr(new StorageNamespace(adoptPtr(m_webView->client()->createSes
sionStorageNamespace()))); | 48 return wrapUnique(new StorageNamespace(wrapUnique(m_webView->client()->creat
eSessionStorageNamespace()))); |
47 } | 49 } |
48 | 50 |
49 bool StorageClientImpl::canAccessStorage(LocalFrame* frame, StorageType type) co
nst | 51 bool StorageClientImpl::canAccessStorage(LocalFrame* frame, StorageType type) co
nst |
50 { | 52 { |
51 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); | 53 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); |
52 return !webFrame->contentSettingsClient() || webFrame->contentSettingsClient
()->allowStorage(type == LocalStorage); | 54 return !webFrame->contentSettingsClient() || webFrame->contentSettingsClient
()->allowStorage(type == LocalStorage); |
53 } | 55 } |
54 | 56 |
55 } // namespace blink | 57 } // namespace blink |
OLD | NEW |