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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 // If we are loading substitute data to replace an existing load, then 921 // If we are loading substitute data to replace an existing load, then
922 // inherit all of the properties of that original request. This way, 922 // inherit all of the properties of that original request. This way,
923 // reload will re-attempt the original request. It is essential that 923 // reload will re-attempt the original request. It is essential that
924 // we only do this when there is an unreachableURL since a non-empty 924 // we only do this when there is an unreachableURL since a non-empty
925 // unreachableURL informs FrameLoader::reload to load unreachableURL 925 // unreachableURL informs FrameLoader::reload to load unreachableURL
926 // instead of the currently loaded URL. 926 // instead of the currently loaded URL.
927 ResourceRequest request; 927 ResourceRequest request;
928 if (replace && !unreachableURL.isEmpty() && frame()->loader().provisionalDoc umentLoader()) 928 if (replace && !unreachableURL.isEmpty() && frame()->loader().provisionalDoc umentLoader())
929 request = frame()->loader().provisionalDocumentLoader()->originalRequest (); 929 request = frame()->loader().provisionalDocumentLoader()->originalRequest ();
930 request.setURL(baseURL); 930 request.setURL(baseURL);
931 request.initializeForMainResource(!this->parent());
931 932
932 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex tEncoding, unreachableURL)); 933 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex tEncoding, unreachableURL));
933 ASSERT(frameRequest.substituteData().isValid()); 934 ASSERT(frameRequest.substituteData().isValid());
934 frameRequest.setLockBackForwardList(replace); 935 frameRequest.setLockBackForwardList(replace);
935 frame()->loader().load(frameRequest); 936 frame()->loader().load(frameRequest);
936 } 937 }
937 938
938 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR L, const WebURL& unreachableURL, bool replace) 939 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR L, const WebURL& unreachableURL, bool replace)
939 { 940 {
940 ASSERT(frame()); 941 ASSERT(frame());
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 { 1951 {
1951 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner); 1952 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner);
1952 setWebCoreFrame(frame); 1953 setWebCoreFrame(frame);
1953 frame->tree().setName(name, fallbackName); 1954 frame->tree().setName(name, fallbackName);
1954 // May dispatch JS events; frame may be detached after this. 1955 // May dispatch JS events; frame may be detached after this.
1955 frame->init(); 1956 frame->init();
1956 return frame; 1957 return frame;
1957 } 1958 }
1958 1959
1959 } // namespace blink 1960 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698