Simplify DiagnosticLoggingClient call sites
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2015 02:16:43 +0000 (02:16 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2015 02:16:43 +0000 (02:16 +0000)
commitec06aedf445908accc999438d015b488bd5bbe35
tree28b4c2a6dcf2a789fe2ed88f2b3fdf9a07c0e1d2
parent248e51c61c9b52607bc5fbc202497e7c13cb1ee8
Simplify DiagnosticLoggingClient call sites
https://bugs.webkit.org/show_bug.cgi?id=140701

Reviewed by Andreas Kling.

Simplify DiagnosticLoggingClient call sites by:
- Moving the Settings::diagnosticLoggingEnabled() check inside the
  MainFrame::diagnosticLoggingClient() getter.
- Having MainFrame::diagnosticLoggingClient() return a reference
  instead of a pointer (returning a dummy client if necessary).

Otherwise, each call site needs to both check the setting and do a
null-check on the client which is a bit annoying.

* history/PageCache.cpp:
(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::logCanCacheFrameDecision):
(WebCore::logCanCachePageDecision):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::logNavigation):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/SubframeLoader.cpp:
(WebCore::logPluginRequest):
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded):
* page/DiagnosticLoggingClient.h:
(WebCore::DiagnosticLoggingClient::logDiagnosticMessage): Deleted.
(WebCore::DiagnosticLoggingClient::logDiagnosticMessageWithResult): Deleted.
(WebCore::DiagnosticLoggingClient::logDiagnosticMessageWithValue): Deleted.
* page/MainFrame.cpp:
(WebCore::MainFrame::diagnosticLoggingClient):
* page/MainFrame.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/history/PageCache.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/page/DiagnosticLoggingClient.h
Source/WebCore/page/MainFrame.cpp
Source/WebCore/page/MainFrame.h