Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (123777 => 123778)
--- trunk/Source/WebCore/CMakeLists.txt 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-07-26 18:45:46 UTC (rev 123778)
@@ -1622,6 +1622,7 @@
page/ContentSecurityPolicy.cpp
page/ContextMenuController.cpp
page/Crypto.cpp
+ page/DiagnosticLoggingKeys.cpp
page/DOMSecurityPolicy.cpp
page/DOMSelection.cpp
page/DOMTimer.cpp
Modified: trunk/Source/WebCore/ChangeLog (123777 => 123778)
--- trunk/Source/WebCore/ChangeLog 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/ChangeLog 2012-07-26 18:45:46 UTC (rev 123778)
@@ -1,3 +1,37 @@
+2012-07-26 Jer Noble <jer.no...@apple.com>
+
+ Add a ChromeClient method to send diagnostic logging messages from WebCore to the client.
+ https://bugs.webkit.org/show_bug.cgi?id=92340
+
+ Reviewed by Anders Carlsson.
+
+ Add a new ChromeClient menthod, to be implemented by WebKit and WebKit2, which sends
+ a diagnostic logging message up to the client.
+
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::logDiagnosticMessage):
+ * page/ChromeClient.h:
+ (WebCore::ChromeClient::logDiagnosticMessage):
+ (ChromeClient):
+ * page/DiagnosticLoggingKeys.cpp: Added.
+ (WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
+ (WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
+ (WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
+ (WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
+ (WebCore::DiagnosticLoggingKeys::passKey):
+ (WebCore::DiagnosticLoggingKeys::failKey):
+ (WebCore::DiagnosticLoggingKeys::noopKey):
+ * page/DiagnosticLoggingKeys.h: Added.
+ (DiagnosticLoggingKeys):
+
+ Add the new files DiagnosticLoggingKeys.cpp,h to the project:
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+
2012-07-25 Jer Noble <jer.no...@apple.com>
Add setting to enable and disable diagnostic logging.
Modified: trunk/Source/WebCore/GNUmakefile.list.am (123777 => 123778)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-07-26 18:45:46 UTC (rev 123778)
@@ -3024,6 +3024,8 @@
Source/WebCore/page/Coordinates.h \
Source/WebCore/page/Crypto.cpp \
Source/WebCore/page/Crypto.h \
+ Source/WebCore/page/DiagnosticLoggingKeys.cpp \
+ Source/WebCore/page/DiagnosticLoggingKeys.h \
Source/WebCore/page/DOMSecurityPolicy.cpp \
Source/WebCore/page/DOMSecurityPolicy.h \
Source/WebCore/page/DOMSelection.cpp \
Modified: trunk/Source/WebCore/Target.pri (123777 => 123778)
--- trunk/Source/WebCore/Target.pri 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/Target.pri 2012-07-26 18:45:46 UTC (rev 123778)
@@ -861,6 +861,7 @@
page/ContentSecurityPolicy.cpp \
page/ContextMenuController.cpp \
page/Crypto.cpp \
+ page/DiagnosticLoggingKeys.cpp \
page/DOMSelection.cpp \
page/DOMTimer.cpp \
page/DOMWindow.cpp \
@@ -1954,6 +1955,7 @@
page/ContextMenuController.h \
page/ContextMenuProvider.h \
page/Coordinates.h \
+ page/DiagnosticLoggingKeys.h \
page/DOMSelection.h \
page/DOMTimer.h \
page/DOMWindow.h \
Modified: trunk/Source/WebCore/WebCore.gypi (123777 => 123778)
--- trunk/Source/WebCore/WebCore.gypi 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/WebCore.gypi 2012-07-26 18:45:46 UTC (rev 123778)
@@ -3038,6 +3038,8 @@
'page/ContextMenuProvider.h',
'page/Crypto.cpp',
'page/Crypto.h',
+ 'page/DiagnosticLoggingKeys.cpp',
+ 'page/DiagnosticLoggingKeys.h',
'page/DOMSecurityPolicy.cpp',
'page/DOMSelection.cpp',
'page/DOMSelection.h',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (123777 => 123778)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-07-26 18:45:46 UTC (rev 123778)
@@ -26767,6 +26767,14 @@
>
</File>
<File
+ RelativePath="..\page\DiagnosticLoggingKeys.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\DiagnosticLoggingKeys.h"
+ >
+ </File>
+ <File
RelativePath="..\page\DOMSelection.cpp"
>
</File>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (123777 => 123778)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-07-26 18:45:46 UTC (rev 123778)
@@ -5819,6 +5819,7 @@
CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD27F6E51457685A0078207D /* JSMediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD27F6E2145767580078207D /* JSMediaController.cpp */; };
CD27F6E7145770D30078207D /* MediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD27F6E6145770D30078207D /* MediaController.cpp */; };
+ CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */; };
CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD82030B1395AB6A00F956C6 /* WebVideoFullscreenController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */; settings = {COMPILER_FLAGS = "-Wno-undef"; }; };
@@ -13087,6 +13088,8 @@
CD27F6E3145767580078207D /* JSMediaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaController.h; sourceTree = "<group>"; };
CD27F6E4145767870078207D /* MediaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaController.h; sourceTree = "<group>"; };
CD27F6E6145770D30078207D /* MediaController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaController.cpp; sourceTree = "<group>"; };
+ CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiagnosticLoggingKeys.cpp; sourceTree = "<group>"; };
+ CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingKeys.h; sourceTree = "<group>"; };
CD4AC5281496AE2F0087C4EF /* Composite.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = Composite.wav; path = platform/audio/resources/Composite.wav; sourceTree = SOURCE_ROOT; };
CD4E0AFA11F7BC27009D3811 /* fullscreen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreen.css; sourceTree = "<group>"; };
CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenController.h; sourceTree = "<group>"; };
@@ -15795,6 +15798,8 @@
E1271A130EEEC80400F61213 /* WorkerNavigator.cpp */,
E1271A0A0EEEC77A00F61213 /* WorkerNavigator.h */,
E1271A510EEECD1C00F61213 /* WorkerNavigator.idl */,
+ CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */,
+ CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */,
);
path = page;
sourceTree = "<group>";
@@ -28395,6 +28400,7 @@
1059457715B42A0D004D37FD /* JSMicroDataItemValue.cpp in Sources */,
1059459715B42A8E004D37FD /* PropertyNodeList.cpp in Sources */,
1059459D15B42B0C004D37FD /* JSPropertyNodeList.cpp in Sources */,
+ CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebCore/page/ChromeClient.h (123777 => 123778)
--- trunk/Source/WebCore/page/ChromeClient.h 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebCore/page/ChromeClient.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -349,6 +349,8 @@
virtual bool isPointerLocked() { return false; }
#endif
+ virtual void logDiagnosticMessage(const String& message, const String& description, const String& status) { UNUSED_PARAM(message); UNUSED_PARAM(description); UNUSED_PARAM(status); }
+
protected:
virtual ~ChromeClient() { }
};
Added: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (0 => 123778)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (rev 0)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp 2012-07-26 18:45:46 UTC (rev 123778)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DiagnosticLoggingKeys.h"
+
+namespace WebCore {
+
+const String& DiagnosticLoggingKeys::mediaLoadedKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("mediaLoaded"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::mediaLoadingFailedKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("mediaFailedLoading"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::pluginLoadedKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("pluginLoaded"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::pluginLoadingFailedKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("pluginFailedLoading"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::passKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("pass"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::failKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("fail"));
+ return key;
+}
+
+const String& DiagnosticLoggingKeys::noopKey()
+{
+ DEFINE_STATIC_LOCAL(const String, key, ("noop"));
+ return key;
+}
+
+}
Added: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (0 => 123778)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (rev 0)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DiagnosticLoggingKeys_h
+#define DiagnosticLoggingKeys_h
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DiagnosticLoggingKeys {
+public:
+ // Message keys
+ static const String& mediaLoadedKey();
+ static const String& mediaLoadingFailedKey();
+ static const String& pluginLoadedKey();
+ static const String& pluginLoadingFailedKey();
+
+ // Success keys
+ static const String& passKey();
+ static const String& failKey();
+ static const String& noopKey();
+};
+
+}
+
+#endif // DiagnosticLoggingKeys_h
Modified: trunk/Source/WebKit2/CMakeLists.txt (123777 => 123778)
--- trunk/Source/WebKit2/CMakeLists.txt 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/CMakeLists.txt 2012-07-26 18:45:46 UTC (rev 123778)
@@ -371,6 +371,7 @@
WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp
WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp
WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
+ WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp
WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp
Modified: trunk/Source/WebKit2/ChangeLog (123777 => 123778)
--- trunk/Source/WebKit2/ChangeLog 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/ChangeLog 2012-07-26 18:45:46 UTC (rev 123778)
@@ -1,3 +1,41 @@
+2012-07-26 Jer Noble <jer.no...@apple.com>
+
+ Add a ChromeClient method to send diagnostic logging messages from WebCore to the client.
+ https://bugs.webkit.org/show_bug.cgi?id=92340
+
+ Reviewed by Anders Carlsson.
+
+ Pipe the ChromeClient logDiagnosticMessage() function through WebKit2 to a new bundle class
+ InjectedBundlePageDiagnosticLoggingClient, to be implemented by the client.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKBundlePageSetDiagnosticLoggingClient): Added.
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+ * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Added.
+ (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage):
+ * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Added.
+ (InjectedBundlePageDiagnosticLoggingClient):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::logDiagnosticMessage):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::injectedBundleDiagnosticLoggingClient):
+
+ Add a convenience class to retrieve the diagnostic message keys:
+ * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Added.
+ (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage):
+ * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Added.
+ (InjectedBundlePageDiagnosticLoggingClient):
+
+ Add the InjectedBundlePageDiagnosticLoggingClient.cpp,h files.
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * win/WebKit2.vcproj:
+ * WebKit2.xcodeproj/project.pbxproj:
+
2012-07-25 Jer Noble <jer.no...@apple.com>
Add setting to enable and disable diagnostic logging.
Modified: trunk/Source/WebKit2/GNUmakefile.list.am (123777 => 123778)
--- trunk/Source/WebKit2/GNUmakefile.list.am 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/GNUmakefile.list.am 2012-07-26 18:45:46 UTC (rev 123778)
@@ -1004,6 +1004,8 @@
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp \
+ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h \
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp \
Modified: trunk/Source/WebKit2/Target.pri (123777 => 123778)
--- trunk/Source/WebKit2/Target.pri 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/Target.pri 2012-07-26 18:45:46 UTC (rev 123778)
@@ -335,6 +335,7 @@
WebProcess/InjectedBundle/InjectedBundleIntentRequest.h \
WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \
+ WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h \
WebProcess/InjectedBundle/InjectedBundlePageFormClient.h \
WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h \
WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h \
@@ -720,6 +721,7 @@
WebProcess/InjectedBundle/InjectedBundleIntentRequest.cpp \
WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \
WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \
+ WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp \
WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp \
WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp \
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (123777 => 123778)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-07-26 18:45:46 UTC (rev 123778)
@@ -874,6 +874,7 @@
C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C574A58012E66681002DFE98 /* PasteboardTypes.mm */; };
CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */; };
CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */; };
+ CD67D30E15C08F9A00843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD67D30815C07BE000843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp */; };
CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */; };
CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */; };
CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */; };
@@ -1935,6 +1936,8 @@
C574A58012E66681002DFE98 /* PasteboardTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardTypes.mm; sourceTree = "<group>"; };
CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageFullScreenClient.cpp; sourceTree = "<group>"; };
CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageFullScreenClient.h; sourceTree = "<group>"; };
+ CD67D30815C07BE000843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageDiagnosticLoggingClient.cpp; sourceTree = "<group>"; };
+ CD67D30915C07BE000843ADF /* InjectedBundlePageDiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageDiagnosticLoggingClient.h; sourceTree = "<group>"; };
CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebFullScreenManager.cpp; path = FullScreen/WebFullScreenManager.cpp; sourceTree = "<group>"; };
CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFullScreenManager.h; path = FullScreen/WebFullScreenManager.h; sourceTree = "<group>"; };
CD73BA39131A29FE00EEDED2 /* WebFullScreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebFullScreenManager.messages.in; path = FullScreen/WebFullScreenManager.messages.in; sourceTree = "<group>"; };
@@ -3243,6 +3246,8 @@
BC498616124D10E200D834E1 /* InjectedBundleHitTestResult.h */,
BC8147D412F66D31007B2C32 /* InjectedBundleNavigationAction.cpp */,
BC8147D312F66D31007B2C32 /* InjectedBundleNavigationAction.h */,
+ CD67D30815C07BE000843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp */,
+ CD67D30915C07BE000843ADF /* InjectedBundlePageDiagnosticLoggingClient.h */,
512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */,
512935E21288D97800A4B695 /* InjectedBundlePageContextMenuClient.h */,
E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */,
@@ -4951,6 +4956,7 @@
51FA2D7715212E2600C1BA0B /* WKBundleDOMWindowExtension.cpp in Sources */,
1A2A4B0E1586A2240090C9E9 /* ColorSpaceData.mm in Sources */,
3F87B9BD158940120090FF62 /* WebColorChooser.cpp in Sources */,
+ CD67D30E15C08F9A00843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2012-07-26 18:45:46 UTC (rev 123778)
@@ -124,6 +124,11 @@
#endif
}
+void WKBundlePageSetDiagnosticLoggingClient(WKBundlePageRef pageRef, WKBundlePageDiagnosticLoggingClient* client)
+{
+ toImpl(pageRef)->initializeInjectedBundleDiagnosticLoggingClient(client);
+}
+
WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef pageRef)
{
return toAPI(toImpl(pageRef)->pageGroup());
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -354,6 +354,18 @@
enum { kWKBundlePageFullScreenClientCurrentVersion = 1 };
+// MessageTrace client
+typedef void (*WKBundlePageDiagnosticLoggingCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef description, WKStringRef success, const void* clientInfo);
+
+struct WKBundlePageDiagnosticLoggingClient {
+ int version;
+ const void * clientInfo;
+ WKBundlePageDiagnosticLoggingCallback logDiagnosticMessage;
+};
+typedef struct WKBundlePageDiagnosticLoggingClient WKBundlePageDiagnosticLoggingClient;
+
+enum { kWKBundlePageDiagnosticLoggingClientCurrentVersion = 0 };
+
WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page);
WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page);
WK_EXPORT void WKBundlePageWillExitFullScreen(WKBundlePageRef page);
@@ -368,8 +380,8 @@
WK_EXPORT void WKBundlePageSetResourceLoadClient(WKBundlePageRef page, WKBundlePageResourceLoadClient* client);
WK_EXPORT void WKBundlePageSetPolicyClient(WKBundlePageRef page, WKBundlePagePolicyClient* client);
WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client);
-
WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClient* client);
+WK_EXPORT void WKBundlePageSetDiagnosticLoggingClient(WKBundlePageRef page, WKBundlePageDiagnosticLoggingClient* client);
WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page);
WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp (0 => 123778)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp 2012-07-26 18:45:46 UTC (rev 123778)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundlePageDiagnosticLoggingClient.h"
+
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
+
+namespace WebKit {
+
+void InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage(WebPage* page, const String& message, const String& description, const String& success)
+{
+ if (!m_client.logDiagnosticMessage)
+ return;
+ m_client.logDiagnosticMessage(toAPI(page), toCopiedAPI(message), toCopiedAPI(description), toCopiedAPI(success), m_client.clientInfo);
+}
+
+}
Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h (0 => 123778)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InjectedBundlePageDiagnosticLoggingClient_h
+#define InjectedBundlePageDiagnosticLoggingClient_h
+
+#include "APIClient.h"
+#include "WKBundlePage.h"
+#include <_javascript_Core/JSBase.h>
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class APIObject;
+class InjectedBundleHitTestResult;
+class WebContextMenuItemData;
+class WebPage;
+
+class InjectedBundlePageDiagnosticLoggingClient : public APIClient<WKBundlePageDiagnosticLoggingClient, kWKBundlePageDiagnosticLoggingClientCurrentVersion> {
+public:
+ void logDiagnosticMessage(WebPage*, const String& message, const String& description, const String& success);
+};
+
+} // namespace WebKit
+
+#endif // InjectedBundlePageDiagnosticLoggingClient_h
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2012-07-26 18:45:46 UTC (rev 123778)
@@ -773,4 +773,12 @@
m_page->numWheelEventHandlersChanged(count);
}
+void WebChromeClient::logDiagnosticMessage(const String& message, const String& description, const String& success)
+{
+ if (!m_page->corePage()->settings()->diagnosticLoggingEnabled())
+ return;
+
+ m_page->injectedBundleDiagnosticLoggingClient().logDiagnosticMessage(m_page, message, description, success);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -219,6 +219,8 @@
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE;
+ virtual void logDiagnosticMessage(const String& message, const String& description, const String& success) OVERRIDE;
+
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
mutable bool m_cachedMainFrameHasHorizontalScrollbar;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-07-26 18:45:46 UTC (rev 123778)
@@ -419,6 +419,11 @@
}
#endif
+void WebPage::initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClient* client)
+{
+ m_logDiagnosticMessageClient.initialize(client);
+}
+
PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
{
String pluginPath;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (123777 => 123778)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-07-26 18:45:46 UTC (rev 123778)
@@ -35,6 +35,7 @@
#if ENABLE(CONTEXT_MENUS)
#include "InjectedBundlePageContextMenuClient.h"
#endif
+#include "InjectedBundlePageDiagnosticLoggingClient.h"
#include "InjectedBundlePageEditorClient.h"
#include "InjectedBundlePageFormClient.h"
#include "InjectedBundlePageFullScreenClient.h"
@@ -248,6 +249,7 @@
#if ENABLE(FULLSCREEN_API)
void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
#endif
+ void initializeInjectedBundleDiagnosticLoggingClient(WKBundlePageDiagnosticLoggingClient*);
#if ENABLE(CONTEXT_MENUS)
InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
@@ -258,6 +260,7 @@
InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
+ InjectedBundlePageDiagnosticLoggingClient& injectedBundleDiagnosticLoggingClient() { return m_logDiagnosticMessageClient; }
#if ENABLE(FULLSCREEN_API)
InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
#endif
@@ -811,6 +814,7 @@
#if ENABLE(FULLSCREEN_API)
InjectedBundlePageFullScreenClient m_fullScreenClient;
#endif
+ InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient;
#if USE(TILED_BACKING_STORE)
WebCore::IntSize m_viewportSize;
Modified: trunk/Source/WebKit2/win/WebKit2.vcproj (123777 => 123778)
--- trunk/Source/WebKit2/win/WebKit2.vcproj 2012-07-26 18:27:02 UTC (rev 123777)
+++ trunk/Source/WebKit2/win/WebKit2.vcproj 2012-07-26 18:45:46 UTC (rev 123778)
@@ -2394,6 +2394,14 @@
>
</File>
<File
+ RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageDiagnosticLoggingClient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageDiagnosticLoggingClient.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageEditorClient.cpp"
>
</File>