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

Unified Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 14323004: Make Frame's ScriptController an OwnPtr and remove the #include (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/PageGroup.cpp ('k') | Source/core/xml/XMLTreeViewer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index fcb37f7b614719836525e953aea371fe7cf7d0b1..7ac3d25f622e78d82bc500de0708943fcbcb96b6 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -46,6 +46,7 @@
#include "ResourceError.h"
#include "ResourceRequest.h"
#include "ScriptCallStack.h"
+#include "ScriptController.h"
#include "ScriptProfile.h"
#include "SecurityOrigin.h"
#include "Settings.h"
@@ -481,7 +482,8 @@ void XMLHttpRequest::open(const String& method, const KURL& url, bool async, Exc
bool shouldBypassMainWorldContentSecurityPolicy = false;
if (scriptExecutionContext()->isDocument()) {
Document* document = static_cast<Document*>(scriptExecutionContext());
- shouldBypassMainWorldContentSecurityPolicy = document->frame()->script()->shouldBypassMainWorldContentSecurityPolicy();
+ if (document->frame())
+ shouldBypassMainWorldContentSecurityPolicy = document->frame()->script()->shouldBypassMainWorldContentSecurityPolicy();
}
if (!shouldBypassMainWorldContentSecurityPolicy && !scriptExecutionContext()->contentSecurityPolicy()->allowConnectToSource(url)) {
// FIXME: Should this be throwing an exception?
« no previous file with comments | « Source/core/page/PageGroup.cpp ('k') | Source/core/xml/XMLTreeViewer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698