Index: third_party/WebKit/Source/web/StorageClientImpl.cpp |
diff --git a/third_party/WebKit/Source/web/StorageClientImpl.cpp b/third_party/WebKit/Source/web/StorageClientImpl.cpp |
index f0527cc0da9e92e0fdc8366134b5dccb0c2d3ff2..0f9cfef6270b2e35bfce848c64e61a1107a339ec 100644 |
--- a/third_party/WebKit/Source/web/StorageClientImpl.cpp |
+++ b/third_party/WebKit/Source/web/StorageClientImpl.cpp |
@@ -25,17 +25,24 @@ |
#include "web/StorageClientImpl.h" |
+#include <memory> |
+#include "core/frame/ContentSettingsClient.h" |
#include "modules/storage/StorageNamespace.h" |
#include "public/platform/WebStorageNamespace.h" |
-#include "public/web/WebContentSettingsClient.h" |
#include "public/web/WebViewClient.h" |
-#include "web/WebLocalFrameImpl.h" |
#include "web/WebViewImpl.h" |
#include "wtf/PtrUtil.h" |
-#include <memory> |
namespace blink { |
+#define STATIC_ASSERT_MATCHING_ENUM(enum_name1, enum_name2) \ |
+ static_assert(static_cast<int>(enum_name1) == static_cast<int>(enum_name2), \ |
+ "mismatching enums: " #enum_name1) |
+STATIC_ASSERT_MATCHING_ENUM(LocalStorage, |
+ ContentSettingsClient::StorageType::kLocal); |
+STATIC_ASSERT_MATCHING_ENUM(SessionStorage, |
+ ContentSettingsClient::StorageType::kSession); |
+ |
StorageClientImpl::StorageClientImpl(WebViewImpl* webView) |
: m_webView(webView) {} |
@@ -49,9 +56,9 @@ StorageClientImpl::createSessionStorageNamespace() { |
bool StorageClientImpl::canAccessStorage(LocalFrame* frame, |
StorageType type) const { |
- WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); |
- return !webFrame->contentSettingsClient() || |
- webFrame->contentSettingsClient()->allowStorage(type == LocalStorage); |
+ return !frame->contentSettingsClient() || |
dcheng
2017/04/02 05:26:19
The caller seems to check that frame is attached,
kinuko
2017/04/03 15:15:06
Done.
|
+ frame->contentSettingsClient()->allowStorage( |
+ static_cast<ContentSettingsClient::StorageType>(type)); |
} |
} // namespace blink |