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

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

Issue 1338001: Block database access on allowDatabase instead of databaseOpenFile. (Closed)
Patch Set: without worker support Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 for (size_t i = 0; i < arraysize(kDirProtocols); ++i) { 2841 for (size_t i = 0; i < arraysize(kDirProtocols); ++i) {
2842 if (EqualsASCII(origin.protocol(), kDirProtocols[i])) { 2842 if (EqualsASCII(origin.protocol(), kDirProtocols[i])) {
2843 return frame_url.SchemeIs(kDirProtocols[i]) && 2843 return frame_url.SchemeIs(kDirProtocols[i]) &&
2844 frame_url.ExtractFileName().empty(); 2844 frame_url.ExtractFileName().empty();
2845 } 2845 }
2846 } 2846 }
2847 2847
2848 return false; // Other protocols fall through here. 2848 return false; // Other protocols fall through here.
2849 } 2849 }
2850 2850
2851 bool RenderView::allowDatabase(
2852 WebFrame* frame, const WebString& name, const WebString& display_name,
2853 unsigned long estimated_size) {
2854 WebSecurityOrigin origin = frame->securityOrigin();
2855 if (origin.isEmpty())
2856 return false; // Uninitialized document?
2857
2858 bool result;
2859 if (!Send(new ViewHostMsg_AllowDatabase(routing_id_,
2860 origin.toString().utf8(), name, display_name, estimated_size, &result)))
2861 return false;
2862 if (!result)
2863 DidBlockContentType(CONTENT_SETTINGS_TYPE_COOKIES);
2864 return result;
2865 }
2851 void RenderView::didNotAllowScript(WebKit::WebFrame* frame) { 2866 void RenderView::didNotAllowScript(WebKit::WebFrame* frame) {
2852 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT); 2867 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
2853 } 2868 }
2854 2869
2855 void RenderView::didNotAllowPlugins(WebKit::WebFrame* frame) { 2870 void RenderView::didNotAllowPlugins(WebKit::WebFrame* frame) {
2856 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); 2871 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS);
2857 } 2872 }
2858 2873
2859 void RenderView::didExhaustMemoryAvailableForScript(WebFrame* frame) { 2874 void RenderView::didExhaustMemoryAvailableForScript(WebFrame* frame) {
2860 Send(new ViewHostMsg_JSOutOfMemory(routing_id_)); 2875 Send(new ViewHostMsg_JSOutOfMemory(routing_id_));
(...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4813 gfx::PluginWindowHandle window) { 4828 gfx::PluginWindowHandle window) {
4814 Send(new ViewHostMsg_AcceleratedSurfaceBuffersSwapped(routing_id(), window)); 4829 Send(new ViewHostMsg_AcceleratedSurfaceBuffersSwapped(routing_id(), window));
4815 } 4830 }
4816 #endif 4831 #endif
4817 4832
4818 WebKit::WebGeolocationServiceInterface* RenderView::getGeolocationService() { 4833 WebKit::WebGeolocationServiceInterface* RenderView::getGeolocationService() {
4819 if (!geolocation_dispatcher_.get()) 4834 if (!geolocation_dispatcher_.get())
4820 geolocation_dispatcher_.reset(new GeolocationDispatcher(this)); 4835 geolocation_dispatcher_.reset(new GeolocationDispatcher(this));
4821 return geolocation_dispatcher_.get(); 4836 return geolocation_dispatcher_.get();
4822 } 4837 }
OLDNEW
« chrome/common/render_messages_internal.h ('K') | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698