| 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 21 matching lines...) Expand all Loading... |
| 32 #include "content/common/file_system/file_system_dispatcher.h" | 32 #include "content/common/file_system/file_system_dispatcher.h" |
| 33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
| 34 #include "content/common/json_value_serializer.h" | 34 #include "content/common/json_value_serializer.h" |
| 35 #include "content/common/notification_service.h" | 35 #include "content/common/notification_service.h" |
| 36 #include "content/common/pepper_messages.h" | 36 #include "content/common/pepper_messages.h" |
| 37 #include "content/common/pepper_plugin_registry.h" | 37 #include "content/common/pepper_plugin_registry.h" |
| 38 #include "content/common/quota_dispatcher.h" | 38 #include "content/common/quota_dispatcher.h" |
| 39 #include "content/common/renderer_preferences.h" | 39 #include "content/common/renderer_preferences.h" |
| 40 #include "content/common/url_constants.h" | 40 #include "content/common/url_constants.h" |
| 41 #include "content/common/view_messages.h" | 41 #include "content/common/view_messages.h" |
| 42 #include "content/common/web_quota_dispatcher_callback.h" |
| 42 #include "content/renderer/content_renderer_client.h" | 43 #include "content/renderer/content_renderer_client.h" |
| 43 #include "content/renderer/device_orientation_dispatcher.h" | 44 #include "content/renderer/device_orientation_dispatcher.h" |
| 44 #include "content/renderer/external_popup_menu.h" | 45 #include "content/renderer/external_popup_menu.h" |
| 45 #include "content/renderer/geolocation_dispatcher.h" | 46 #include "content/renderer/geolocation_dispatcher.h" |
| 46 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 47 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 47 #include "content/renderer/load_progress_tracker.h" | 48 #include "content/renderer/load_progress_tracker.h" |
| 48 #include "content/renderer/media/audio_message_filter.h" | 49 #include "content/renderer/media/audio_message_filter.h" |
| 49 #include "content/renderer/media/audio_renderer_impl.h" | 50 #include "content/renderer/media/audio_renderer_impl.h" |
| 50 #include "content/renderer/navigation_state.h" | 51 #include "content/renderer/navigation_state.h" |
| 51 #include "content/renderer/notification_provider.h" | 52 #include "content/renderer/notification_provider.h" |
| (...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2850 WebStorageQuotaType type, | 2851 WebStorageQuotaType type, |
| 2851 WebStorageQuotaCallbacks* callbacks) { | 2852 WebStorageQuotaCallbacks* callbacks) { |
| 2852 DCHECK(frame); | 2853 DCHECK(frame); |
| 2853 WebSecurityOrigin origin = frame->document().securityOrigin(); | 2854 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 2854 if (origin.isEmpty()) { | 2855 if (origin.isEmpty()) { |
| 2855 // Uninitialized document? | 2856 // Uninitialized document? |
| 2856 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 2857 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
| 2857 return; | 2858 return; |
| 2858 } | 2859 } |
| 2859 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( | 2860 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( |
| 2860 GURL(origin.toString()), type, callbacks); | 2861 GURL(origin.toString()), |
| 2862 static_cast<quota::StorageType>(type), |
| 2863 new WebQuotaDispatcherCallback(callbacks)); |
| 2861 } | 2864 } |
| 2862 | 2865 |
| 2863 void RenderView::requestStorageQuota( | 2866 void RenderView::requestStorageQuota( |
| 2864 WebFrame* frame, | 2867 WebFrame* frame, |
| 2865 WebStorageQuotaType type, | 2868 WebStorageQuotaType type, |
| 2866 unsigned long long requested_size, | 2869 unsigned long long requested_size, |
| 2867 WebStorageQuotaCallbacks* callbacks) { | 2870 WebStorageQuotaCallbacks* callbacks) { |
| 2868 DCHECK(frame); | 2871 DCHECK(frame); |
| 2869 WebSecurityOrigin origin = frame->document().securityOrigin(); | 2872 WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 2870 if (origin.isEmpty()) { | 2873 if (origin.isEmpty()) { |
| 2871 // Uninitialized document? | 2874 // Uninitialized document? |
| 2872 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); | 2875 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); |
| 2873 return; | 2876 return; |
| 2874 } | 2877 } |
| 2875 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( | 2878 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( |
| 2876 routing_id(), GURL(origin.toString()), type, requested_size, callbacks); | 2879 routing_id(), GURL(origin.toString()), |
| 2880 static_cast<quota::StorageType>(type), requested_size, |
| 2881 new WebQuotaDispatcherCallback(callbacks)); |
| 2877 } | 2882 } |
| 2878 | 2883 |
| 2879 // webkit_glue::WebPluginPageDelegate ----------------------------------------- | 2884 // webkit_glue::WebPluginPageDelegate ----------------------------------------- |
| 2880 | 2885 |
| 2881 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( | 2886 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( |
| 2882 const FilePath& file_path, | 2887 const FilePath& file_path, |
| 2883 const std::string& mime_type) { | 2888 const std::string& mime_type) { |
| 2884 if (!PluginChannelHost::IsListening()) | 2889 if (!PluginChannelHost::IsListening()) |
| 2885 return NULL; | 2890 return NULL; |
| 2886 | 2891 |
| (...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4299 } | 4304 } |
| 4300 #endif | 4305 #endif |
| 4301 | 4306 |
| 4302 void RenderView::OnContextMenuClosed( | 4307 void RenderView::OnContextMenuClosed( |
| 4303 const webkit_glue::CustomContextMenuContext& custom_context) { | 4308 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4304 if (custom_context.is_pepper_menu) | 4309 if (custom_context.is_pepper_menu) |
| 4305 pepper_delegate_.OnContextMenuClosed(custom_context); | 4310 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4306 else | 4311 else |
| 4307 context_menu_node_.reset(); | 4312 context_menu_node_.reset(); |
| 4308 } | 4313 } |
| OLD | NEW |