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.h" | 5 #include "content/renderer/render_view.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 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2889 WebStorageQuotaType type, | 2889 WebStorageQuotaType type, |
2890 WebStorageQuotaCallbacks* callbacks) { | 2890 WebStorageQuotaCallbacks* callbacks) { |
2891 DCHECK(frame); | 2891 DCHECK(frame); |
2892 WebSecurityOrigin origin = frame->document().securityOrigin(); | 2892 WebSecurityOrigin origin = frame->document().securityOrigin(); |
2893 if (origin.isEmpty()) { | 2893 if (origin.isEmpty()) { |
2894 // Uninitialized document? | 2894 // Uninitialized document? |
2895 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 2895 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
2896 return; | 2896 return; |
2897 } | 2897 } |
2898 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( | 2898 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( |
2899 GURL(origin.toString()), type, callbacks); | 2899 GURL(origin.toString()), |
| 2900 static_cast<quota::StorageType>(type), |
| 2901 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
2900 } | 2902 } |
2901 | 2903 |
2902 void RenderView::requestStorageQuota( | 2904 void RenderView::requestStorageQuota( |
2903 WebFrame* frame, | 2905 WebFrame* frame, |
2904 WebStorageQuotaType type, | 2906 WebStorageQuotaType type, |
2905 unsigned long long requested_size, | 2907 unsigned long long requested_size, |
2906 WebStorageQuotaCallbacks* callbacks) { | 2908 WebStorageQuotaCallbacks* callbacks) { |
2907 DCHECK(frame); | 2909 DCHECK(frame); |
2908 WebSecurityOrigin origin = frame->document().securityOrigin(); | 2910 WebSecurityOrigin origin = frame->document().securityOrigin(); |
2909 if (origin.isEmpty()) { | 2911 if (origin.isEmpty()) { |
2910 // Uninitialized document? | 2912 // Uninitialized document? |
2911 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 2913 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
2912 return; | 2914 return; |
2913 } | 2915 } |
2914 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( | 2916 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( |
2915 routing_id(), GURL(origin.toString()), type, requested_size, callbacks); | 2917 routing_id(), GURL(origin.toString()), |
| 2918 static_cast<quota::StorageType>(type), requested_size, |
| 2919 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
2916 } | 2920 } |
2917 | 2921 |
2918 // WebKit::WebPageSerializerClient implementation ------------------------------ | 2922 // WebKit::WebPageSerializerClient implementation ------------------------------ |
2919 | 2923 |
2920 void RenderView::didSerializeDataForFrame( | 2924 void RenderView::didSerializeDataForFrame( |
2921 const WebURL& frame_url, | 2925 const WebURL& frame_url, |
2922 const WebCString& data, | 2926 const WebCString& data, |
2923 WebPageSerializerClient::PageSerializationStatus status) { | 2927 WebPageSerializerClient::PageSerializationStatus status) { |
2924 Send(new ViewHostMsg_SendSerializedHtmlData( | 2928 Send(new ViewHostMsg_SendSerializedHtmlData( |
2925 routing_id(), | 2929 routing_id(), |
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4405 } | 4409 } |
4406 #endif | 4410 #endif |
4407 | 4411 |
4408 void RenderView::OnContextMenuClosed( | 4412 void RenderView::OnContextMenuClosed( |
4409 const webkit_glue::CustomContextMenuContext& custom_context) { | 4413 const webkit_glue::CustomContextMenuContext& custom_context) { |
4410 if (custom_context.is_pepper_menu) | 4414 if (custom_context.is_pepper_menu) |
4411 pepper_delegate_.OnContextMenuClosed(custom_context); | 4415 pepper_delegate_.OnContextMenuClosed(custom_context); |
4412 else | 4416 else |
4413 context_menu_node_.reset(); | 4417 context_menu_node_.reset(); |
4414 } | 4418 } |
OLD | NEW |