OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 | 2974 |
2975 void RenderViewImpl::openFileSystem( | 2975 void RenderViewImpl::openFileSystem( |
2976 WebFrame* frame, | 2976 WebFrame* frame, |
2977 WebFileSystem::Type type, | 2977 WebFileSystem::Type type, |
2978 long long size, | 2978 long long size, |
2979 bool create, | 2979 bool create, |
2980 WebFileSystemCallbacks* callbacks) { | 2980 WebFileSystemCallbacks* callbacks) { |
2981 DCHECK(callbacks); | 2981 DCHECK(callbacks); |
2982 | 2982 |
2983 WebSecurityOrigin origin = frame->document().securityOrigin(); | 2983 WebSecurityOrigin origin = frame->document().securityOrigin(); |
2984 if (origin.isEmpty()) { | 2984 if (origin.isUnique()) { |
2985 // Uninitialized document? | 2985 // Unique origins cannot store persistent state. |
2986 callbacks->didFail(WebKit::WebFileErrorAbort); | 2986 callbacks->didFail(WebKit::WebFileErrorAbort); |
2987 return; | 2987 return; |
2988 } | 2988 } |
2989 | 2989 |
2990 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( | 2990 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( |
2991 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), | 2991 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), |
2992 size, create, new WebFileSystemCallbackDispatcher(callbacks)); | 2992 size, create, new WebFileSystemCallbackDispatcher(callbacks)); |
2993 } | 2993 } |
2994 | 2994 |
2995 void RenderViewImpl::queryStorageUsageAndQuota( | 2995 void RenderViewImpl::queryStorageUsageAndQuota( |
2996 WebFrame* frame, | 2996 WebFrame* frame, |
2997 WebStorageQuotaType type, | 2997 WebStorageQuotaType type, |
2998 WebStorageQuotaCallbacks* callbacks) { | 2998 WebStorageQuotaCallbacks* callbacks) { |
2999 DCHECK(frame); | 2999 DCHECK(frame); |
3000 WebSecurityOrigin origin = frame->document().securityOrigin(); | 3000 WebSecurityOrigin origin = frame->document().securityOrigin(); |
3001 if (origin.isEmpty()) { | 3001 if (origin.isUnique()) { |
3002 // Uninitialized document? | 3002 // Unique origins cannot store persistent state. |
3003 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 3003 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
3004 return; | 3004 return; |
3005 } | 3005 } |
3006 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( | 3006 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( |
3007 GURL(origin.toString()), | 3007 GURL(origin.toString()), |
3008 static_cast<quota::StorageType>(type), | 3008 static_cast<quota::StorageType>(type), |
3009 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 3009 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
3010 } | 3010 } |
3011 | 3011 |
3012 void RenderViewImpl::requestStorageQuota( | 3012 void RenderViewImpl::requestStorageQuota( |
3013 WebFrame* frame, | 3013 WebFrame* frame, |
3014 WebStorageQuotaType type, | 3014 WebStorageQuotaType type, |
3015 unsigned long long requested_size, | 3015 unsigned long long requested_size, |
3016 WebStorageQuotaCallbacks* callbacks) { | 3016 WebStorageQuotaCallbacks* callbacks) { |
3017 DCHECK(frame); | 3017 DCHECK(frame); |
3018 WebSecurityOrigin origin = frame->document().securityOrigin(); | 3018 WebSecurityOrigin origin = frame->document().securityOrigin(); |
3019 if (origin.isEmpty()) { | 3019 if (origin.isUnique()) { |
3020 // Uninitialized document? | 3020 // Unique origins cannot store persistent state. |
3021 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 3021 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
3022 return; | 3022 return; |
3023 } | 3023 } |
3024 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( | 3024 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( |
3025 routing_id(), GURL(origin.toString()), | 3025 routing_id(), GURL(origin.toString()), |
3026 static_cast<quota::StorageType>(type), requested_size, | 3026 static_cast<quota::StorageType>(type), requested_size, |
3027 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 3027 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
3028 } | 3028 } |
3029 | 3029 |
3030 // WebKit::WebPageSerializerClient implementation ------------------------------ | 3030 // WebKit::WebPageSerializerClient implementation ------------------------------ |
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4733 return webview()->settings()->useThreadedCompositor(); | 4733 return webview()->settings()->useThreadedCompositor(); |
4734 } | 4734 } |
4735 | 4735 |
4736 void RenderViewImpl::OnJavaBridgeInit( | 4736 void RenderViewImpl::OnJavaBridgeInit( |
4737 const IPC::ChannelHandle& channel_handle) { | 4737 const IPC::ChannelHandle& channel_handle) { |
4738 DCHECK(!java_bridge_dispatcher_.get()); | 4738 DCHECK(!java_bridge_dispatcher_.get()); |
4739 #if defined(ENABLE_JAVA_BRIDGE) | 4739 #if defined(ENABLE_JAVA_BRIDGE) |
4740 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4740 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4741 #endif | 4741 #endif |
4742 } | 4742 } |
OLD | NEW |