Commit d19fa0b4 authored by bolsinga@apple.com's avatar bolsinga@apple.com

Add ENABLE(INSPECTOR)

https://bugs.webkit.org/show_bug.cgi?id=29260

Reviewed by David Kilzer.

JavaScriptCore:

* wtf/Platform.h:

WebCore:

No new tests. (No change in default behavior.)

* DerivedSources.make: Use new WebCore.Inspector.exp file if ENABLE_DRAG_SUPPORT.
* WebCore.base.exp: Move Inspector only exports to WebCore.Inspector.exp.
* WebCore.xcodeproj/project.pbxproj: Add WebCore.Inspector.exp.
* bindings/js/JSDOMWindowBase.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::JSDOMWindowBase::supportsProfiling):
* bindings/js/JSInspectedObjectWrapper.cpp: Wrap entire file in ENABLE(INSPECTOR).
* bindings/js/JSInspectorBackendCustom.cpp: Ditto.
* bindings/js/JSInspectorCallbackWrapper.cpp: Ditto.
* bindings/js/ScriptObject.cpp: Use ENABLE(INSPECTOR) where applicable.
* bindings/js/ScriptObject.h: Ditto.
* bindings/js/ScriptObjectQuarantine.cpp: Wrap entire file in ENABLE(INSPECTOR).
* dom/Document.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::Document::recalcStyle):
(WebCore::Document::addMessage):
(WebCore::Document::resourceRetrievedByXMLHttpRequest):
(WebCore::Document::scriptImported):
* dom/Document.h: Ditto.
* dom/Node.cpp: Ditto.
(WebCore::Node::dispatchGenericEvent):
* dom/ScriptExecutionContext.h: Ditto.
(WebCore::):
* html/HTMLDocument.cpp: Ditto.
(WebCore::HTMLDocument::createTokenizer):
* html/HTMLTokenizer.cpp: Ditto.
(WebCore::HTMLTokenizer::write):
* inspector/ConsoleMessage.cpp: Ditto.
(WebCore::ConsoleMessage::ConsoleMessage):
(WebCore::ConsoleMessage::isEqual):
* inspector/ConsoleMessage.h: Ditto.
* inspector/DOMDispatchTimelineItem.cpp: Wrap entire file in ENABLE(INSPECTOR).
* inspector/InspectorBackend.cpp: Ditto.
* inspector/InspectorController.cpp: Ditto.
* inspector/InspectorDOMAgent.cpp: Ditto.
* inspector/InspectorDOMStorageResource.cpp: Ditto.
* inspector/InspectorDatabaseResource.cpp: Ditto.
* inspector/InspectorFrontend.cpp: Ditto.
* inspector/InspectorResource.cpp: Ditto.
* inspector/InspectorTimelineAgent.cpp: Ditto.
* inspector/TimelineItem.cpp: Ditto.
* loader/FrameLoader.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::FrameLoader::dispatchWindowObjectAvailable):
(WebCore::FrameLoader::dispatchDidCommitLoad):
(WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest):
(WebCore::FrameLoader::dispatchWillSendRequest):
(WebCore::FrameLoader::dispatchDidReceiveResponse):
(WebCore::FrameLoader::dispatchDidReceiveContentLength):
(WebCore::FrameLoader::dispatchDidFinishLoading):
* page/Chrome.cpp: Ditto.
(WebCore::Chrome::mouseDidMoveOverElement):
* page/Console.cpp: Ditto.
(WebCore::Console::addMessage):
(WebCore::Console::count):
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
(WebCore::Console::time):
(WebCore::Console::timeEnd):
(WebCore::Console::group):
(WebCore::Console::groupEnd):
* page/ContextMenuController.cpp: Ditto.
(WebCore::ContextMenuController::handleContextMenuEvent):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp: Ditto.
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* page/EventHandler.cpp: Ditto.
(WebCore::EventHandler::handleMousePressEvent):
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::layout):
(WebCore::FrameView::paintContents):
* page/FrameView.h: Ditto.
* page/Page.cpp: Ditto.
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h: Ditto.
* platform/ContextMenu.cpp: Ditto.
(WebCore::ContextMenu::checkOrEnableIfNeeded):
* platform/ContextMenuItem.h: Ditto.
(WebCore::):
* storage/Database.cpp: Ditto.
(WebCore::Database::openDatabase):
* workers/WorkerContext.cpp: Ditto.
(WebCore::WorkerContext::importScripts):
* xml/XMLHttpRequest.cpp: Ditto.
(WebCore::XMLHttpRequest::didFinishLoading):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 08a4e0b1
2009-09-16 Greg Bolsinga <bolsinga@apple.com>
Add ENABLE(INSPECTOR)
https://bugs.webkit.org/show_bug.cgi?id=29260
Reviewed by David Kilzer.
* wtf/Platform.h:
2009-09-16 Greg Bolsinga <bolsinga@apple.com>
Add ENABLE(CONTEXT_MENUS)
......
......@@ -413,6 +413,7 @@
#define ENABLE_CONTEXT_MENUS 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_FTPDIR 1
#define ENABLE_INSPECTOR 0
#define ENABLE_MAC_JAVA_BRIDGE 0
#define ENABLE_ICONDATABASE 0
#define ENABLE_GEOLOCATION 1
......@@ -566,6 +567,10 @@
#define ENABLE_DASHBOARD_SUPPORT 0
#endif
#if !defined(ENABLE_INSPECTOR)
#define ENABLE_INSPECTOR 1
#endif
#if !defined(ENABLE_MAC_JAVA_BRIDGE)
#define ENABLE_MAC_JAVA_BRIDGE 0
#endif
......
2009-09-16 Greg Bolsinga <bolsinga@apple.com>
Add ENABLE(INSPECTOR)
https://bugs.webkit.org/show_bug.cgi?id=29260
Reviewed by David Kilzer.
No new tests. (No change in default behavior.)
* DerivedSources.make: Use new WebCore.Inspector.exp file if ENABLE_DRAG_SUPPORT.
* WebCore.base.exp: Move Inspector only exports to WebCore.Inspector.exp.
* WebCore.xcodeproj/project.pbxproj: Add WebCore.Inspector.exp.
* bindings/js/JSDOMWindowBase.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::JSDOMWindowBase::supportsProfiling):
* bindings/js/JSInspectedObjectWrapper.cpp: Wrap entire file in ENABLE(INSPECTOR).
* bindings/js/JSInspectorBackendCustom.cpp: Ditto.
* bindings/js/JSInspectorCallbackWrapper.cpp: Ditto.
* bindings/js/ScriptObject.cpp: Use ENABLE(INSPECTOR) where applicable.
* bindings/js/ScriptObject.h: Ditto.
* bindings/js/ScriptObjectQuarantine.cpp: Wrap entire file in ENABLE(INSPECTOR).
* dom/Document.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::Document::recalcStyle):
(WebCore::Document::addMessage):
(WebCore::Document::resourceRetrievedByXMLHttpRequest):
(WebCore::Document::scriptImported):
* dom/Document.h: Ditto.
* dom/Node.cpp: Ditto.
(WebCore::Node::dispatchGenericEvent):
* dom/ScriptExecutionContext.h: Ditto.
(WebCore::):
* html/HTMLDocument.cpp: Ditto.
(WebCore::HTMLDocument::createTokenizer):
* html/HTMLTokenizer.cpp: Ditto.
(WebCore::HTMLTokenizer::write):
* inspector/ConsoleMessage.cpp: Ditto.
(WebCore::ConsoleMessage::ConsoleMessage):
(WebCore::ConsoleMessage::isEqual):
* inspector/ConsoleMessage.h: Ditto.
* inspector/DOMDispatchTimelineItem.cpp: Wrap entire file in ENABLE(INSPECTOR).
* inspector/InspectorBackend.cpp: Ditto.
* inspector/InspectorController.cpp: Ditto.
* inspector/InspectorDOMAgent.cpp: Ditto.
* inspector/InspectorDOMStorageResource.cpp: Ditto.
* inspector/InspectorDatabaseResource.cpp: Ditto.
* inspector/InspectorFrontend.cpp: Ditto.
* inspector/InspectorResource.cpp: Ditto.
* inspector/InspectorTimelineAgent.cpp: Ditto.
* inspector/TimelineItem.cpp: Ditto.
* loader/FrameLoader.cpp: Use ENABLE(INSPECTOR) where applicable.
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::FrameLoader::dispatchWindowObjectAvailable):
(WebCore::FrameLoader::dispatchDidCommitLoad):
(WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest):
(WebCore::FrameLoader::dispatchWillSendRequest):
(WebCore::FrameLoader::dispatchDidReceiveResponse):
(WebCore::FrameLoader::dispatchDidReceiveContentLength):
(WebCore::FrameLoader::dispatchDidFinishLoading):
* page/Chrome.cpp: Ditto.
(WebCore::Chrome::mouseDidMoveOverElement):
* page/Console.cpp: Ditto.
(WebCore::Console::addMessage):
(WebCore::Console::count):
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
(WebCore::Console::time):
(WebCore::Console::timeEnd):
(WebCore::Console::group):
(WebCore::Console::groupEnd):
* page/ContextMenuController.cpp: Ditto.
(WebCore::ContextMenuController::handleContextMenuEvent):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp: Ditto.
(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):
* page/EventHandler.cpp: Ditto.
(WebCore::EventHandler::handleMousePressEvent):
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::layout):
(WebCore::FrameView::paintContents):
* page/FrameView.h: Ditto.
* page/Page.cpp: Ditto.
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h: Ditto.
* platform/ContextMenu.cpp: Ditto.
(WebCore::ContextMenu::checkOrEnableIfNeeded):
* platform/ContextMenuItem.h: Ditto.
(WebCore::):
* storage/Database.cpp: Ditto.
(WebCore::Database::openDatabase):
* workers/WorkerContext.cpp: Ditto.
(WebCore::WorkerContext::importScripts):
* xml/XMLHttpRequest.cpp: Ditto.
(WebCore::XMLHttpRequest::didFinishLoading):
2009-09-16 Greg Bolsinga <bolsinga@apple.com>
Add ENABLE(CONTEXT_MENUS)
......@@ -476,6 +476,12 @@ else
ENABLE_DRAG_SUPPORT = 0
endif
ifeq ($(shell gcc -E -P -dM -F $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_FLAGS) WebCore/ForwardingHeaders/wtf/Platform.h | grep ENABLE_INSPECTOR | cut -d' ' -f3), 1)
ENABLE_INSPECTOR = 1
else
ENABLE_INSPECTOR = 0
endif
# CSS property names and value keywords
WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in
......@@ -782,6 +788,10 @@ ifeq ($(ENABLE_DRAG_SUPPORT), 1)
WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.DragSupport.exp
endif
ifeq ($(ENABLE_INSPECTOR), 1)
WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.Inspector.exp
endif
ifeq ($(findstring 10.4,$(MACOSX_DEPLOYMENT_TARGET)), 10.4)
WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.Tiger.exp
endif
......
__ZN7WebCore19InspectorController10setSettingERKNS_6StringERKNS0_7SettingE
__ZN7WebCore19InspectorController12attachWindowEv
__ZN7WebCore19InspectorController12detachWindowEv
__ZN7WebCore19InspectorController14enableDebuggerEv
__ZN7WebCore19InspectorController14enableProfilerEbb
__ZN7WebCore19InspectorController15disableDebuggerEb
__ZN7WebCore19InspectorController15disableProfilerEb
__ZN7WebCore19InspectorController16setWindowVisibleEbb
__ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
__ZN7WebCore19InspectorController27startUserInitiatedProfilingEPNS_5TimerIS0_EE
__ZN7WebCore19InspectorController4showEv
__ZN7WebCore19InspectorController5closeEv
__ZN7WebCore19InspectorController7inspectEPNS_4NodeE
__ZN7WebCore19InspectorController9showPanelENS0_13SpecialPanelsE
__ZNK7WebCore19InspectorController17drawNodeHighlightERNS_15GraphicsContextE
__ZNK7WebCore19InspectorController7enabledEv
__ZNK7WebCore19InspectorController7settingERKNS_6StringE
......@@ -394,20 +394,6 @@ __ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd
__ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
__ZN7WebCore19InspectorController10setSettingERKNS_6StringERKNS0_7SettingE
__ZN7WebCore19InspectorController12attachWindowEv
__ZN7WebCore19InspectorController12detachWindowEv
__ZN7WebCore19InspectorController14enableDebuggerEv
__ZN7WebCore19InspectorController14enableProfilerEbb
__ZN7WebCore19InspectorController15disableDebuggerEb
__ZN7WebCore19InspectorController15disableProfilerEb
__ZN7WebCore19InspectorController16setWindowVisibleEbb
__ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
__ZN7WebCore19InspectorController27startUserInitiatedProfilingEPNS_5TimerIS0_EE
__ZN7WebCore19InspectorController4showEv
__ZN7WebCore19InspectorController5closeEv
__ZN7WebCore19InspectorController7inspectEPNS_4NodeE
__ZN7WebCore19InspectorController9showPanelENS0_13SpecialPanelsE
__ZN7WebCore19SelectionController10setFocusedEb
__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbb
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
......@@ -850,9 +836,6 @@ __ZNK7WebCore16VisibleSelection23isContentRichlyEditableEv
__ZNK7WebCore16VisibleSelection5isAllENS_21StayInEditableContentE
__ZNK7WebCore17ResourceErrorBase8lazyInitEv
__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEv
__ZNK7WebCore19InspectorController17drawNodeHighlightERNS_15GraphicsContextE
__ZNK7WebCore19InspectorController7enabledEv
__ZNK7WebCore19InspectorController7settingERKNS_6StringE
__ZNK7WebCore19ResourceRequestBase10httpMethodEv
__ZNK7WebCore19ResourceRequestBase3urlEv
__ZNK7WebCore19ResourceRequestBase7isEmptyEv
......
......@@ -9815,6 +9815,7 @@
F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
F9F0ED780DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLHttpRequestProgressEvent.idl; sourceTree = "<group>"; };
FE49BD301061719100D0E1AE /* WebCore.Inspector.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.Inspector.exp; sourceTree = "<group>"; };
FE49EF970DC51462004266E1 /* DashboardSupportCSSPropertyNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DashboardSupportCSSPropertyNames.in; sourceTree = "<group>"; };
FE6FD4850F676E5700092873 /* Coordinates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Coordinates.h; sourceTree = "<group>"; };
FE6FD4860F676E5700092873 /* Coordinates.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Coordinates.idl; sourceTree = "<group>"; };
......@@ -10445,6 +10446,7 @@
FEFD102C105C41470002855E /* WebCore.ContextMenus.exp */,
4491959D0FBE17D700D9F824 /* WebCore.DashboardSupport.exp */,
FEA4133F105D67AE0007236F /* WebCore.DragSupport.exp */,
FE49BD301061719100D0E1AE /* WebCore.Inspector.exp */,
4491959C0FBE17D700D9F824 /* WebCore.JNI.exp */,
4491959B0FBE17D700D9F824 /* WebCore.LP64.exp */,
4491959A0FBE17D700D9F824 /* WebCore.NPAPI.exp */,
......@@ -113,7 +113,7 @@ ExecState* JSDOMWindowBase::globalExec()
bool JSDOMWindowBase::supportsProfiling() const
{
#if !ENABLE(JAVASCRIPT_DEBUGGER)
#if !ENABLE(JAVASCRIPT_DEBUGGER) || !ENABLE(INSPECTOR)
return false;
#else
Frame* frame = impl()->frame();
......
......@@ -26,6 +26,8 @@
#include "config.h"
#include "JSInspectedObjectWrapper.h"
#if ENABLE(INSPECTOR)
#include "JSInspectorCallbackWrapper.h"
#include <runtime/JSGlobalObject.h>
#include <wtf/StdLibExtras.h>
......@@ -125,3 +127,5 @@ JSValue JSInspectedObjectWrapper::prepareIncomingValue(ExecState*, JSValue value
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -33,6 +33,8 @@
#include "config.h"
#include "JSInspectorBackend.h"
#if ENABLE(INSPECTOR)
#include "Console.h"
#if ENABLE(DATABASE)
#include "Database.h"
......@@ -364,3 +366,5 @@ JSValue JSInspectorBackend::selectDOMStorage(ExecState*, const ArgList& args)
#endif
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -26,6 +26,8 @@
#include "config.h"
#include "JSInspectorCallbackWrapper.h"
#if ENABLE(INSPECTOR)
#include "JSInspectedObjectWrapper.h"
#include <wtf/StdLibExtras.h>
......@@ -105,3 +107,5 @@ JSValue JSInspectorCallbackWrapper::prepareIncomingValue(ExecState* unwrappedExe
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -124,6 +124,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
return handleException(scriptState);
}
#if ENABLE(INSPECTOR)
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)
{
JSLock lock(SilenceAssertionsOnly);
......@@ -131,6 +132,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect
globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
return handleException(scriptState);
}
#endif // ENABLE(INSPECTOR)
bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptObject& value)
{
......
......@@ -63,7 +63,9 @@ namespace WebCore {
class ScriptGlobalObject {
public:
static bool set(ScriptState*, const char* name, const ScriptObject&);
#if ENABLE(INSPECTOR)
static bool set(ScriptState*, const char* name, InspectorBackend*);
#endif
static bool get(ScriptState*, const char* name, ScriptObject&);
static bool remove(ScriptState*, const char* name);
private:
......
......@@ -31,6 +31,8 @@
#include "config.h"
#include "ScriptObjectQuarantine.h"
#if ENABLE(INSPECTOR)
#include "Document.h"
#include "Frame.h"
#include "JSDOMBinding.h"
......@@ -125,3 +127,5 @@ bool getQuarantinedScriptObject(DOMWindow* domWindow, ScriptObject& quarantinedO
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -1214,9 +1214,11 @@ void Document::recalcStyle(StyleChange change)
if (m_inStyleRecalc)
return; // Guard against re-entrancy. -dwh
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willRecalculateStyle();
#endif
m_inStyleRecalc = true;
suspendPostAttachCallbacks();
......@@ -1291,8 +1293,10 @@ bail_out:
implicitClose();
}
#if ENABLE(INSPECTOR)
if (timelineAgent)
timelineAgent->didRecalculateStyle();
#endif
}
void Document::updateStyleIfNeeded()
......@@ -4474,10 +4478,12 @@ void Document::reportException(const String& errorMessage, int lineNumber, const
void Document::addMessage(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
{
switch (destination) {
#if ENABLE(INSPECTOR)
case InspectorControllerDestination:
if (page())
page()->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
return;
#endif
case ConsoleDestination:
if (DOMWindow* window = domWindow())
window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
......@@ -4488,8 +4494,10 @@ void Document::addMessage(MessageDestination destination, MessageSource source,
void Document::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
{
#if ENABLE(INSPECTOR)
if (page())
page()->inspectorController()->resourceRetrievedByXMLHttpRequest(identifier, sourceString);
#endif
Frame* frame = this->frame();
if (frame) {
FrameLoader* frameLoader = frame->loader();
......@@ -4499,8 +4507,13 @@ void Document::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const
void Document::scriptImported(unsigned long identifier, const String& sourceString)
{
#if ENABLE(INSPECTOR)
if (page())
page()->inspectorController()->scriptImported(identifier, sourceString);
#else
UNUSED_PARAM(identifier);
UNUSED_PARAM(sourceString);
#endif
}
class ScriptExecutionContextTaskTimer : public TimerBase {
......
......@@ -377,7 +377,9 @@ public:
Frame* frame() const { return m_frame; } // can be NULL
Page* page() const; // can be NULL
Settings* settings() const; // can be NULL
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
#endif
PassRefPtr<Range> createRange();
......@@ -1114,9 +1116,11 @@ inline bool Node::isDocumentNode() const
return this == m_document;
}
#if ENABLE(INSPECTOR)
inline InspectorTimelineAgent* Document::inspectorTimelineAgent() const {
return page() ? page()->inspectorTimelineAgent() : 0;
}
#endif
} // namespace WebCore
......
......@@ -2528,9 +2528,11 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
ASSERT(event->target());
ASSERT(!event->type().isNull()); // JavaScript code can create an event with an empty name, but not null.
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willDispatchDOMEvent(*event);
#endif
// Make a vector of ancestors to send the event to.
// If the node is not in a document just send the event to it.
......@@ -2643,8 +2645,10 @@ doneDispatching:
}
doneWithDefault:
#if ENABLE(INSPECTOR)
if (timelineAgent)
timelineAgent->didDispatchDOMEvent();
#endif
Document::updateStyleForAllDocuments();
......
......@@ -44,7 +44,9 @@ namespace WebCore {
class String;
enum MessageDestination {
#if ENABLE(INSPECTOR)
InspectorControllerDestination,
#endif
ConsoleDestination,
};
......
......@@ -284,8 +284,10 @@ void HTMLDocument::releaseEvents()
Tokenizer *HTMLDocument::createTokenizer()
{
bool reportErrors = false;
#if ENABLE(INSPECTOR)
if (Page* page = this->page())
reportErrors = page->inspectorController()->windowVisible();
#endif
return new HTMLTokenizer(this, reportErrors);
}
......
......@@ -1662,9 +1662,11 @@ void HTMLTokenizer::write(const SegmentedString& str, bool appendData)
int processedCount = 0;
double startTime = currentTime();
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willWriteHTML();
#endif
Frame* frame = m_doc->frame();
......@@ -1787,8 +1789,10 @@ void HTMLTokenizer::write(const SegmentedString& str, bool appendData)
printf("Ending write at time %d\n", m_doc->elapsedTime());
#endif
#if ENABLE(INSPECTOR)
if (timelineAgent)
timelineAgent->didWriteHTML();
#endif
m_inWrite = wasInWrite;
......
......@@ -54,7 +54,9 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, S
: m_source(s)
, m_type(t)
, m_level(l)
#if ENABLE(INSPECTOR)
, m_wrappedArguments(callStack->at(0).argumentCount())
#endif
, m_frames(storeTrace ? callStack->size() : 0)
, m_groupLevel(g)
, m_repeatCount(1)
......@@ -71,10 +73,13 @@ ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, S
m_frames[i] = callStack->at(i).functionName();
}
#if ENABLE(INSPECTOR)
for (unsigned i = 0; i < lastCaller.argumentCount(); ++i)
m_wrappedArguments[i] = quarantineValue(callStack->state(), lastCaller.argumentAt(i));
#endif
}
#if ENABLE(INSPECTOR)
void ConsoleMessage::addToConsole(InspectorFrontend* frontend)
{
ScriptObject jsonObj = frontend->newScriptObject();
......@@ -87,9 +92,11 @@ void ConsoleMessage::addToConsole(InspectorFrontend* frontend)
jsonObj.set("repeatCount", static_cast<int>(m_repeatCount));
frontend->addMessageToConsole(jsonObj, m_frames, m_wrappedArguments, m_message);
}
#endif // ENABLE(INSPECTOR)
bool ConsoleMessage::isEqual(ScriptState* state, ConsoleMessage* msg) const
{
#if ENABLE(INSPECTOR)
if (msg->m_wrappedArguments.size() != m_wrappedArguments.size())
return false;
if (!state && msg->m_wrappedArguments.size())
......@@ -101,6 +108,9 @@ bool ConsoleMessage::isEqual(ScriptState* state, ConsoleMessage* msg) const
if (!m_wrappedArguments[i].isEqual(state, msg->m_wrappedArguments[i]))
return false;
}
#else
UNUSED_PARAM(state);
#endif // ENABLE(INSPECTOR)
size_t frameCount = msg->m_frames.size();
if (frameCount != m_frames.size())
......
......@@ -47,7 +47,9 @@ namespace WebCore {
ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);
ConsoleMessage(MessageSource, MessageType, MessageLevel, ScriptCallStack*, unsigned g, bool storeTrace = false);
#if ENABLE(INSPECTOR)
void addToConsole(InspectorFrontend* frontend);
#endif
void incrementCount() { ++m_repeatCount; };
bool isEqual(ScriptState*, ConsoleMessage* msg) const;
......@@ -59,7 +61,9 @@ namespace WebCore {
MessageType m_type;
MessageLevel m_level;
String m_message;
#if ENABLE(INSPECTOR)
Vector<ScriptValue> m_wrappedArguments;
#endif
Vector<ScriptString> m_frames;
unsigned m_line;
String m_url;
......
......@@ -31,6 +31,8 @@
#include "config.h"
#include "DOMDispatchTimelineItem.h"
#if ENABLE(INSPECTOR)
#include "Event.h"
#include "InspectorFrontend.h"
......@@ -53,3 +55,4 @@ ScriptObject DOMDispatchTimelineItem::convertToScriptObject(InspectorFrontend* f
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -30,6 +30,8 @@
#include "config.h"
#include "InspectorBackend.h"
#if ENABLE(INSPECTOR)
#if ENABLE(DATABASE)
#include "Database.h"
#endif
......@@ -520,3 +522,5 @@ InspectorFrontend* InspectorBackend::inspectorFrontend()
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -30,6 +30,8 @@
#include "config.h"
#include "InspectorController.h"
#if ENABLE(INSPECTOR)
#include "CString.h"
#include "CachedResource.h"
#include "Console.h"
......@@ -1564,3 +1566,5 @@ void InspectorController::deleteCookie(const String& cookieName)
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -31,6 +31,8 @@
#include "config.h"
#include "InspectorDOMAgent.h"
#if ENABLE(INSPECTOR)
#include "AtomicString.h"
#include "ContainerNode.h"
#include "Cookie.h"
......@@ -555,3 +557,5 @@ bool InspectorDOMAgent::operator==(const EventListener& listener)
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -29,7 +29,8 @@
*/
#include "config.h"
#if ENABLE(DOM_STORAGE)
#if ENABLE(DOM_STORAGE) && ENABLE(INSPECTOR)
#include "InspectorDOMStorageResource.h"
......@@ -80,4 +81,5 @@ void InspectorDOMStorageResource::unbind()
} // namespace WebCore
#endif
#endif // ENABLE(DOM_STORAGE) && ENABLE(INSPECTOR)
......@@ -29,9 +29,9 @@
*/
#include "config.h"
#if ENABLE(DATABASE)
#include "InspectorDatabaseResource.h"
#if ENABLE(DATABASE) && ENABLE(INSPECTOR)
#include "Database.h"
#include "Document.h"
#include "Frame.h"
......@@ -39,7 +39,6 @@
#include "ScriptObject.h"
#include "ScriptObjectQuarantine.h"
namespace WebCore {
InspectorDatabaseResource::InspectorDatabaseResource(Database* database, const String& domain, const String& name, const String& version)
......@@ -75,4 +74,4 @@ void InspectorDatabaseResource::unbind()
} // namespace WebCore
#endif // ENABLE(DATABASE)
#endif // ENABLE(DATABASE) && ENABLE(INSPECTOR)
......@@ -30,6 +30,8 @@
#include "config.h"
#include "InspectorFrontend.h"
#if ENABLE(INSPECTOR)
#include "ConsoleMessage.h"
#include "Frame.h"
#include "InspectorController.h"
......@@ -430,3 +432,5 @@ void InspectorFrontend::callSimpleFunction(const String& functionName)
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -31,6 +31,8 @@
#include "config.h"
#include "InspectorResource.h"
#if ENABLE(INSPECTOR)
#include "CachedResource.h"
#include "DocLoader.h"
#include "DocumentLoader.h"
......@@ -330,3 +332,5 @@ void InspectorResource::addLength(int lengthReceived)
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -31,6 +31,8 @@
#include "config.h"
#include "InspectorTimelineAgent.h"
#if ENABLE(INSPECTOR)
#include "DOMDispatchTimelineItem.h"
#include "Event.h"
#include "InspectorFrontend.h"
......@@ -136,3 +138,5 @@ double InspectorTimelineAgent::sessionTimeInMilliseconds()
}
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
......@@ -31,6 +31,8 @@
#include "config.h"
#include "TimelineItem.h"
#if ENABLE(INSPECTOR)
#include "InspectorFrontend.h"
#include "ScriptArray.h"