Commit 6bdb4845 authored by Varun Khaneja's avatar Varun Khaneja Committed by Commit Bot

Add more logging for debugging on ClusterFuzz.

Adding logs to the constructor and destructor of the object to
understand when/from where the object is being created/destroyed.

Bug: 1104919
Change-Id: Id42320a1cafe45c700c159ec0a5969705e83e5dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343550
Auto-Submit: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796234}
parent d6f82e42
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/stack_trace.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
...@@ -19,7 +20,9 @@ ...@@ -19,7 +20,9 @@
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/favicon/favicon_service_factory.h"
...@@ -168,9 +171,11 @@ const syncer::SyncService* GetSyncService(Profile* profile) { ...@@ -168,9 +171,11 @@ const syncer::SyncService* GetSyncService(Profile* profile) {
void AddToWidgetInputEventObservers( void AddToWidgetInputEventObservers(
content::RenderWidgetHost* widget_host, content::RenderWidgetHost* widget_host,
content::RenderWidgetHost::InputEventObserver* observer) { content::RenderWidgetHost::InputEventObserver* observer) {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": widget_host: " << widget_host VLOG(1) << __FUNCTION__ << ": widget_host: " << widget_host
<< "; observer: " << observer; << "; observer: " << observer;
#endif
// Since Widget API doesn't allow to check whether the observer is already // Since Widget API doesn't allow to check whether the observer is already
// added, the observer is removed and added again, to ensure that it is added // added, the observer is removed and added again, to ensure that it is added
...@@ -187,9 +192,11 @@ void AddToWidgetInputEventObservers( ...@@ -187,9 +192,11 @@ void AddToWidgetInputEventObservers(
void RemoveFromWidgetInputEventObservers( void RemoveFromWidgetInputEventObservers(
content::RenderWidgetHost* widget_host, content::RenderWidgetHost* widget_host,
content::RenderWidgetHost::InputEventObserver* observer) { content::RenderWidgetHost::InputEventObserver* observer) {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": widget_host: " << widget_host VLOG(1) << __FUNCTION__ << ": widget_host: " << widget_host
<< "; observer: " << observer; << "; observer: " << observer;
#endif
if (!widget_host) if (!widget_host)
return; return;
...@@ -259,7 +266,18 @@ void ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( ...@@ -259,7 +266,18 @@ void ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient(
contents, autofill_client))); contents, autofill_client)));
} }
ChromePasswordManagerClient::~ChromePasswordManagerClient() = default; ChromePasswordManagerClient::~ChromePasswordManagerClient() {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "wc: " << web_contents();
if (web_contents()) {
VLOG(1) << "wc->GetRenderViewHost(): "
<< web_contents()->GetRenderViewHost();
}
VLOG(1) << base::debug::StackTrace();
#endif
}
bool ChromePasswordManagerClient::IsSavingAndFillingEnabled( bool ChromePasswordManagerClient::IsSavingAndFillingEnabled(
const GURL& url) const { const GURL& url) const {
...@@ -1176,6 +1194,13 @@ ChromePasswordManagerClient::ChromePasswordManagerClient( ...@@ -1176,6 +1194,13 @@ ChromePasswordManagerClient::ChromePasswordManagerClient(
static base::NoDestructor<password_manager::StoreMetricsReporter> reporter( static base::NoDestructor<password_manager::StoreMetricsReporter> reporter(
this, GetSyncService(profile_), GetIdentityManager(), GetPrefs()); this, GetSyncService(profile_), GetIdentityManager(), GetPrefs());
driver_factory_->RequestSendLoggingAvailability(); driver_factory_->RequestSendLoggingAvailability();
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "wc: " << web_contents;
VLOG(1) << "wc->GetRenderViewHost(): " << web_contents->GetRenderViewHost();
#endif
} }
void ChromePasswordManagerClient::DidStartNavigation( void ChromePasswordManagerClient::DidStartNavigation(
...@@ -1207,10 +1232,13 @@ void ChromePasswordManagerClient::DidFinishNavigation( ...@@ -1207,10 +1232,13 @@ void ChromePasswordManagerClient::DidFinishNavigation(
password_reuse_detection_manager_.DidNavigateMainFrame(GetLastCommittedURL()); password_reuse_detection_manager_.DidNavigateMainFrame(GetLastCommittedURL());
#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) #endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this; VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "wc: " << web_contents(); VLOG(1) << "wc: " << web_contents();
VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost(); VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost();
VLOG(1) << base::debug::StackTrace();
#endif
AddToWidgetInputEventObservers( AddToWidgetInputEventObservers(
web_contents()->GetRenderViewHost()->GetWidget(), this); web_contents()->GetRenderViewHost()->GetWidget(), this);
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -1235,20 +1263,26 @@ void ChromePasswordManagerClient::WebContentsDestroyed() { ...@@ -1235,20 +1263,26 @@ void ChromePasswordManagerClient::WebContentsDestroyed() {
DCHECK(web_contents()->GetRenderViewHost()); DCHECK(web_contents()->GetRenderViewHost());
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this; VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "wc: " << web_contents(); VLOG(1) << "wc: " << web_contents();
VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost(); VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost();
VLOG(1) << base::debug::StackTrace();
#endif
RemoveFromWidgetInputEventObservers( RemoveFromWidgetInputEventObservers(
web_contents()->GetRenderViewHost()->GetWidget(), this); web_contents()->GetRenderViewHost()->GetWidget(), this);
} }
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
void ChromePasswordManagerClient::OnPaste() { void ChromePasswordManagerClient::OnPaste() {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this; VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "wc: " << web_contents(); VLOG(1) << "wc: " << web_contents();
VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost(); VLOG(1) << "wc->GetRenderViewHost(): " << web_contents()->GetRenderViewHost();
VLOG(1) << base::debug::StackTrace();
#endif
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
base::string16 text; base::string16 text;
...@@ -1261,10 +1295,13 @@ void ChromePasswordManagerClient::OnPaste() { ...@@ -1261,10 +1295,13 @@ void ChromePasswordManagerClient::OnPaste() {
void ChromePasswordManagerClient::RenderFrameCreated( void ChromePasswordManagerClient::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this; VLOG(1) << __FUNCTION__ << ": this: " << this;
VLOG(1) << "; rfh: " << render_frame_host; VLOG(1) << "rfh: " << render_frame_host;
VLOG(1) << "; rfh->GetView(): " << render_frame_host->GetView(); VLOG(1) << "rfh->GetView(): " << render_frame_host->GetView();
VLOG(1) << base::debug::StackTrace();
#endif
// TODO(drubery): We should handle input events on subframes separately, so // TODO(drubery): We should handle input events on subframes separately, so
// that we can accurately report that the password was reused on a subframe. // that we can accurately report that the password was reused on a subframe.
...@@ -1276,10 +1313,13 @@ void ChromePasswordManagerClient::RenderFrameCreated( ...@@ -1276,10 +1313,13 @@ void ChromePasswordManagerClient::RenderFrameCreated(
void ChromePasswordManagerClient::RenderFrameDeleted( void ChromePasswordManagerClient::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
// TODO(https://crbug.com/1104919): Remove this logging. // TODO(https://crbug.com/1104919): Remove this logging.
VLOG(1) << __FUNCTION__ << ": this: " << this VLOG(1) << __FUNCTION__ << ": this: " << this;
<< "; rfh: " << render_frame_host VLOG(1) << "rfh: " << render_frame_host;
<< "; rfh->GetView(): " << render_frame_host->GetView(); VLOG(1) << "rfh->GetView(): " << render_frame_host->GetView();
VLOG(1) << base::debug::StackTrace();
#endif
if (!render_frame_host->GetView()) if (!render_frame_host->GetView())
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment