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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 7068013: Pass frame and toplevel frame security origin for all site data related content settings IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 7ca14525b2986bbd844058d77d5d6c072264ba7e..698a3c2c32aa5c157ba094ee7fbd34908ca77299 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -144,24 +144,27 @@ bool ContentSettingsObserver::AllowDatabase(WebFrame* frame,
const WebString& name,
const WebString& display_name,
unsigned long estimated_size) {
- WebSecurityOrigin origin = frame->securityOrigin();
- if (origin.isEmpty())
- return false; // Uninitialized document?
+ if (frame->securityOrigin().isEmpty() ||
+ frame->top()->securityOrigin().isEmpty())
+ return false; // Uninitialized document.
bool result = false;
Send(new ViewHostMsg_AllowDatabase(
- routing_id(), GURL(origin.toString()), name, display_name, &result));
+ routing_id(), GURL(frame->securityOrigin().toString()),
+ GURL(frame->top()->securityOrigin().toString()),
+ name, display_name, &result));
return result;
}
bool ContentSettingsObserver::AllowFileSystem(WebFrame* frame) {
- WebSecurityOrigin origin = frame->securityOrigin();
- if (origin.isEmpty())
- return false; // Uninitialized document?
+ if (frame->securityOrigin().isEmpty() ||
+ frame->top()->securityOrigin().isEmpty())
+ return false; // Uninitialized document.
bool result = false;
Send(new ViewHostMsg_AllowFileSystem(
- routing_id(), GURL(origin.toString()), &result));
+ routing_id(), GURL(frame->securityOrigin().toString()),
+ GURL(frame->top()->securityOrigin().toString()), &result));
return result;
}
@@ -182,9 +185,15 @@ bool ContentSettingsObserver::AllowImages(WebFrame* frame,
bool ContentSettingsObserver::AllowIndexedDB(WebFrame* frame,
const WebString& name,
const WebSecurityOrigin& origin) {
+ if (frame->securityOrigin().isEmpty() ||
+ frame->top()->securityOrigin().isEmpty())
+ return false; // Uninitialized document.
+
bool result = false;
Send(new ViewHostMsg_AllowIndexedDB(
- routing_id(), origin.databaseIdentifier(), name, &result));
+ routing_id(), GURL(frame->securityOrigin().toString()),
+ GURL(frame->top()->securityOrigin().toString()),
+ name, &result));
return result;
}
@@ -207,9 +216,14 @@ bool ContentSettingsObserver::AllowScript(WebFrame* frame,
}
bool ContentSettingsObserver::AllowStorage(WebFrame* frame, bool local) {
+ if (frame->securityOrigin().isEmpty() ||
+ frame->top()->securityOrigin().isEmpty())
+ return false; // Uninitialized document.
bool result = false;
+
Send(new ViewHostMsg_AllowDOMStorage(
- routing_id(), frame->url(),
+ routing_id(), GURL(frame->securityOrigin().toString()),
+ GURL(frame->top()->securityOrigin().toString()),
local ? DOM_STORAGE_LOCAL : DOM_STORAGE_SESSION,
&result));
return result;
« no previous file with comments | « chrome/common/render_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698