WebDiagnosticLoggingClient.cpp [plain text]
#include "config.h"
#include "WebDiagnosticLoggingClient.h"
#include "WebCoreArgumentCoders.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
#include <WebCore/Settings.h>
namespace WebKit {
using namespace WebCore;
WebDiagnosticLoggingClient::WebDiagnosticLoggingClient(WebPage& page)
: m_page(page)
{
}
WebDiagnosticLoggingClient::~WebDiagnosticLoggingClient()
{
}
void WebDiagnosticLoggingClient::logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample shouldSample)
{
ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
if (!shouldLogAfterSampling(shouldSample))
return;
m_page.send(Messages::WebPageProxy::LogDiagnosticMessage(message, description, ShouldSample::No));
}
void WebDiagnosticLoggingClient::logDiagnosticMessageWithResult(const String& message, const String& description, WebCore::DiagnosticLoggingResultType result, WebCore::ShouldSample shouldSample)
{
ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
if (!shouldLogAfterSampling(shouldSample))
return;
m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithResult(message, description, result, ShouldSample::No));
}
void WebDiagnosticLoggingClient::logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample shouldSample)
{
ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
if (!shouldLogAfterSampling(shouldSample))
return;
m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValue(message, description, value, significantFigures, ShouldSample::No));
}
void WebDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample shouldSample)
{
ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
if (!shouldLogAfterSampling(shouldSample))
return;
m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy(message, description, ShouldSample::No));
}
}