Move the frame/handler association to CefResourceContext (see issue #2622).

A CefBrowserHostImpl is created using a CefRequestContextImpl that may have a
CefRequestContextHandler. Multiple CefRequestContextImpl may share the same
underlying CefBrowserContext which owns a CefResourceContext. IO-thread
callbacks from Chromium are often associated with a CefResourceContext and the
target frame is identified using render_process_id/render_frame_id routing IDs.

This change forwards frame create/delete notifications from CefBrowserHostImpl
(or CefMimeHandlerViewGuestDelegate) to CefResourceContext so that it can
properly resolve the association from routing ID to Handler when queried from
CefPluginServiceFilter::IsPluginAvailable.

To test: Verify that all ceftests pass with NetworkService disabled.
This commit is contained in:
Marshall Greenblatt
2019-03-23 19:40:32 -04:00
parent a23e845244
commit ea27dff338
10 changed files with 179 additions and 70 deletions

View File

@@ -543,6 +543,22 @@ CefRefPtr<CefExtension> CefRequestContextImpl::GetExtension(
return GetBrowserContext()->extension_system()->GetExtension(extension_id);
}
void CefRequestContextImpl::OnRenderFrameCreated(int render_process_id,
int render_frame_id,
bool is_main_frame,
bool is_guest_view) {
browser_context_->OnRenderFrameCreated(
this, render_process_id, render_frame_id, is_main_frame, is_guest_view);
}
void CefRequestContextImpl::OnRenderFrameDeleted(int render_process_id,
int render_frame_id,
bool is_main_frame,
bool is_guest_view) {
browser_context_->OnRenderFrameDeleted(
this, render_process_id, render_frame_id, is_main_frame, is_guest_view);
}
// static
CefRefPtr<CefRequestContextImpl>
CefRequestContextImpl::GetOrCreateRequestContext(const Config& config) {