Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: content/renderer/render_view.cc

Issue 6811022: Add IPC plumbing code for Quota API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/renderer/visitedlink_slave.h" 49 #include "chrome/renderer/visitedlink_slave.h"
50 #include "content/common/appcache/appcache_dispatcher.h" 50 #include "content/common/appcache/appcache_dispatcher.h"
51 #include "content/common/clipboard_messages.h" 51 #include "content/common/clipboard_messages.h"
52 #include "content/common/content_constants.h" 52 #include "content/common/content_constants.h"
53 #include "content/common/database_messages.h" 53 #include "content/common/database_messages.h"
54 #include "content/common/drag_messages.h" 54 #include "content/common/drag_messages.h"
55 #include "content/common/file_system/file_system_dispatcher.h" 55 #include "content/common/file_system/file_system_dispatcher.h"
56 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" 56 #include "content/common/file_system/webfilesystem_callback_dispatcher.h"
57 #include "content/common/notification_service.h" 57 #include "content/common/notification_service.h"
58 #include "content/common/pepper_messages.h" 58 #include "content/common/pepper_messages.h"
59 #include "content/common/quota_dispatcher.h"
59 #include "content/common/renderer_preferences.h" 60 #include "content/common/renderer_preferences.h"
60 #include "content/common/view_messages.h" 61 #include "content/common/view_messages.h"
61 #include "content/renderer/audio_message_filter.h" 62 #include "content/renderer/audio_message_filter.h"
62 #include "content/renderer/content_renderer_client.h" 63 #include "content/renderer/content_renderer_client.h"
63 #include "content/renderer/device_orientation_dispatcher.h" 64 #include "content/renderer/device_orientation_dispatcher.h"
64 #include "content/renderer/external_popup_menu.h" 65 #include "content/renderer/external_popup_menu.h"
65 #include "content/renderer/geolocation_dispatcher.h" 66 #include "content/renderer/geolocation_dispatcher.h"
66 #include "content/renderer/load_progress_tracker.h" 67 #include "content/renderer/load_progress_tracker.h"
67 #include "content/renderer/media/audio_renderer_impl.h" 68 #include "content/renderer/media/audio_renderer_impl.h"
68 #include "content/renderer/media/ipc_video_decoder.h" 69 #include "content/renderer/media/ipc_video_decoder.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h"
121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h"
122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h"
125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h "
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h"
129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h"
134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" 136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" 138 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h"
137 #include "third_party/skia/include/core/SkBitmap.h" 139 #include "third_party/skia/include/core/SkBitmap.h"
138 #include "ui/base/message_box_flags.h" 140 #include "ui/base/message_box_flags.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 using WebKit::WebPopupMenuInfo; 231 using WebKit::WebPopupMenuInfo;
230 using WebKit::WebRange; 232 using WebKit::WebRange;
231 using WebKit::WebRect; 233 using WebKit::WebRect;
232 using WebKit::WebScriptSource; 234 using WebKit::WebScriptSource;
233 using WebKit::WebSearchableFormData; 235 using WebKit::WebSearchableFormData;
234 using WebKit::WebSecurityOrigin; 236 using WebKit::WebSecurityOrigin;
235 using WebKit::WebSettings; 237 using WebKit::WebSettings;
236 using WebKit::WebSharedWorker; 238 using WebKit::WebSharedWorker;
237 using WebKit::WebSize; 239 using WebKit::WebSize;
238 using WebKit::WebStorageNamespace; 240 using WebKit::WebStorageNamespace;
241 using WebKit::WebStorageQuotaCallbacks;
242 using WebKit::WebStorageQuotaError;
243 using WebKit::WebStorageQuotaType;
239 using WebKit::WebString; 244 using WebKit::WebString;
240 using WebKit::WebTextAffinity; 245 using WebKit::WebTextAffinity;
241 using WebKit::WebTextDirection; 246 using WebKit::WebTextDirection;
242 using WebKit::WebURL; 247 using WebKit::WebURL;
243 using WebKit::WebURLError; 248 using WebKit::WebURLError;
244 using WebKit::WebURLRequest; 249 using WebKit::WebURLRequest;
245 using WebKit::WebURLResponse; 250 using WebKit::WebURLResponse;
246 using WebKit::WebVector; 251 using WebKit::WebVector;
247 using WebKit::WebView; 252 using WebKit::WebView;
248 using WebKit::WebWidget; 253 using WebKit::WebWidget;
(...skipping 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after
3496 // Uninitialized document? 3501 // Uninitialized document?
3497 callbacks->didFail(WebKit::WebFileErrorAbort); 3502 callbacks->didFail(WebKit::WebFileErrorAbort);
3498 return; 3503 return;
3499 } 3504 }
3500 3505
3501 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( 3506 ChildThread::current()->file_system_dispatcher()->OpenFileSystem(
3502 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), 3507 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type),
3503 size, create, new WebFileSystemCallbackDispatcher(callbacks)); 3508 size, create, new WebFileSystemCallbackDispatcher(callbacks));
3504 } 3509 }
3505 3510
3511 void RenderView::queryStorageUsageAndQuota(
3512 WebFrame* frame,
3513 WebStorageQuotaType type,
3514 WebStorageQuotaCallbacks* callbacks) {
3515 DCHECK(frame);
3516 WebSecurityOrigin origin = frame->securityOrigin();
3517 if (origin.isEmpty()) {
3518 // Uninitialized document?
3519 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
3520 return;
3521 }
3522 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
3523 GURL(origin.toString()), type, callbacks);
3524 }
3525
3526 void RenderView::requestStorageQuota(
3527 WebFrame* frame,
3528 WebStorageQuotaType type,
3529 unsigned long long requested_size,
3530 WebStorageQuotaCallbacks* callbacks) {
3531 DCHECK(frame);
3532 WebSecurityOrigin origin = frame->securityOrigin();
3533 if (origin.isEmpty()) {
3534 // Uninitialized document?
3535 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
3536 return;
3537 }
3538 ChildThread::current()->quota_dispatcher()->RequestStorageQuota(
3539 GURL(origin.toString()), type, requested_size, callbacks);
3540 }
3541
3506 // webkit_glue::WebPluginPageDelegate ----------------------------------------- 3542 // webkit_glue::WebPluginPageDelegate -----------------------------------------
3507 3543
3508 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( 3544 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate(
3509 const FilePath& file_path, 3545 const FilePath& file_path,
3510 const std::string& mime_type) { 3546 const std::string& mime_type) {
3511 if (!PluginChannelHost::IsListening()) 3547 if (!PluginChannelHost::IsListening())
3512 return NULL; 3548 return NULL;
3513 3549
3514 bool in_process_plugin = RenderProcess::current()->UseInProcessPlugins(); 3550 bool in_process_plugin = RenderProcess::current()->UseInProcessPlugins();
3515 if (in_process_plugin) { 3551 if (in_process_plugin) {
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
5042 const webkit_glue::CustomContextMenuContext& custom_context) { 5078 const webkit_glue::CustomContextMenuContext& custom_context) {
5043 if (custom_context.is_pepper_menu) 5079 if (custom_context.is_pepper_menu)
5044 pepper_delegate_.OnContextMenuClosed(custom_context); 5080 pepper_delegate_.OnContextMenuClosed(custom_context);
5045 else 5081 else
5046 context_menu_node_.reset(); 5082 context_menu_node_.reset();
5047 } 5083 }
5048 5084
5049 void RenderView::OnNetworkStateChanged(bool online) { 5085 void RenderView::OnNetworkStateChanged(bool online) {
5050 WebNetworkStateNotifier::setOnLine(online); 5086 WebNetworkStateNotifier::setOnLine(online);
5051 } 5087 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698