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

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

Issue 7438001: Cleanup: Make quota dispatcher code independent from WebKit types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 5 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 2846 matching lines...) Expand 10 before | Expand all | Expand 10 after
2857 WebStorageQuotaType type, 2857 WebStorageQuotaType type,
2858 WebStorageQuotaCallbacks* callbacks) { 2858 WebStorageQuotaCallbacks* callbacks) {
2859 DCHECK(frame); 2859 DCHECK(frame);
2860 WebSecurityOrigin origin = frame->document().securityOrigin(); 2860 WebSecurityOrigin origin = frame->document().securityOrigin();
2861 if (origin.isEmpty()) { 2861 if (origin.isEmpty()) {
2862 // Uninitialized document? 2862 // Uninitialized document?
2863 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); 2863 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
2864 return; 2864 return;
2865 } 2865 }
2866 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( 2866 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
2867 GURL(origin.toString()), type, callbacks); 2867 GURL(origin.toString()),
2868 static_cast<quota::StorageType>(type),
2869 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
2868 } 2870 }
2869 2871
2870 void RenderView::requestStorageQuota( 2872 void RenderView::requestStorageQuota(
2871 WebFrame* frame, 2873 WebFrame* frame,
2872 WebStorageQuotaType type, 2874 WebStorageQuotaType type,
2873 unsigned long long requested_size, 2875 unsigned long long requested_size,
2874 WebStorageQuotaCallbacks* callbacks) { 2876 WebStorageQuotaCallbacks* callbacks) {
2875 DCHECK(frame); 2877 DCHECK(frame);
2876 WebSecurityOrigin origin = frame->document().securityOrigin(); 2878 WebSecurityOrigin origin = frame->document().securityOrigin();
2877 if (origin.isEmpty()) { 2879 if (origin.isEmpty()) {
2878 // Uninitialized document? 2880 // Uninitialized document?
2879 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort); 2881 callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
2880 return; 2882 return;
2881 } 2883 }
2882 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( 2884 ChildThread::current()->quota_dispatcher()->RequestStorageQuota(
2883 routing_id(), GURL(origin.toString()), type, requested_size, callbacks); 2885 routing_id(), GURL(origin.toString()),
2886 static_cast<quota::StorageType>(type), requested_size,
2887 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
2884 } 2888 }
2885 2889
2886 // webkit_glue::WebPluginPageDelegate ----------------------------------------- 2890 // webkit_glue::WebPluginPageDelegate -----------------------------------------
2887 2891
2888 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( 2892 webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate(
2889 const FilePath& file_path, 2893 const FilePath& file_path,
2890 const std::string& mime_type) { 2894 const std::string& mime_type) {
2891 if (!PluginChannelHost::IsListening()) 2895 if (!PluginChannelHost::IsListening())
2892 return NULL; 2896 return NULL;
2893 2897
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
4306 } 4310 }
4307 #endif 4311 #endif
4308 4312
4309 void RenderView::OnContextMenuClosed( 4313 void RenderView::OnContextMenuClosed(
4310 const webkit_glue::CustomContextMenuContext& custom_context) { 4314 const webkit_glue::CustomContextMenuContext& custom_context) {
4311 if (custom_context.is_pepper_menu) 4315 if (custom_context.is_pepper_menu)
4312 pepper_delegate_.OnContextMenuClosed(custom_context); 4316 pepper_delegate_.OnContextMenuClosed(custom_context);
4313 else 4317 else
4314 context_menu_node_.reset(); 4318 context_menu_node_.reset();
4315 } 4319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698