Skip to content

Commit 8957ef9

Browse files
Allan Sandfeld Jensenpatricia-gallardo
authored andcommitted
Register PerformanceNode early enough
Must be created before RenderFrame. Change-Id: I4ee121f6ad6a77fc48d12bc56b1fdb82ec97139b Reviewed-by: Kirill Burtsev <[email protected]>
1 parent 82a1a68 commit 8957ef9

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/core/web_contents_adapter.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
6969
#include "base/values.h"
7070
#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
71-
#include "components/performance_manager/embedder/performance_manager_registry.h"
7271
#include "content/browser/renderer_host/render_view_host_impl.h"
7372
#include "content/browser/renderer_host/text_input_manager.h"
7473
#include "content/browser/web_contents/web_contents_impl.h"
@@ -529,11 +528,6 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
529528
#if BUILDFLAG(ENABLE_EXTENSIONS)
530529
extensions::ExtensionWebContentsObserverQt::CreateForWebContents(webContents());
531530
#endif
532-
FormInteractionTabHelper::CreateForWebContents(webContents());
533-
if (auto *performance_manager_registry = performance_manager::PerformanceManagerRegistry::GetInstance()) {
534-
if (!webContents()->GetMainFrame()->IsRenderFrameCreated())
535-
performance_manager_registry->CreatePageNodeForWebContents(webContents());
536-
}
537531

538532
// Create an instance of WebEngineVisitedLinksManager to catch the first
539533
// content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will
@@ -2017,9 +2011,6 @@ void WebContentsAdapter::discard()
20172011
#if BUILDFLAG(ENABLE_EXTENSIONS)
20182012
extensions::ExtensionWebContentsObserverQt::CreateForWebContents(webContents());
20192013
#endif
2020-
FormInteractionTabHelper::CreateForWebContents(webContents());
2021-
if (auto *performance_manager_registry = performance_manager::PerformanceManagerRegistry::GetInstance())
2022-
performance_manager_registry->CreatePageNodeForWebContents(webContents());
20232014
}
20242015

20252016
void WebContentsAdapter::undiscard()

src/core/web_contents_view_qt.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#include "web_engine_context.h"
5252
#include "web_contents_delegate_qt.h"
5353

54+
#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
55+
#include "components/performance_manager/embedder/performance_manager_registry.h"
5456
#include "components/spellcheck/spellcheck_buildflags.h"
5557
#include "content/browser/renderer_host/render_view_host_impl.h"
5658
#include "content/browser/renderer_host/render_widget_host_impl.h"
@@ -65,6 +67,16 @@
6567

6668
namespace QtWebEngineCore {
6769

70+
WebContentsViewQt::WebContentsViewQt(content::WebContents *webContents)
71+
: m_webContents(webContents)
72+
, m_client(nullptr)
73+
, m_factoryClient(nullptr)
74+
{
75+
FormInteractionTabHelper::CreateForWebContents(webContents);
76+
if (auto *performance_manager_registry = performance_manager::PerformanceManagerRegistry::GetInstance())
77+
performance_manager_registry->CreatePageNodeForWebContents(webContents);
78+
}
79+
6880
void WebContentsViewQt::setFactoryClient(WebContentsAdapterClient* client)
6981
{
7082
if (m_factoryClient)

src/core/web_contents_view_qt.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ class WebContentsViewQt
5959
public:
6060
static inline WebContentsViewQt *from(WebContentsView *view) { return static_cast<WebContentsViewQt*>(view); }
6161

62-
WebContentsViewQt(content::WebContents* webContents)
63-
: m_webContents(webContents)
64-
, m_client(nullptr)
65-
, m_factoryClient(nullptr)
66-
{ }
62+
WebContentsViewQt(content::WebContents *webContents);
6763

6864
void setFactoryClient(WebContentsAdapterClient* client);
6965
void setClient(WebContentsAdapterClient* client);

0 commit comments

Comments
 (0)