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

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: Made the setter method private 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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 { 869 {
870 ASSERT(frame()); 870 ASSERT(frame());
871 871
872 // If we are loading substitute data to replace an existing load, then 872 // If we are loading substitute data to replace an existing load, then
873 // inherit all of the properties of that original request. This way, 873 // inherit all of the properties of that original request. This way,
874 // reload will re-attempt the original request. It is essential that 874 // reload will re-attempt the original request. It is essential that
875 // we only do this when there is an unreachableURL since a non-empty 875 // we only do this when there is an unreachableURL since a non-empty
876 // unreachableURL informs FrameLoader::reload to load unreachableURL 876 // unreachableURL informs FrameLoader::reload to load unreachableURL
877 // instead of the currently loaded URL. 877 // instead of the currently loaded URL.
878 ResourceRequest request; 878 ResourceRequest request;
879 if (replace && !unreachableURL.isEmpty() && frame()->loader().provisionalDoc umentLoader()) 879 if (replace && !unreachableURL.isEmpty() && frame()->loader().provisionalDoc umentLoader()) {
880 request = frame()->loader().provisionalDocumentLoader()->originalRequest (); 880 request = frame()->loader().provisionalDocumentLoader()->originalRequest ();
881 request.setURL(baseURL); 881 request.setURL(baseURL);
882 } else {
883 request = ResourceRequest::createMainResourceRequest(baseURL, !this->par ent());
884 }
882 885
883 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex tEncoding, unreachableURL)); 886 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex tEncoding, unreachableURL));
884 ASSERT(frameRequest.substituteData().isValid()); 887 ASSERT(frameRequest.substituteData().isValid());
885 frameRequest.setLockBackForwardList(replace); 888 frameRequest.setLockBackForwardList(replace);
886 frame()->loader().load(frameRequest); 889 frame()->loader().load(frameRequest);
887 } 890 }
888 891
889 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR L, const WebURL& unreachableURL, bool replace) 892 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR L, const WebURL& unreachableURL, bool replace)
890 { 893 {
891 ASSERT(frame()); 894 ASSERT(frame());
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 { 1909 {
1907 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner); 1910 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner);
1908 setWebCoreFrame(frame); 1911 setWebCoreFrame(frame);
1909 frame->tree().setName(name, fallbackName); 1912 frame->tree().setName(name, fallbackName);
1910 // May dispatch JS events; frame may be detached after this. 1913 // May dispatch JS events; frame may be detached after this.
1911 frame->init(); 1914 frame->init();
1912 return frame; 1915 return frame;
1913 } 1916 }
1914 1917
1915 } // namespace blink 1918 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698