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

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

Powered by Google App Engine
This is Rietveld 408576698