Changeset 35377 in webkit
- Timestamp:
- Jul 26, 2008 8:49:29 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r35376 r35377 1 2008-07-26 Daniel Jalkut <jalkut@red-sweater.com> 2 3 Reviewed by Geoff Garen. 4 5 Revised the FrameLoader class to clean up a variety of load methods, and hopefully 6 move things closer to integrating into a smaller set of load methods. To this 7 end, I renamed many of the overloaded load() methods to have more meaningful and 8 easier to search names. I added comments to the header file to provide clues as 9 to how many of the load methods are being used, and how they fit into the loading 10 process. I suspect that the renamed methods and comments indicating their present 11 usage will facilitate easier cleanup by myself and others as inspiration strikes. 12 13 Updated clients of FrameLoader where necessary to adapt to the new method names and signatures. 14 15 Combined the 3 canLoad() methods into a single canLoad which expresses the 16 intended logic of the 3 with a single method interface. 17 18 Removed unnecessary "treatAsLocal" attribute of CachedResource. It was only called from 19 one place in FrameLoader.cpp, and it derived at initialization time by calling back to FrameLoader. 20 21 Removed unused userGesture parameter to one variant of the urlSelected method, and 22 moved one of the urlSelected methods so that it lives nearer to its overloaded 23 sibling. 24 25 * WebCore.base.exp: 26 * loader/Cache.cpp: 27 (WebCore::Cache::requestResource): 28 * loader/CachedResource.cpp: 29 (WebCore::CachedResource::CachedResource): 30 * loader/CachedResource.h: 31 (WebCore::CachedResource::errorOccurred): 32 * loader/FrameLoader.cpp: 33 (WebCore::FrameLoader::createWindow): 34 (WebCore::FrameLoader::urlSelected): 35 (WebCore::FrameLoader::loadURLIntoChildFrame): 36 (WebCore::FrameLoader::loadPlugin): 37 (WebCore::FrameLoader::loadFrameRequestWithFormState): 38 (WebCore::FrameLoader::loadFrameRequestWithFormAndValues): 39 (WebCore::FrameLoader::loadURL): 40 (WebCore::FrameLoader::loadWithNavigationAction): 41 (WebCore::FrameLoader::load): 42 (WebCore::FrameLoader::loadWithDocumentLoader): 43 (WebCore::FrameLoader::canLoad): 44 (WebCore::FrameLoader::reloadAllowingStaleData): 45 (WebCore::FrameLoader::reload): 46 (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): 47 (WebCore::FrameLoader::submitForm): 48 (WebCore::FrameLoader::loadPostRequest): 49 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): 50 (WebCore::FrameLoader::loadItem): 51 * loader/FrameLoader.h: 52 * loader/SubresourceLoader.cpp: 53 (WebCore::SubresourceLoader::create): 54 * page/ContextMenuController.cpp: 55 (WebCore::ContextMenuController::contextMenuItemSelected): 56 1 57 2008-07-26 Sam Weinig <sam@webkit.org> 2 58 -
trunk/WebCore/WebCore.base.exp
r35363 r35377 162 162 __ZN7WebCore11FrameLoader26saveDocumentAndScrollStateEv 163 163 __ZN7WebCore11FrameLoader36saveScrollPositionAndViewStateToItemEPNS_11HistoryItemE 164 __ZN7WebCore11FrameLoader33loadFrameRequestWithFormAndValuesERKNS_16FrameLoadRequestEbPNS_5EventEPNS_15HTMLFormElementERKN3WTF7HashMapINS_6StringESA_NS_10StringHashENS8_10HashTraitsISA_EESD_EE 164 165 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE 165 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE166 166 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestE 167 167 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_14SubstituteDataE 168 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_16NavigationActionENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE169 168 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_6StringE 170 __ZN7WebCore11FrameLoader4loadERKNS_4KURLEPNS_5EventE171 __ZN7WebCore11FrameLoader4loadERKNS_4KURLERKNS_6StringENS_13FrameLoadTypeES6_PNS_5EventEN3WTF10PassRefPtrINS_9FormStateEEE172 169 __ZN7WebCore11FrameLoader5clearEbb 173 170 __ZN7WebCore11FrameLoader6reloadEv 174 171 __ZN7WebCore11FrameLoader7addDataEPKci 175 __ZN7WebCore11FrameLoader7canLoadERKNS_4KURLE PKNS_8DocumentE172 __ZN7WebCore11FrameLoader7canLoadERKNS_4KURLERKNS_6StringEPKNS_8DocumentE 176 173 __ZN7WebCore11HistoryItem12addChildItemEN3WTF10PassRefPtrIS0_EE 177 174 __ZN7WebCore11HistoryItem12setURLStringERKNS_6StringE -
trunk/WebCore/loader/Cache.cpp
r35128 r35377 102 102 if (isPreload && !resource->isPreloaded()) 103 103 return 0; 104 if (FrameLoader::restrictAccessToLocal() && !FrameLoader::canLoad( *resource, docLoader->doc())) {104 if (FrameLoader::restrictAccessToLocal() && !FrameLoader::canLoad(url, String(), docLoader->doc())) { 105 105 Document* doc = docLoader->doc(); 106 106 if(doc && !isPreload) … … 109 109 } 110 110 } else { 111 if (FrameLoader::restrictAccessToLocal() && !FrameLoader::canLoad(url, docLoader->doc())) {111 if (FrameLoader::restrictAccessToLocal() && !FrameLoader::canLoad(url, String(), docLoader->doc())) { 112 112 Document* doc = docLoader->doc(); 113 113 if(doc && !isPreload) -
trunk/WebCore/loader/CachedResource.cpp
r32812 r35377 67 67 #endif 68 68 m_errorOccurred = false; 69 m_shouldTreatAsLocal = FrameLoader::shouldTreatURLAsLocal(m_url);70 69 } 71 70 -
trunk/WebCore/loader/CachedResource.h
r31834 r35377 144 144 145 145 bool errorOccurred() const { return m_errorOccurred; } 146 bool treatAsLocal() const { return m_shouldTreatAsLocal; }147 146 bool sendResourceLoadCallbacks() const { return m_sendResourceLoadCallbacks; } 148 147 … … 203 202 CachedResource* m_prevInLiveResourcesList; 204 203 205 bool m_shouldTreatAsLocal;206 207 204 DocLoader* m_docLoader; // only non-0 for resources that are not in the cache 208 205 }; -
trunk/WebCore/loader/FrameLoader.cpp
r35317 r35377 320 320 if (frame && shouldAllowNavigation(frame)) { 321 321 if (!request.resourceRequest().url().isEmpty()) 322 frame->loader()->load (request, false, true, 0, 0, HashMap<String, String>());322 frame->loader()->loadFrameRequestWithFormAndValues(request, false, 0, 0, HashMap<String, String>()); 323 323 if (Page* page = frame->page()) 324 324 page->chrome()->focus(); … … 382 382 } 383 383 384 384 385 void FrameLoader::changeLocation(const KURL& url, const String& referrer, bool lockHistory, bool userGesture) 385 386 { … … 394 395 } 395 396 397 void FrameLoader::urlSelected(const FrameLoadRequest& request, Event* event, bool lockHistory) 398 { 399 FrameLoadRequest copy = request; 400 if (copy.resourceRequest().httpReferrer().isEmpty()) 401 copy.resourceRequest().setHTTPReferrer(m_outgoingReferrer); 402 403 loadFrameRequestWithFormAndValues(copy, lockHistory, event, 0, HashMap<String, String>()); 404 } 405 396 406 void FrameLoader::urlSelected(const ResourceRequest& request, const String& _target, Event* triggeringEvent, bool lockHistory, bool userGesture) 397 407 { … … 405 415 FrameLoadRequest frameRequest(request, target); 406 416 407 if (frameRequest.resourceRequest().httpReferrer().isEmpty()) 408 frameRequest.resourceRequest().setHTTPReferrer(m_outgoingReferrer); 409 410 urlSelected(frameRequest, triggeringEvent, lockHistory, userGesture); 417 urlSelected(frameRequest, triggeringEvent, lockHistory); 411 418 } 412 419 … … 1559 1566 childFrame->loader()->loadArchive(subframeArchive.release()); 1560 1567 else 1561 childFrame->loader()->load (workingURL, referer, childLoadType, String(), 0, 0);1568 childFrame->loader()->loadURL(workingURL, referer, String(), childLoadType, 0, 0); 1562 1569 } 1563 1570 … … 1723 1730 pluginElement = static_cast<Element*>(renderer->node()); 1724 1731 1725 if (!canLoad(url, frame()->document())) {1732 if (!canLoad(url, String(), frame()->document())) { 1726 1733 FrameLoader::reportLocalLoadFailed(m_frame, url.string()); 1727 1734 return false; … … 2042 2049 } 2043 2050 2044 void FrameLoader::load(const KURL& url, Event* event) 2045 { 2046 load(ResourceRequest(url), false, true, event, 0, HashMap<String, String>()); 2047 } 2048 2049 void FrameLoader::load(const FrameLoadRequest& request, bool lockHistory, bool userGesture, Event* event, 2050 HTMLFormElement* submitForm, const HashMap<String, String>& formValues) 2051 { 2051 void FrameLoader::loadFrameRequestWithFormState(const FrameLoadRequest& request, bool lockHistory, Event* event, PassRefPtr<FormState> prpFormState) 2052 { 2053 RefPtr<FormState> formState = prpFormState; 2052 2054 KURL url = request.resourceRequest().url(); 2053 2055 … … 2061 2063 ASSERT(frame()->document()); 2062 2064 if (url.protocolIs("file")) { 2063 if (!canLoad(url, frame()->document()) && !canLoad(url, referrer)) {2065 if (!canLoad(url, String(), frame()->document()) && !canLoad(url, referrer)) { 2064 2066 FrameLoader::reportLocalLoadFailed(m_frame, url.string()); 2065 2067 return; … … 2071 2073 2072 2074 Frame* targetFrame = findFrameForNavigation(request.frameName()); 2073 2075 2074 2076 if (request.resourceRequest().httpMethod() != "POST") { 2075 2077 FrameLoadType loadType; … … 2081 2083 loadType = FrameLoadTypeStandard; 2082 2084 2083 RefPtr<FormState> formState; 2084 if (submitForm && !formValues.isEmpty()) 2085 formState = FormState::create(submitForm, formValues, m_frame); 2086 2087 load(request.resourceRequest().url(), referrer, loadType, 2088 request.frameName(), event, formState.release()); 2085 loadURL(request.resourceRequest().url(), referrer, request.frameName(), loadType, 2086 event, formState.release()); 2089 2087 } else 2090 post(request.resourceRequest().url(), referrer, request.frameName(), 2091 request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), event, submitForm, formValues); 2088 loadPostRequest(request.resourceRequest(), referrer, request.frameName(), event, formState.release()); 2092 2089 2093 2090 if (targetFrame && targetFrame != m_frame) … … 2095 2092 page->chrome()->focus(); 2096 2093 } 2097 2098 void FrameLoader::load(const KURL& newURL, const String& referrer, FrameLoadType newLoadType, 2099 const String& frameName, Event* event, PassRefPtr<FormState> formState) 2100 { 2094 2095 void FrameLoader::loadFrameRequestWithFormAndValues(const FrameLoadRequest& request, bool lockHistory, Event* event, 2096 HTMLFormElement* submitForm, const HashMap<String, String>& formValues) 2097 { 2098 RefPtr<FormState> formState; 2099 if (submitForm && !formValues.isEmpty()) 2100 formState = FormState::create(submitForm, formValues, m_frame); 2101 2102 loadFrameRequestWithFormState(request, lockHistory, event, formState.release()); 2103 } 2104 2105 void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const String& frameName, FrameLoadType newLoadType, 2106 Event* event, PassRefPtr<FormState> prpFormState) 2107 { 2108 RefPtr<FormState> formState = prpFormState; 2101 2109 bool isFormSubmission = formState; 2102 2110 … … 2114 2122 if (!frameName.isEmpty()) { 2115 2123 if (Frame* targetFrame = findFrameForNavigation(frameName)) 2116 targetFrame->loader()->load (newURL, referrer, newLoadType, String(), event, formState);2124 targetFrame->loader()->loadURL(newURL, referrer, String(), newLoadType, event, formState); 2117 2125 else 2118 2126 checkNewWindowPolicy(action, request, formState, frameName); … … 2135 2143 // must grab this now, since this load may stop the previous load and clear this flag 2136 2144 bool isRedirect = m_quickRedirectComing; 2137 load (request, action, newLoadType, formState);2145 loadWithNavigationAction(request, action, newLoadType, formState); 2138 2146 if (isRedirect) { 2139 2147 m_quickRedirectComing = false; … … 2179 2187 } 2180 2188 2181 void FrameLoader::load (const ResourceRequest& request, const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState)2189 void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState) 2182 2190 { 2183 2191 RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, SubstituteData()); … … 2187 2195 loader->setOverrideEncoding(m_documentLoader->overrideEncoding()); 2188 2196 2189 load (loader.get(), type, formState);2197 loadWithDocumentLoader(loader.get(), type, formState); 2190 2198 } 2191 2199 … … 2206 2214 2207 2215 // When we loading alternate content for an unreachable URL that we're 2208 // visiting in the b/f list, we treat it as a reload so the b/flist2216 // visiting in the history list, we treat it as a reload so the history list 2209 2217 // is appropriately maintained. 2218 // 2219 // FIXME: This seems like a dangerous overloading of the meaning of "FrameLoadTypeReload" ... 2220 // shouldn't a more explicit type of reload be defined, that means roughly 2221 // "load without affecting history" ? 2210 2222 if (shouldReloadToHandleUnreachableURL(newDocumentLoader)) { 2211 2223 ASSERT(type == FrameLoadTypeStandard); … … 2213 2225 } 2214 2226 2215 load (newDocumentLoader, type, 0);2216 } 2217 2218 void FrameLoader::load (DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> formState)2227 loadWithDocumentLoader(newDocumentLoader, type, nil); 2228 } 2229 2230 void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState) 2219 2231 { 2220 2232 ASSERT(m_client->hasWebView()); … … 2226 2238 2227 2239 m_policyLoadType = type; 2228 2240 RefPtr<FormState> formState = prpFormState; 2229 2241 bool isFormSubmission = formState; 2242 2230 2243 const KURL& newURL = loader->request().url(); 2231 2244 … … 2250 2263 } 2251 2264 2252 // FIXME: It would be nice if we could collapse these into one or two functions. 2253 bool FrameLoader::canLoad(const KURL& url, const String& referrer) 2254 { 2265 bool FrameLoader::canLoad(const KURL& url, const String& referrer, const Document* doc) 2266 { 2267 // We can always load any URL that isn't considered local (e.g. http URLs) 2255 2268 if (!shouldTreatURLAsLocal(url.string())) 2256 2269 return true; 2257 2270 2258 return shouldTreatURLAsLocal(referrer); 2259 } 2260 2261 bool FrameLoader::canLoad(const KURL& url, const Document* doc) 2262 { 2263 if (!shouldTreatURLAsLocal(url.string())) 2264 return true; 2265 2266 return doc && doc->securityOrigin()->canLoadLocalResources(); 2267 } 2268 2269 bool FrameLoader::canLoad(const CachedResource& resource, const Document* doc) 2270 { 2271 if (!resource.treatAsLocal()) 2272 return true; 2273 2274 return doc && doc->securityOrigin()->canLoadLocalResources(); 2271 // If we were provided a document, we let its local file policy dictate the result, 2272 // otherwise we allow local loads only if the supplied referrer is also local. 2273 if (doc) 2274 return doc->securityOrigin()->canLoadLocalResources(); 2275 else if (!referrer.isEmpty()) 2276 return shouldTreatURLAsLocal(referrer); 2277 else 2278 return false; 2275 2279 } 2276 2280 … … 2397 2401 loader->setOverrideEncoding(encoding); 2398 2402 2399 load (loader.get(), FrameLoadTypeReloadAllowingStaleData, 0);2403 loadWithDocumentLoader(loader.get(), FrameLoadTypeReloadAllowingStaleData, 0); 2400 2404 } 2401 2405 … … 2417 2421 initialRequest = ResourceRequest(unreachableURL); 2418 2422 2423 // Create a new document loader for the reload, this will become m_documentLoader eventually, 2424 // but first it has to be the "policy" document loader, and then the "provisional" document loader. 2419 2425 RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(initialRequest, SubstituteData()); 2420 2426 … … 2430 2436 loader->setOverrideEncoding(m_documentLoader->overrideEncoding()); 2431 2437 2432 load (loader.get(), FrameLoadTypeReload, 0);2438 loadWithDocumentLoader(loader.get(), FrameLoadTypeReload, 0); 2433 2439 } 2434 2440 … … 3139 3145 return; 3140 3146 3147 // DocumentLoader calls back to our prepareForLoadStart 3141 3148 m_provisionalDocumentLoader->prepareForLoadStart(); 3142 3149 … … 3264 3271 3265 3272 // FIXME: We should probably call userGestureHint() to tell whether this form submission was the result of a user gesture. 3266 load (request, false, true, event, m_formAboutToBeSubmitted.get(), m_formValuesAboutToBeSubmitted);3273 loadFrameRequestWithFormAndValues(request, false, event, m_formAboutToBeSubmitted.get(), m_formValuesAboutToBeSubmitted); 3267 3274 3268 3275 clearRecordedFormValues(); 3269 3276 } 3270 3277 3271 void FrameLoader::urlSelected(const FrameLoadRequest& request, Event* event, bool lockHistory, bool userGesture)3272 {3273 FrameLoadRequest copy = request;3274 if (copy.resourceRequest().httpReferrer().isEmpty())3275 copy.resourceRequest().setHTTPReferrer(m_outgoingReferrer);3276 3277 load(copy, lockHistory, userGesture, event, 0, HashMap<String, String>());3278 }3279 3280 3278 String FrameLoader::userAgent(const KURL& url) const 3281 3279 { … … 3365 3363 } 3366 3364 3367 void FrameLoader::post(const KURL& url, const String& referrer, const String& frameName, PassRefPtr<FormData> formData, 3368 const String& contentType, Event* event, HTMLFormElement* form, const HashMap<String, String>& formValues) 3369 { 3365 void FrameLoader::loadPostRequest(const ResourceRequest& inRequest, const String& referrer, const String& frameName, 3366 Event* event, PassRefPtr<FormState> prpFormState) 3367 { 3368 RefPtr<FormState> formState = prpFormState; 3369 3370 3370 // When posting, use the NSURLRequestReloadIgnoringCacheData load flag. 3371 3371 // This prevents a potential bug which may cause a page with a form that uses itself … … 3374 3374 // FIXME: Where's the code that implements what the comment above says? 3375 3375 3376 ResourceRequest request(url); 3377 addExtraFieldsToRequest(request, true, true); 3376 // Previously when this method was reached, the original FrameLoadRequest had been deconstructed to build a 3377 // bunch of parameters that would come in here and then be built back up to a ResourceRequest. In case 3378 // any caller depends on the immutability of the original ResourceRequest, I'm rebuilding a ResourceRequest 3379 // from scratch as it did all along. 3380 const KURL& url = inRequest.url(); 3381 RefPtr<FormData> formData = inRequest.httpBody(); 3382 const String& contentType = inRequest.httpContentType(); 3383 3384 ResourceRequest workingResourceRequest(url); 3385 addExtraFieldsToRequest(workingResourceRequest, true, true); 3378 3386 3379 3387 if (!referrer.isEmpty()) 3380 request.setHTTPReferrer(referrer);3381 request.setHTTPMethod("POST");3382 request.setHTTPBody(formData);3383 request.setHTTPContentType(contentType);3388 workingResourceRequest.setHTTPReferrer(referrer); 3389 workingResourceRequest.setHTTPMethod("POST"); 3390 workingResourceRequest.setHTTPBody(formData); 3391 workingResourceRequest.setHTTPContentType(contentType); 3384 3392 3385 3393 NavigationAction action(url, FrameLoadTypeStandard, true, event); 3386 3387 RefPtr<FormState> formState;3388 if (form && !formValues.isEmpty())3389 formState = FormState::create(form, formValues, m_frame);3390 3394 3391 3395 if (!frameName.isEmpty()) { 3392 3396 if (Frame* targetFrame = findFrameForNavigation(frameName)) 3393 targetFrame->loader()->load (request, action, FrameLoadTypeStandard, formState.release());3397 targetFrame->loader()->loadWithNavigationAction(workingResourceRequest, action, FrameLoadTypeStandard, formState.release()); 3394 3398 else 3395 checkNewWindowPolicy(action, request, formState.release(), frameName);3399 checkNewWindowPolicy(action, workingResourceRequest, formState.release(), frameName); 3396 3400 } else 3397 load (request, action, FrameLoadTypeStandard, formState.release());3401 loadWithNavigationAction(workingResourceRequest, action, FrameLoadTypeStandard, formState.release()); 3398 3402 } 3399 3403 … … 3816 3820 mainFrame->loader()->m_client->dispatchShow(); 3817 3821 mainFrame->loader()->setOpener(frame.get()); 3818 mainFrame->loader()->load (request, NavigationAction(), FrameLoadTypeStandard, formState);3822 mainFrame->loader()->loadWithNavigationAction(request, NavigationAction(), FrameLoadTypeStandard, formState); 3819 3823 } 3820 3824 … … 4225 4229 // Or we should remove WebKitBackForwardCacheExpirationIntervalKey. 4226 4230 if (interval <= 1800) { 4227 load (cachedPage->documentLoader(), loadType, 0);4231 loadWithDocumentLoader(cachedPage->documentLoader(), loadType, 0); 4228 4232 inPageCache = true; 4229 4233 } else { … … 4288 4292 } 4289 4293 4290 load (request, action, loadType, 0);4294 loadWithNavigationAction(request, action, loadType, 0); 4291 4295 } 4292 4296 } -
trunk/WebCore/loader/FrameLoader.h
r35151 r35377 139 139 Frame* frame() const { return m_frame; } 140 140 141 // FIXME: This is not cool, people. 141 // FIXME: This is not cool, people. We should aim to consolidate these variety of loading related methods into a smaller set, 142 // and try to reuse more of the same logic by extracting common code paths. 142 143 void prepareForLoadStart(); 143 144 void setupForReplace(); 144 145 void setupForReplaceByMIMEType(const String& newMIMEType); 145 void load(const KURL&, Event*); 146 void load(const FrameLoadRequest&, bool lockHistory, bool userGesture, 146 147 void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); // Calls continueLoadAfterNavigationPolicy 148 void load(DocumentLoader*); // Calls loadWithDocumentLoader 149 150 void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader() 151 FrameLoadType, PassRefPtr<FormState>); 152 153 void loadPostRequest(const ResourceRequest& inRequest, const String& referrer, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction 154 const String& frameName, Event* event, PassRefPtr<FormState> prpFormState); 155 156 void loadURL(const KURL& newURL, const String& referrer, const String& frameName, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction or else dispatches to navigation policy delegate 157 FrameLoadType, Event* event, PassRefPtr<FormState> prpFormState); 158 void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*); 159 160 void loadFrameRequestWithFormState(const FrameLoadRequest&, bool lockHistory, Event*, PassRefPtr<FormState>); 161 void loadFrameRequestWithFormAndValues(const FrameLoadRequest&, bool lockHistory, // Called by submitForm, calls loadPostRequest() 147 162 Event*, HTMLFormElement*, const HashMap<String, String>& formValues); 148 void load(const KURL&, const String& referrer, FrameLoadType, const String& target, 149 Event*, PassRefPtr<FormState>); 150 void post(const KURL&, const String& referrer, const String& target, 151 PassRefPtr<FormData>, const String& contentType, 152 Event*, HTMLFormElement*, const HashMap<String, String>& formValues); 153 154 void load(const ResourceRequest&); 155 void load(const ResourceRequest&, const SubstituteData&); 156 void load(const ResourceRequest&, const String& frameName); 157 void load(const ResourceRequest&, const NavigationAction&, FrameLoadType, PassRefPtr<FormState>); 158 159 void load(DocumentLoader*); 160 void load(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); 161 162 void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*); 163 164 void load(const ResourceRequest&); // Called by WebFrame, calls (ResourceRequest, SubstituteData) 165 void load(const ResourceRequest&, const SubstituteData&); // Called both by WebFrame and internally, calls (DocumentLoader*) 166 void load(const ResourceRequest&, const String& frameName); // Called by WebPluginController 167 163 168 void loadArchive(PassRefPtr<Archive> archive); 164 169 165 static bool canLoad(const KURL&, const String& referrer);166 static bool canLoad(const KURL&, const Document*);167 static bool canLoad(const CachedResource&, const Document*);170 // Returns true for any non-local URL. If Document parameter is supplied, its local load policy dictates, 171 // otherwise if referrer is non-empty and represents a local file, then the local load is allowed. 172 static bool canLoad(const KURL&, const String& referrer, const Document* theDocument = nil); 168 173 static void reportLocalLoadFailed(Frame*, const String& url); 169 174 170 175 static bool shouldHideReferrer(const KURL& url, const String& referrer); 171 176 177 // Called by createWindow in JSDOMWindowBase.cpp, e.g. to fulfill a modal dialog creation 172 178 Frame* createWindow(FrameLoader* frameLoaderForFrameLookup, const FrameLoadRequest&, const WindowFeatures&, bool& created); 173 179 … … 280 286 void changeLocation(const KURL&, const String& referrer, bool lockHistory = true, bool userGesture = false); 281 287 void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory, bool userGesture); 282 void urlSelected(const FrameLoadRequest&, Event*, bool lockHistory , bool userGesture);288 void urlSelected(const FrameLoadRequest&, Event*, bool lockHistory); 283 289 284 290 bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName); … … 569 575 FrameLoadType m_loadType; 570 576 577 // Document loaders for the three phases of frame loading. Note that while 578 // a new request is being loaded, the old document loader may still be referenced. 579 // E.g. while a new request is in the "policy" state, the old document loader may 580 // be consulted in particular as it makes sense to imply certain settings on the new loader. 571 581 RefPtr<DocumentLoader> m_documentLoader; 572 582 RefPtr<DocumentLoader> m_provisionalDocumentLoader; 573 583 RefPtr<DocumentLoader> m_policyDocumentLoader; 574 584 585 // This identifies the type of navigation action which prompted this load. Note 586 // that WebKit conveys this value as the WebActionNavigationTypeKey value 587 // on navigation action delegate callbacks. 575 588 FrameLoadType m_policyLoadType; 576 589 PolicyCheck m_policyCheck; -
trunk/WebCore/loader/SubresourceLoader.cpp
r35148 r35377 85 85 if (!skipCanLoadCheck 86 86 && FrameLoader::restrictAccessToLocal() 87 && !FrameLoader::canLoad(request.url(), frame->document())) {87 && !FrameLoader::canLoad(request.url(), String(), frame->document())) { 88 88 FrameLoader::reportLocalLoadFailed(frame, request.url().string()); 89 89 return 0; -
trunk/WebCore/page/ContextMenuController.cpp
r34935 r35377 217 217 case ContextMenuItemTagOpenLink: 218 218 if (Frame* targetFrame = result.targetFrame()) 219 targetFrame->loader()->load (FrameLoadRequest(ResourceRequest(result.absoluteLinkURL(),220 frame->loader()->outgoingReferrer())), false, true,0, 0, HashMap<String, String>());219 targetFrame->loader()->loadFrameRequestWithFormAndValues(FrameLoadRequest(ResourceRequest(result.absoluteLinkURL(), 220 frame->loader()->outgoingReferrer())), false, 0, 0, HashMap<String, String>()); 221 221 else 222 222 openNewWindow(result.absoluteLinkURL(), frame); -
trunk/WebKit/mac/ChangeLog
r35278 r35377 1 2008-07-26 Daniel Jalkut <jalkut@red-sweater.com> 2 3 Reviewed by Geoff Garen. 4 5 Changes to accommodate newly named/signatured loading methods in WebCore. 6 7 * Plugins/WebNetscapePluginStream.mm: 8 (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): 9 * Plugins/WebPluginContainerCheck.mm: 10 (-[WebPluginContainerCheck _isForbiddenFileLoad]): 11 * WebView/WebPDFView.mm: 12 (-[WebPDFView PDFViewWillClickOnLink:withURL:]): 13 1 14 2008-07-21 Mark Rowe <mrowe@apple.com> 2 15 -
trunk/WebKit/mac/Plugins/WebNetscapePluginStream.mm
r31014 r35377 73 73 WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)thePlugin->ndata; 74 74 75 if (!core([view webFrame])->loader()->canLoad([theRequest URL], core([view webFrame])->document()))75 if (!core([view webFrame])->loader()->canLoad([theRequest URL], String(), core([view webFrame])->document())) 76 76 return nil; 77 77 -
trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm
r34956 r35377 95 95 Frame* coreFrame = core([_controller webFrame]); 96 96 ASSERT(coreFrame); 97 if (!coreFrame->loader()->canLoad([_request URL], coreFrame->document())) {97 if (!coreFrame->loader()->canLoad([_request URL], String(), coreFrame->document())) { 98 98 [self _continueWithPolicy:PolicyIgnore]; 99 99 return YES; -
trunk/WebKit/mac/WebView/WebPDFView.mm
r34956 r35377 50 50 #import <WebCore/Frame.h> 51 51 #import <WebCore/FrameLoader.h> 52 #import <WebCore/FrameLoadRequest.h> 52 53 #import <WebCore/KURL.h> 53 54 #import <WebCore/KeyboardEvent.h> … … 951 952 952 953 // Call to the frame loader because this is where our security checks are made. 953 core([dataSource webFrame])->loader()->load (URL, event.get());954 core([dataSource webFrame])->loader()->loadFrameRequestWithFormAndValues(ResourceRequest(URL), false, event.get(), 0, HashMap<String, String>()); 954 955 } 955 956 -
trunk/WebKit/win/ChangeLog
r35349 r35377 1 2008-07-26 Matt Lilek <webkit@mattlilek.com> 2 3 Reviewed by Geoff Garen. 4 5 Changes to accommodate newly named/signatured loading methods in WebCore. 6 7 * WebCoreSupport/WebContextMenuClient.cpp: 8 (WebContextMenuClient::searchWithGoogle): 9 * WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebFrameLoaderClient::loadURLIntoChild): 11 1 12 2008-07-25 Adam Roben <aroben@apple.com> 2 13 -
trunk/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
r32704 r35377 161 161 ResourceRequest request = ResourceRequest(url); 162 162 if (Page* page = frame->page()) 163 page->mainFrame()->loader()->urlSelected(FrameLoadRequest(request), 0, false , true);163 page->mainFrame()->loader()->urlSelected(FrameLoadRequest(request), 0, false); 164 164 } 165 165 -
trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r34544 r35377 612 612 613 613 // FIXME: Handle loading WebArchives here 614 615 core(childFrame)->loader()->load (url, referrer, childLoadType, String(), 0, 0);614 String frameName = core(childFrame)->tree()->name(); 615 core(childFrame)->loader()->loadURL(url, referrer, frameName, childLoadType, 0, 0); 616 616 } 617 617
Note: See TracChangeset
for help on using the changeset viewer.