From 9ac06e400d90dd225ce20262a1bd4c40dd893707 Mon Sep 17 00:00:00 2001 From: miguelg Date: Mon, 2 Nov 2015 11:15:04 -0800 Subject: Tune log statements to track stale notification issues https://codereview.chromium.org/1408983003 introduce some logging which has helped us narrow down where the problem is happening. This new iteration moves the log statements to a more specific location to proceed with the investigation. BUG=534537 Review URL: https://codereview.chromium.org/1420133006 Cr-Commit-Position: refs/heads/master@{#357398} --- .../notification_event_dispatcher_impl.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc index 538f344..a116648 100644 --- a/content/browser/notifications/notification_event_dispatcher_impl.cc +++ b/content/browser/notifications/notification_event_dispatcher_impl.cc @@ -82,18 +82,17 @@ void DispatchNotificationClickEventOnRegistration( const scoped_refptr& service_worker_registration) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (service_worker_status == SERVICE_WORKER_OK) { - base::Callback dispatch_event_callback = - base::Bind(&NotificationClickEventFinished, - dispatch_complete_callback, - service_worker_registration); - #if defined(OS_ANDROID) // This LOG(INFO) deliberately exists to help track down the cause of // https://crbug.com/534537, where notifications sometimes do not react to // the user clicking on them. It should be removed once that's fixed. - LOG(INFO) << "Dispatching notificationclick event to the Service Worker."; + LOG(INFO) << "Trying to dispatch notification for SW with status: " + << service_worker_status << " action_index: " << action_index; #endif + if (service_worker_status == SERVICE_WORKER_OK) { + base::Callback dispatch_event_callback = + base::Bind(&NotificationClickEventFinished, dispatch_complete_callback, + service_worker_registration); DCHECK(service_worker_registration->active_version()); service_worker_registration->active_version()-> @@ -150,6 +149,14 @@ void FindServiceWorkerRegistration( bool success, const NotificationDatabaseData& notification_database_data) { DCHECK_CURRENTLY_ON(BrowserThread::IO); + +#if defined(OS_ANDROID) + // This LOG(INFO) deliberately exists to help track down the cause of + // https://crbug.com/534537, where notifications sometimes do not react to + // the user clicking on them. It should be removed once that's fixed. + LOG(INFO) << "Lookup for ServiceWoker Registration: sucesss:" << success + << " action_index: " << action_index; +#endif if (!success) { BrowserThread::PostTask( BrowserThread::UI, -- cgit v1.1