| 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> | |
| 36 | 34 |
| 37 namespace blink { | 35 namespace blink { |
| 38 | 36 |
| 39 StorageClientImpl::StorageClientImpl(WebViewImpl* webView) | 37 StorageClientImpl::StorageClientImpl(WebViewImpl* webView) |
| 40 : m_webView(webView) | 38 : m_webView(webView) |
| 41 { | 39 { |
| 42 } | 40 } |
| 43 | 41 |
| 44 std::unique_ptr<StorageNamespace> StorageClientImpl::createSessionStorageNamespa
ce() | 42 PassOwnPtr<StorageNamespace> StorageClientImpl::createSessionStorageNamespace() |
| 45 { | 43 { |
| 46 if (!m_webView->client()) | 44 if (!m_webView->client()) |
| 47 return nullptr; | 45 return nullptr; |
| 48 return wrapUnique(new StorageNamespace(wrapUnique(m_webView->client()->creat
eSessionStorageNamespace()))); | 46 return adoptPtr(new StorageNamespace(adoptPtr(m_webView->client()->createSes
sionStorageNamespace()))); |
| 49 } | 47 } |
| 50 | 48 |
| 51 bool StorageClientImpl::canAccessStorage(LocalFrame* frame, StorageType type) co
nst | 49 bool StorageClientImpl::canAccessStorage(LocalFrame* frame, StorageType type) co
nst |
| 52 { | 50 { |
| 53 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); | 51 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); |
| 54 return !webFrame->contentSettingsClient() || webFrame->contentSettingsClient
()->allowStorage(type == LocalStorage); | 52 return !webFrame->contentSettingsClient() || webFrame->contentSettingsClient
()->allowStorage(type == LocalStorage); |
| 55 } | 53 } |
| 56 | 54 |
| 57 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |