diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 16:58:15 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 16:58:15 +0000 |
commit | c0a45a986a192fd4ba11196db2606e48e875c269 (patch) | |
tree | d0d98ac4016978832352fe38270cb78bc7a4592a /chrome/renderer/content_settings_observer.cc | |
parent | e9f0a008ef46515a08095ac639222b496c7624cb (diff) | |
download | chromium_src-c0a45a986a192fd4ba11196db2606e48e875c269.zip chromium_src-c0a45a986a192fd4ba11196db2606e48e875c269.tar.gz chromium_src-c0a45a986a192fd4ba11196db2606e48e875c269.tar.bz2 |
Pass frame and toplevel frame security origin for all site data related content settings IPCs
BUG=81179
TEST=none
Review URL: http://codereview.chromium.org/7068013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/content_settings_observer.cc')
-rw-r--r-- | chrome/renderer/content_settings_observer.cc | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index 7ca1452..698a3c2 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; |