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

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: comments reflected 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
« no previous file with comments | « content/renderer/render_view.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h"
120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h"
121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h"
124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h "
129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h"
128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" 132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" 133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
132 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" 134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h"
133 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" 135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
134 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 136 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
135 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" 137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h"
136 #include "third_party/skia/include/core/SkBitmap.h" 138 #include "third_party/skia/include/core/SkBitmap.h"
137 #include "ui/base/message_box_flags.h" 139 #include "ui/base/message_box_flags.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 using WebKit::WebPopupMenuInfo; 230 using WebKit::WebPopupMenuInfo;
229 using WebKit::WebRange; 231 using WebKit::WebRange;
230 using WebKit::WebRect; 232 using WebKit::WebRect;
231 using WebKit::WebScriptSource; 233 using WebKit::WebScriptSource;
232 using WebKit::WebSearchableFormData; 234 using WebKit::WebSearchableFormData;
233 using WebKit::WebSecurityOrigin; 235 using WebKit::WebSecurityOrigin;
234 using WebKit::WebSettings; 236 using WebKit::WebSettings;
235 using WebKit::WebSharedWorker; 237 using WebKit::WebSharedWorker;
236 using WebKit::WebSize; 238 using WebKit::WebSize;
237 using WebKit::WebStorageNamespace; 239 using WebKit::WebStorageNamespace;
240 using WebKit::WebStorageQuotaCallbacks;
241 using WebKit::WebStorageQuotaError;
242 using WebKit::WebStorageQuotaType;
238 using WebKit::WebString; 243 using WebKit::WebString;
239 using WebKit::WebTextAffinity; 244 using WebKit::WebTextAffinity;
240 using WebKit::WebTextDirection; 245 using WebKit::WebTextDirection;
241 using WebKit::WebURL; 246 using WebKit::WebURL;
242 using WebKit::WebURLError; 247 using WebKit::WebURLError;
243 using WebKit::WebURLRequest; 248 using WebKit::WebURLRequest;
244 using WebKit::WebURLResponse; 249 using WebKit::WebURLResponse;
245 using WebKit::WebVector; 250 using WebKit::WebVector;
246 using WebKit::WebView; 251 using WebKit::WebView;
247 using WebKit::WebWidget; 252 using WebKit::WebWidget;
(...skipping 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3545 // Uninitialized document? 3550 // Uninitialized document?
3546 callbacks->didFail(WebKit::WebFileErrorAbort); 3551 callbacks->didFail(WebKit::WebFileErrorAbort);
3547 return; 3552 return;
3548 } 3553 }
3549 3554
3550 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( 3555 ChildThread::current()->file_system_dispatcher()->OpenFileSystem(
3551 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type), 3556 GURL(origin.toString()), static_cast<fileapi::FileSystemType>(type),
3552 size, create, new WebFileSystemCallbackDispatcher(callbacks)); 3557 size, create, new WebFileSystemCallbackDispatcher(callbacks));
3553 } 3558 }
3554 3559
3560 void RenderView::queryStorageUsageAndQuota(
3561 WebFrame* frame,
3562 WebStorageQuotaType type,
3563 WebStorageQuotaCallbacks* callbacks) {
3564 DCHECK(frame);
3565 WebSecurityOrigin origin = frame->securityOrigin();
3566 if (origin.isEmpty()) {
3567 // Uninitialized document?
3568 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
3569 return;
3570 }
3571 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
3572 GURL(origin.toString()), type, callbacks);
3573 }
3574
3575 void RenderView::requestStorageQuota(
3576 WebFrame* frame,
3577 WebStorageQuotaType type,
3578 unsigned long long requested_size,
3579 WebStorageQuotaCallbacks* callbacks) {
3580 DCHECK(frame);
3581 WebSecurityOrigin origin = frame->securityOrigin();
3582 if (origin.isEmpty()) {
3583 // Uninitialized document?
3584 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
3585 return;
3586 }
3587 ChildThread::current()->quota_dispatcher()->RequestStorageQuota(
3588 GURL(origin.toString()), type, requested_size, callbacks);
3589 }
3590
3555 // webkit_glue::WebPluginPageDelegate ----------------------------------------- 3591 // webkit_glue::WebPluginPageDelegate -----------------------------------------
3556 3592
3557 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( 3593 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate(
3558 const FilePath& file_path, 3594 const FilePath& file_path,
3559 const std::string& mime_type) { 3595 const std::string& mime_type) {
3560 if (!PluginChannelHost::IsListening()) 3596 if (!PluginChannelHost::IsListening())
3561 return NULL; 3597 return NULL;
3562 3598
3563 bool in_process_plugin = RenderProcess::current()->UseInProcessPlugins(); 3599 bool in_process_plugin = RenderProcess::current()->UseInProcessPlugins();
3564 if (in_process_plugin) { 3600 if (in_process_plugin) {
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
5104 const webkit_glue::CustomContextMenuContext& custom_context) { 5140 const webkit_glue::CustomContextMenuContext& custom_context) {
5105 if (custom_context.is_pepper_menu) 5141 if (custom_context.is_pepper_menu)
5106 pepper_delegate_.OnContextMenuClosed(custom_context); 5142 pepper_delegate_.OnContextMenuClosed(custom_context);
5107 else 5143 else
5108 context_menu_node_.reset(); 5144 context_menu_node_.reset();
5109 } 5145 }
5110 5146
5111 void RenderView::OnNetworkStateChanged(bool online) { 5147 void RenderView::OnNetworkStateChanged(bool online) {
5112 WebNetworkStateNotifier::setOnLine(online); 5148 WebNetworkStateNotifier::setOnLine(online);
5113 } 5149 }
OLDNEW
« no previous file with comments | « content/renderer/render_view.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698