Changeset 77742 in webkit
- Timestamp:
- Feb 5, 2011 3:52:15 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77741 r77742 1 2011-02-05 Jochen Eisinger <jochen@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Add ContentSecurityPolicy object to Document and pass the X-WebKit-CSP header from the MainResourceLoader. 6 https://bugs.webkit.org/show_bug.cgi?id=53685 7 8 * WebCore.xcodeproj/project.pbxproj: 9 * dom/Document.h: 10 (WebCore::Document::contentSecurityPolicy): 11 * loader/MainResourceLoader.cpp: 12 (WebCore::MainResourceLoader::didReceiveResponse): 13 * page/ContentSecurityPolicy.cpp: 14 (WebCore::ContentSecurityPolicy::didReceiveHeader): 15 * page/ContentSecurityPolicy.h: 16 1 17 2011-02-05 Eric Seidel <eric@webkit.org> 2 18 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r77578 r77742 3117 3117 97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; }; 3118 3118 97C471DB12F925BD0086354B /* ContentSecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */; }; 3119 97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */; };3119 97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3120 3120 97DCE20110807C750057D394 /* HistoryController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DCE1FF10807C750057D394 /* HistoryController.cpp */; }; 3121 3121 97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; }; -
trunk/Source/WebCore/dom/Document.h
r77333 r77742 33 33 #include "Color.h" 34 34 #include "ContainerNode.h" 35 #include "ContentSecurityPolicy.h" 35 36 #include "DOMTimeStamp.h" 36 37 #include "DocumentOrderedMap.h" … … 1090 1091 void initDNSPrefetch(); 1091 1092 1093 ContentSecurityPolicy* contentSecurityPolicy() { return &m_contentSecurityPolicy; } 1094 1092 1095 protected: 1093 1096 Document(Frame*, const KURL& url, bool isXHTML, bool isHTML, const KURL& baseURL = KURL()); … … 1391 1394 int m_nextRequestAnimationFrameCallbackId; 1392 1395 #endif 1396 1397 ContentSecurityPolicy m_contentSecurityPolicy; 1393 1398 }; 1394 1399 -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r75129 r77742 32 32 33 33 #include "ApplicationCacheHost.h" 34 #include "ContentSecurityPolicy.h" 35 #include "Document.h" 34 36 #include "DocumentLoadTiming.h" 35 37 #include "DocumentLoader.h" … … 357 359 } 358 360 361 it = r.httpHeaderFields().find(AtomicString("x-webkit-csp")); 362 if (it != r.httpHeaderFields().end()) { 363 String content = it->second; 364 m_frame->document()->contentSecurityPolicy()->didReceiveHeader(content); 365 } 366 359 367 // There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred. 360 368 // See <rdar://problem/6304600> for more details. -
trunk/Source/WebCore/page/ContentSecurityPolicy.cpp
r77411 r77742 33 33 } 34 34 35 void ContentSecurityPolicy::didReceiveHeader(const String& header) 36 { 37 m_header = header; 35 38 } 39 40 } -
trunk/Source/WebCore/page/ContentSecurityPolicy.h
r77411 r77742 35 35 public: 36 36 ContentSecurityPolicy(); 37 38 void didReceiveHeader(const String&); 39 40 private: 41 String m_header; 37 42 }; 38 43
Note: See TracChangeset
for help on using the changeset viewer.