mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision bc084a8b (#530369)
This commit is contained in:
@ -1589,9 +1589,11 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetFrameForRequest(
|
||||
content::ResourceRequestInfo::ForRequest(request);
|
||||
if (!info)
|
||||
return nullptr;
|
||||
// The value of |IsMainFrame| is unreliable when |IsDownload| returns true.
|
||||
return GetOrCreateFrame(info->GetRenderFrameID(), info->GetFrameTreeNodeId(),
|
||||
CefFrameHostImpl::kUnspecifiedFrameId,
|
||||
info->IsMainFrame(), base::string16(), GURL());
|
||||
info->IsMainFrame(), info->IsDownload(),
|
||||
base::string16(), GURL());
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) {
|
||||
@ -2744,7 +2746,7 @@ void CefBrowserHostImpl::DidFinishNavigation(
|
||||
CefRefPtr<CefFrame> frame =
|
||||
GetOrCreateFrame(frame_id, navigation_handle->GetFrameTreeNodeId(),
|
||||
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
|
||||
base::string16(), url);
|
||||
false, base::string16(), url);
|
||||
|
||||
if (error_code == net::OK) {
|
||||
// The navigation has been committed and there is no error.
|
||||
@ -2792,7 +2794,7 @@ void CefBrowserHostImpl::DidFailLoad(
|
||||
GetOrCreateFrame(render_frame_host->GetRoutingID(),
|
||||
render_frame_host->GetFrameTreeNodeId(),
|
||||
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
|
||||
base::string16(), validated_url);
|
||||
false, base::string16(), validated_url);
|
||||
OnLoadError(frame, validated_url, error_code);
|
||||
OnLoadEnd(frame, validated_url, error_code);
|
||||
}
|
||||
@ -2918,7 +2920,7 @@ void CefBrowserHostImpl::OnFrameIdentified(int64 frame_id,
|
||||
base::string16 name) {
|
||||
bool is_main_frame = (parent_frame_id == CefFrameHostImpl::kMainFrameId);
|
||||
GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId, parent_frame_id,
|
||||
is_main_frame, name, GURL());
|
||||
is_main_frame, false, name, GURL());
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnFrameFocused(
|
||||
@ -2960,7 +2962,7 @@ void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
|
||||
CefRefPtr<CefFrame> frame =
|
||||
GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId,
|
||||
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
|
||||
base::string16(), validated_url);
|
||||
false, base::string16(), validated_url);
|
||||
|
||||
// Give internal scheme handlers an opportunity to update content.
|
||||
scheme::DidFinishLoad(frame, validated_url);
|
||||
@ -3209,6 +3211,7 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
int frame_tree_node_id,
|
||||
int64 parent_frame_id,
|
||||
bool is_main_frame,
|
||||
bool is_download,
|
||||
base::string16 frame_name,
|
||||
const GURL& frame_url) {
|
||||
// We need either a valid |frame_id| or a valid |frame_tree_node_id|.
|
||||
@ -3229,12 +3232,13 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
|
||||
if (frame_id < 0) {
|
||||
// With PlzNavigate the renderer process representation might not exist yet.
|
||||
if (is_main_frame && main_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
|
||||
if ((is_main_frame || is_download) &&
|
||||
main_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
|
||||
// Operating in the main frame. Continue using the existing main frame
|
||||
// object until the new renderer process representation is created.
|
||||
frame_id = main_frame_id_;
|
||||
} else {
|
||||
if (is_main_frame) {
|
||||
if (is_main_frame || is_download) {
|
||||
// Always use the same pending object for the main frame.
|
||||
frame_tree_node_id = kMainFrameTreeNodeId;
|
||||
}
|
||||
@ -3302,9 +3306,27 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
}
|
||||
}
|
||||
|
||||
if (!frame_created)
|
||||
if (!frame_created && !is_download)
|
||||
frame->SetAttributes(is_main_frame, url, name, parent_frame_id);
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
// The main frame should always be correctly attributed.
|
||||
DCHECK(main_frame_id_ == CefFrameHostImpl::kInvalidFrameId ||
|
||||
main_frame_id_ >= 0)
|
||||
<< main_frame_id_;
|
||||
if (main_frame_id_ == CefFrameHostImpl::kInvalidFrameId) {
|
||||
// With PlzNavigate the renderer process representation might not exist yet.
|
||||
DCHECK(frame_id == CefFrameHostImpl::kMainFrameId ||
|
||||
frame_id == CefFrameHostImpl::kUnspecifiedFrameId)
|
||||
<< frame_id;
|
||||
DCHECK(frame->IsMain());
|
||||
} else if (main_frame_id_ == frame_id) {
|
||||
DCHECK(frame->IsMain());
|
||||
} else {
|
||||
DCHECK(!frame->IsMain());
|
||||
}
|
||||
#endif
|
||||
|
||||
return frame.get();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user