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

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

Issue 639023004: Oilpan: move HistoryItem to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/web/WebHistoryItem.cpp ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 loadJavaScriptURL(resourceRequest.url()); 842 loadJavaScriptURL(resourceRequest.url());
843 return; 843 return;
844 } 844 }
845 845
846 frame()->loader().load(FrameLoadRequest(0, resourceRequest)); 846 frame()->loader().load(FrameLoadRequest(0, resourceRequest));
847 } 847 }
848 848
849 void WebLocalFrameImpl::loadHistoryItem(const WebHistoryItem& item, WebHistoryLo adType loadType, WebURLRequest::CachePolicy cachePolicy) 849 void WebLocalFrameImpl::loadHistoryItem(const WebHistoryItem& item, WebHistoryLo adType loadType, WebURLRequest::CachePolicy cachePolicy)
850 { 850 {
851 ASSERT(frame()); 851 ASSERT(frame());
852 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); 852 RefPtrWillBeRawPtr<HistoryItem> historyItem = PassRefPtrWillBeRawPtr<History Item>(item);
853 ASSERT(historyItem); 853 ASSERT(historyItem);
854 frame()->loader().loadHistoryItem(historyItem.get(), FrameLoadTypeBackForwar d, 854 frame()->loader().loadHistoryItem(historyItem.get(), FrameLoadTypeBackForwar d,
855 static_cast<HistoryLoadType>(loadType), static_cast<ResourceRequestCache Policy>(cachePolicy)); 855 static_cast<HistoryLoadType>(loadType), static_cast<ResourceRequestCache Policy>(cachePolicy));
856 } 856 }
857 857
858 void WebLocalFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachable URL, bool replace) 858 void WebLocalFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachable URL, bool replace)
859 { 859 {
860 ASSERT(frame()); 860 ASSERT(frame());
861 861
862 // If we are loading substitute data to replace an existing load, then 862 // If we are loading substitute data to replace an existing load, then
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 // element might not have the attribute, and there might be other attributes 1582 // element might not have the attribute, and there might be other attributes
1583 // which can identify the element. 1583 // which can identify the element.
1584 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(own erElement->subResourceAttributeName())); 1584 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, request.frameName(), ownerElement->getAttribute(own erElement->subResourceAttributeName()));
1585 // Initializing the core frame may cause the new child to be detached, since 1585 // Initializing the core frame may cause the new child to be detached, since
1586 // it may dispatch a load event in the parent. 1586 // it may dispatch a load event in the parent.
1587 if (!child->tree().parent()) 1587 if (!child->tree().parent())
1588 return nullptr; 1588 return nullptr;
1589 1589
1590 // If we're moving in the back/forward list, we might want to replace the co ntent 1590 // If we're moving in the back/forward list, we might want to replace the co ntent
1591 // of this child frame with whatever was there at that point. 1591 // of this child frame with whatever was there at that point.
1592 RefPtr<HistoryItem> childItem; 1592 RefPtrWillBeRawPtr<HistoryItem> childItem = nullptr;
1593 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished()) 1593 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished())
1594 childItem = PassRefPtr<HistoryItem>(webframeChild->client()->historyItem ForNewChildFrame(webframeChild)); 1594 childItem = PassRefPtrWillBeRawPtr<HistoryItem>(webframeChild->client()- >historyItemForNewChildFrame(webframeChild));
1595 1595
1596 if (childItem) 1596 if (childItem)
1597 child->loader().loadHistoryItem(childItem.get(), FrameLoadTypeInitialHis toryLoad); 1597 child->loader().loadHistoryItem(childItem.get(), FrameLoadTypeInitialHis toryLoad);
1598 else 1598 else
1599 child->loader().load(FrameLoadRequest(request.originDocument(), request. resourceRequest(), "_self")); 1599 child->loader().load(FrameLoadRequest(request.originDocument(), request. resourceRequest(), "_self"));
1600 1600
1601 // Note a synchronous navigation (about:blank) would have already processed 1601 // Note a synchronous navigation (about:blank) would have already processed
1602 // onload, so it is possible for the child frame to have already been 1602 // onload, so it is possible for the child frame to have already been
1603 // detached by script in the page. 1603 // detached by script in the page.
1604 if (!child->tree().parent()) 1604 if (!child->tree().parent())
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 1929
1930 void WebLocalFrameImpl::invalidateAll() const 1930 void WebLocalFrameImpl::invalidateAll() const
1931 { 1931 {
1932 ASSERT(frame() && frame()->view()); 1932 ASSERT(frame() && frame()->view());
1933 FrameView* view = frame()->view(); 1933 FrameView* view = frame()->view();
1934 view->invalidateRect(view->frameRect()); 1934 view->invalidateRect(view->frameRect());
1935 invalidateScrollbar(); 1935 invalidateScrollbar();
1936 } 1936 }
1937 1937
1938 } // namespace blink 1938 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebHistoryItem.cpp ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698