Changeset 28343 in webkit
- Timestamp:
- Dec 3, 2007 2:36:03 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r28342 r28343 1 2007-12-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com> 2 3 Reviewed by Sam Weinig. 4 5 * Add FrameLoader::shouldTreatSchemeAsLocal which is similar to 6 shouldTreatURLAsLocal. 7 * Make use of FrameLoader::shouldTreatSchemeAsLocal in SecurityOrigin 8 and do not hardcode "file". This is needed for the WebKit/qt port to make 9 the Web Inspector work as it using the qrc protocol instead of file. 10 11 12 * loader/FrameLoader.cpp: 13 (WebCore::FrameLoader::shouldTreatSchemeAsLocal): 14 * loader/FrameLoader.h: 15 * platform/SecurityOrigin.cpp: 16 (WebCore::SecurityOrigin::isSecureTransitionTo): 17 1 18 2007-12-02 Holger Hans Peter Freyther <holger.freyther@trolltech.com> 2 19 -
trunk/WebCore/loader/FrameLoader.cpp
r28342 r28343 4634 4634 } 4635 4635 4636 bool FrameLoader::shouldTreatSchemeAsLocal(const String& scheme) 4637 { 4638 // This avoids an allocation of another String and the HashSet contains() 4639 // call for the file: and http: schemes. 4640 if (scheme.length() == 4) { 4641 const UChar* s = scheme.characters(); 4642 if (s[0] == 'h' && s[1] == 't' && s[2] == 't' && s[3] == 'p') 4643 return false; 4644 if (s[0] == 'f' && s[1] == 'i' && s[2] == 'l' && s[3] == 'e') 4645 return true; 4646 } 4647 4648 if (scheme.isEmpty()) 4649 return false; 4650 4651 return localSchemes().contains(scheme); 4652 } 4653 4636 4654 void FrameLoader::dispatchDidCommitLoad() 4637 4655 { -
trunk/WebCore/loader/FrameLoader.h
r28056 r28343 422 422 static bool restrictAccessToLocal(); 423 423 static void setRestrictAccessToLocal(bool); 424 static bool shouldTreatURLAsLocal(const String& url); 424 static bool shouldTreatURLAsLocal(const String&); 425 static bool shouldTreatSchemeAsLocal(const String&); 425 426 426 427 #if USE(LOW_BANDWIDTH_DISPLAY) -
trunk/WebCore/platform/SecurityOrigin.cpp
r27821 r28343 111 111 bool SecurityOrigin::canAccess(const SecurityOrigin& other) const 112 112 { 113 if ( m_protocol == "file")113 if (FrameLoader::shouldTreatSchemeAsLocal(m_protocol)) 114 114 return true; 115 115 … … 129 129 return true; 130 130 131 if ( m_protocol == "file")131 if (FrameLoader::shouldTreatSchemeAsLocal(m_protocol)) 132 132 return true; 133 133
Note: See TracChangeset
for help on using the changeset viewer.