https://bugs.webkit.org/show_bug.cgi?id=90228
Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-07-02
Reviewed by Simon Fraser.
Source/WebCore:
Initializating of the logging channels was taking time on startup. When logging is disabled
(and the LOG macro does nothing), we should aslo disable logging channels and initialization.
This patch #ifdef the Logging initialization with the macro LOG_DISABLED.
* WebCore.exp.in:
* make-export-file-generator: Explicitely adds Assertions.h so that LOG_DISABLED is defined.
* platform/Logging.cpp:
* platform/Logging.h:
* platform/blackberry/LoggingBlackBerry.cpp:
* platform/efl/LoggingEfl.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/gtk/LoggingGtk.cpp:
* platform/mac/LoggingMac.mm:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ensureSessionIsInitialized):
* platform/qt/LoggingQt.cpp:
* platform/win/LoggingWin.cpp:
* platform/wx/LoggingWx.cpp:
Source/WebKit/blackberry:
* Api/BlackBerryGlobal.cpp:
(BlackBerry::WebKit::globalInitialize):
Source/WebKit/chromium:
* src/WebKit.cpp:
(WebKit::enableLogChannel):
Source/WebKit/efl:
* ewk/ewk_main.cpp:
(_ewk_init_body):
Source/WebKit/gtk:
* webkit/webkitglobals.cpp:
(webkitInit):
Source/WebKit/mac:
* Misc/WebIconDatabase.mm:
(-[WebIconDatabase _scaleIcon:toSize:]):
* Misc/WebKitLogging.h:
* Misc/WebKitLogging.m:
* WebView/WebHTMLView.mm:
(-[WebHTMLView _attributeStringFromDOMRange:]):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WebKit/qt:
* WebCoreSupport/InitWebCoreQt.cpp:
(WebCore::initializeWebCoreQt):
Source/WebKit/win:
* WebView.cpp:
(WebView::initWithFrame):
Source/WebKit/wx:
* WebView.cpp:
(WebKit::WebView::Create):
Source/WebKit2:
* Platform/Logging.cpp:
* Platform/Logging.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121707
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ Initializating of the logging channels was taking time on startup. When logging is disabled
+ (and the LOG macro does nothing), we should aslo disable logging channels and initialization.
+
+ This patch #ifdef the Logging initialization with the macro LOG_DISABLED.
+
+ * WebCore.exp.in:
+ * make-export-file-generator: Explicitely adds Assertions.h so that LOG_DISABLED is defined.
+ * platform/Logging.cpp:
+ * platform/Logging.h:
+ * platform/blackberry/LoggingBlackBerry.cpp:
+ * platform/efl/LoggingEfl.cpp:
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ * platform/gtk/LoggingGtk.cpp:
+ * platform/mac/LoggingMac.mm:
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::ensureSessionIsInitialized):
+ * platform/qt/LoggingQt.cpp:
+ * platform/win/LoggingWin.cpp:
+ * platform/wx/LoggingWx.cpp:
+
2012-07-02 Dan Bernstein <mitz@apple.com>
<rdar://problem/11787030> In vertical writing modes, child following float-clearing block has incorrect logical top
__ZN7WebCore31CrossOriginPreflightResultCache6sharedEv
__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjbNS_20TextIteratorBehaviorE
__ZN7WebCore33stripLeadingAndTrailingHTMLSpacesERKN3WTF6StringE
-__ZN7WebCore36initializeLoggingChannelsIfNecessaryEv
__ZN7WebCore3macERKNS_10CredentialE
__ZN7WebCore3macERKNS_23AuthenticationChallengeE
__ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeE
__ZNK7WebCore7Element26fastAttributeLookupAllowedERKNS_13QualifiedNameE
#endif
+#if !LOG_DISABLED
+__ZN7WebCore36initializeLoggingChannelsIfNecessaryEv
+#endif // !LOG_DISABLED
+
#if !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) && !PLATFORM(IOS)
__ZN7WebCore7IntSizeC1ERK7_NSSize
__ZNK7WebCore7IntSizecv7_NSSizeEv
TEMPLATE = <<-EOF
#include "config.h"
#include <stdio.h>
+#include <wtf/Assertions.h>
int main(int, char**)
{
#include "Logging.h"
#include "PlatformString.h"
+#if !LOG_DISABLED
+
namespace WebCore {
WTFLogChannel LogNotYetImplemented = { 0x00000001, "WebCoreLogLevel", WTFLogChannelOff };
}
}
+
+#endif // !LOG_DISABLED
#include <wtf/Assertions.h>
#include <wtf/Forward.h>
+#if !LOG_DISABLED
+
#ifndef LOG_CHANNEL_PREFIX
#define LOG_CHANNEL_PREFIX Log
#endif
WTFLogChannel* getChannelFromName(const String& channelName);
}
+#endif // !LOG_DISABLED
+
#endif // Logging_h
#include "config.h"
#include "Logging.h"
+#if !LOG_DISABLED
+
#include <wtf/text/WTFString.h>
namespace WebCore {
}
} // namespace WebCore
+
+#endif // !LOG_DISABLED
#include "config.h"
#include "Logging.h"
+#if !LOG_DISABLED
+
#include "PlatformString.h"
#include <Eina.h>
}
}
+
+#endif // !LOG_DISABLED
g_object_set(m_fpsSink, "silent", TRUE , NULL);
// Turn off text overlay unless logging is enabled.
+#if LOG_DISABLED
+ g_object_set(m_fpsSink, "text-overlay", FALSE , NULL);
+#else
WTFLogChannel* channel = getChannelFromName("Media");
if (channel->state != WTFLogChannelOn)
g_object_set(m_fpsSink, "text-overlay", FALSE , NULL);
+#endif // LOG_DISABLED
if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) {
g_object_set(m_fpsSink, "video-sink", m_webkitVideoSink, NULL);
#include "config.h"
#include "Logging.h"
-#include "PlatformString.h"
+#if !LOG_DISABLED
+
+#include "PlatformString.h"
#include <glib.h>
#include <string.h>
}
} // namespace WebCore
+
+#endif // !LOG_DISABLED
#include "Logging.h"
+#if !LOG_DISABLED
+
namespace WebCore {
static inline void initializeWithUserDefault(WTFLogChannel& channel)
}
}
+
+#endif // !LOG_DISABLED
setSoupCookieJar(jar);
}
+#if !LOG_DISABLED
if (!soup_session_get_feature(session, SOUP_TYPE_LOGGER) && LogNetwork.state == WTFLogChannelOn) {
SoupLogger* logger = soup_logger_new(static_cast<SoupLoggerLogLevel>(SOUP_LOGGER_LOG_BODY), -1);
soup_session_add_feature(session, SOUP_SESSION_FEATURE(logger));
g_object_unref(logger);
}
+#endif // !LOG_DISABLED
if (!soup_session_get_feature(session, SOUP_TYPE_REQUESTER)) {
SoupRequester* requester = soup_requester_new();
#include "config.h"
#include "Logging.h"
+#if !LOG_DISABLED
+
#include "PlatformString.h"
#include <QDebug>
#include <QStringList>
}
} // namespace WebCore
+
+#endif // !LOG_DISABLED
#include "config.h"
#include "Logging.h"
+#if !LOG_DISABLED
+
#include "PlatformString.h"
#include <windows.h>
#include <wtf/OwnArrayPtr.h>
}
} // namespace WebCore
+
+#endif // !LOG_DISABLED
#include "config.h"
#include "Logging.h"
+#if !LOG_DISABLED
+
#include "PlatformString.h"
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
}
}
+
+#endif // !LOG_DISABLED
blackberryDebugInitialize();
#endif
+#if !LOG_DISABLED
// Turn on logging.
initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
// Initialize threading/
JSC::initializeThreading();
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * Api/BlackBerryGlobal.cpp:
+ (BlackBerry::WebKit::globalInitialize):
+
2012-07-01 George Staikos <staikos@webkit.org>
Clear visited links when clearing history.
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * src/WebKit.cpp:
+ (WebKit::enableLogChannel):
+
2012-07-01 Keishi Hattori <keishi@webkit.org>
Unreviewed, rolling out r121650.
#include <wtf/Assertions.h>
#include <wtf/MainThread.h>
#include <wtf/Threading.h>
+#include <wtf/UnusedParam.h>
#include <wtf/text/AtomicString.h>
#if OS(DARWIN)
void enableLogChannel(const char* name)
{
+#if !LOG_DISABLED
WTFLogChannel* channel = WebCore::getChannelFromName(name);
if (channel)
channel->state = WTFLogChannelOn;
+#else
+ UNUSED_PARAM(name);
+#endif // !LOG_DISABLED
}
void resetPluginCache(bool reloadPages)
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * ewk/ewk_main.cpp:
+ (_ewk_init_body):
+
2012-07-02 Gyuyoung Kim <gyuyoung.kim@samsung.com>
[EFL] Rename NotificationPresenterEfl with NotificationClientEfl
"work (ie: Adobe Flash)");
WebCore::ScriptController::initializeThreading();
+#if !LOG_DISABLED
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
WebCore::Settings::setDefaultMinDOMTimerInterval(0.004);
PlatformStrategiesEfl::initialize();
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * webkit/webkitglobals.cpp:
+ (webkitInit):
+
2012-06-29 Tony Chang <tony@chromium.org>
[GTK] Enable CSS grid layout LayoutTests on GTK+
JSC::initializeThreading();
WTF::initializeMainThread();
+#if !LOG_DISABLED
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
PlatformStrategiesGtk::initialize();
// We make sure the text codecs have been initialized, because
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * Misc/WebIconDatabase.mm:
+ (-[WebIconDatabase _scaleIcon:toSize:]):
+ * Misc/WebKitLogging.h:
+ * Misc/WebKitLogging.m:
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _attributeStringFromDOMRange:]):
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
2012-07-01 Timothy Hatcher <timothy@apple.com>
Make the "Inspect Element" context menu item appear in nightly builds again.
ASSERT(size.width);
ASSERT(size.height);
-#if !LOG_DISABLED
+#if !LOG_DISABLED
double start = CFAbsoluteTimeGetCurrent();
#endif
extern "C" {
#endif
+#if !LOG_DISABLED
extern WTFLogChannel WebKitLogTiming;
extern WTFLogChannel WebKitLogLoading;
extern WTFLogChannel WebKitLogFontCache;
extern WTFLogChannel WebKitLogTextInput;
void WebKitInitializeLoggingChannelsIfNecessary(void);
+#endif // !LOG_DISABLED
// FIXME: Why is this in the "logging" header file?
// Use WebCoreThreadViolationCheck instead for checks that throw an exception even in production builds.
#import "WebKitLogging.h"
+#if !LOG_DISABLED
+
WTFLogChannel WebKitLogTextInput = { 0x00000010, "WebKitLogLevel", WTFLogChannelOff };
WTFLogChannel WebKitLogTiming = { 0x00000020, "WebKitLogLevel", WTFLogChannelOff };
WTFLogChannel WebKitLogLoading = { 0x00000040, "WebKitLogLevel", WTFLogChannelOff };
initializeLogChannel(&WebKitLogIconDatabase);
initializeLogChannel(&WebKitLogTextInput);
}
+#endif // !LOG_DISABLED
void ReportDiscardedDelegateException(SEL delegateSelector, id exception)
{
- (NSAttributedString *)_attributeStringFromDOMRange:(DOMRange *)range
{
NSAttributedString *attributedString;
-#if !LOG_DISABLED
+#if !LOG_DISABLED
double start = CFAbsoluteTimeGetCurrent();
#endif
attributedString = [[[NSAttributedString alloc] _initWithDOMRange:range] autorelease];
static bool didOneTimeInitialization = false;
if (!didOneTimeInitialization) {
+#if !LOG_DISABLED
WebKitInitializeLoggingChannelsIfNecessary();
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
[WebHistoryItem initWindowWatcherIfNecessary];
#if ENABLE(SQL_DATABASE)
WebKitInitializeDatabasesIfNecessary();
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * WebCoreSupport/InitWebCoreQt.cpp:
+ (WebCore::initializeWebCoreQt):
+
2012-06-29 Konrad Piascik <kpiascik@rim.com>
Don't hardcode target dpi of 160 (it should be 96 on desktop)
if (initialized)
return;
+#if !LOG_DISABLED
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
ScriptController::initializeThreading();
WTF::initializeMainThread();
WebCore::SecurityPolicy::setLocalLoadPolicy(WebCore::SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * WebView.cpp:
+ (WebView::initWithFrame):
+
2012-06-29 Mihai Balan <mibalan@adobe.com>
[CSS Regions] Adding feature defines for CSS Regions for Windows
static bool didOneTimeInitialization;
if (!didOneTimeInitialization) {
+#if !LOG_DISABLED
initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
#if ENABLE(SQL_DATABASE)
WebKitInitializeWebDatabasesIfNecessary();
#endif
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * WebView.cpp:
+ (WebKit::WebView::Create):
+
2012-05-31 Hajime Morrita <morrita@chromium.org>
REGRESSION(r117572): editing/spelling/spellcheck-async-remove-frame.html crashes on Mac
m_impl = new WebViewPrivate();
- WebCore::initializeLoggingChannelsIfNecessary();
+#if !LOG_DISABLED
+ WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
WebCore::HTMLFrameOwnerElement* parentFrame = 0;
WebCore::EditorClientWx* editorClient = new WebCore::EditorClientWx();
+2012-07-02 Benjamin Poulain <bpoulain@apple.com>
+
+ Do not do any logging initialization when logging is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=90228
+
+ Reviewed by Simon Fraser.
+
+ * Platform/Logging.cpp:
+ * Platform/Logging.h:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::WebProcess):
+
2012-07-02 No'am Rosenthal <noam.rosenthal@nokia.com>
[Qt][WK2] New API tests introduced in r121620 fail
} // namespace WebKit
-#endif // LOG_DISABLED
+#endif // !LOG_DISABLED
} // namespace WebKit
-#endif // LOG_DISABLED
+#endif // !LOG_DISABLED
#endif // Logging_h
addLanguageChangeObserver(this, languageChanged);
+#if !LOG_DISABLED
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
#ifndef NDEBUG
webContextCounter.increment();
WebPlatformStrategies::initialize();
#endif // USE(PLATFORM_STRATEGIES)
+#if !LOG_DISABLED
WebCore::initializeLoggingChannelsIfNecessary();
+#endif // !LOG_DISABLED
}
void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, RunLoop* runLoop)