diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-09-20 14:01:09 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-09-20 14:01:09 +0200 |
commit | 6dbcd09121fe266c7704a524b5cbd7f2754659c0 (patch) | |
tree | 5ae0d16cec0cc61f576d51c57b3a4613c7e91e22 /Source/WebCore/inspector | |
parent | 6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 (diff) | |
download | qtwebkit-6dbcd09121fe266c7704a524b5cbd7f2754659c0.tar.gz |
Imported WebKit commit 080af0beaa6f0ba8ff8f44cb8bd8b5dcf75ac0af (http://svn.webkit.org/repository/webkit/trunk@129119)
New snapshot with prospective build fix for incorrect QtWebKit master module header file creation
Diffstat (limited to 'Source/WebCore/inspector')
30 files changed, 202 insertions, 178 deletions
diff --git a/Source/WebCore/inspector/CodeGeneratorInspector.py b/Source/WebCore/inspector/CodeGeneratorInspector.py index dd9cb11a1..6f4d1f701 100755 --- a/Source/WebCore/inspector/CodeGeneratorInspector.py +++ b/Source/WebCore/inspector/CodeGeneratorInspector.py @@ -46,7 +46,6 @@ DOMAIN_DEFINE_NAME_MAP = { "IndexedDB": "INDEXED_DATABASE", "Profiler": "JAVASCRIPT_DEBUGGER", "Worker": "WORKERS", - "WebGL": "WEBGL", } @@ -58,7 +57,7 @@ TYPE_NAME_FIX_MAP = { TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", - "Debugger.FunctionDetails", "Debugger.CallFrame", "WebGL.TraceLog", + "Debugger.FunctionDetails", "Debugger.CallFrame", "Canvas.TraceLog", # This should be a temporary hack. TimelineEvent should be created via generated C++ API. "Timeline.TimelineEvent"]) diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp b/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp index b53be9214..db278d976 100644 --- a/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp +++ b/Source/WebCore/inspector/InjectedScriptCanvasModule.cpp @@ -30,36 +30,37 @@ #include "config.h" -#if ENABLE(INSPECTOR) && ENABLE(WEBGL) +#if ENABLE(INSPECTOR) -#include "InjectedScriptWebGLModule.h" +#include "InjectedScriptCanvasModule.h" #include "InjectedScript.h" +#include "InjectedScriptCanvasModuleSource.h" #include "InjectedScriptManager.h" -#include "InjectedScriptWebGLModuleSource.h" #include "ScriptFunctionCall.h" #include "ScriptObject.h" namespace WebCore { -InjectedScriptWebGLModule::InjectedScriptWebGLModule() - : InjectedScriptModule("InjectedScriptWebGLModule") +InjectedScriptCanvasModule::InjectedScriptCanvasModule() + : InjectedScriptModule("InjectedScriptCanvasModule") { } -InjectedScriptWebGLModule InjectedScriptWebGLModule::moduleForState(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState) +InjectedScriptCanvasModule InjectedScriptCanvasModule::moduleForState(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState) { - InjectedScriptWebGLModule result; + InjectedScriptCanvasModule result; result.ensureInjected(injectedScriptManager, scriptState); return result; } -String InjectedScriptWebGLModule::source() const +String InjectedScriptCanvasModule::source() const { - return String(reinterpret_cast<const char*>(InjectedScriptWebGLModuleSource_js), sizeof(InjectedScriptWebGLModuleSource_js)); + return String(reinterpret_cast<const char*>(InjectedScriptCanvasModuleSource_js), sizeof(InjectedScriptCanvasModuleSource_js)); } -ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glContext) +#if ENABLE(WEBGL) +ScriptObject InjectedScriptCanvasModule::wrapWebGLContext(const ScriptObject& glContext) { ScriptFunctionCall function(injectedScriptObject(), "wrapWebGLContext"); function.appendArgument(glContext); @@ -71,8 +72,9 @@ ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glC } return ScriptObject(glContext.scriptState(), resultValue); } +#endif // ENABLE(WEBGL) -void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* traceLogId) +void InjectedScriptCanvasModule::captureFrame(ErrorString* errorString, String* traceLogId) { ScriptFunctionCall function(injectedScriptObject(), "captureFrame"); RefPtr<InspectorValue> resultValue; @@ -81,7 +83,7 @@ void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* t *errorString = "Internal error: captureFrame"; } -void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const String& traceLogId) +void InjectedScriptCanvasModule::dropTraceLog(ErrorString* errorString, const String& traceLogId) { ScriptFunctionCall function(injectedScriptObject(), "dropTraceLog"); function.appendArgument(traceLogId); @@ -92,7 +94,7 @@ void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const Str *errorString = "Internal error: dropTraceLog"; } -void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>* traceLog) +void InjectedScriptCanvasModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::Canvas::TraceLog>* traceLog) { ScriptFunctionCall function(injectedScriptObject(), "traceLog"); function.appendArgument(traceLogId); @@ -103,10 +105,10 @@ void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String& *errorString = "Internal error: traceLog"; return; } - *traceLog = TypeBuilder::WebGL::TraceLog::runtimeCast(resultValue); + *traceLog = TypeBuilder::Canvas::TraceLog::runtimeCast(resultValue); } -void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result) +void InjectedScriptCanvasModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result) { ScriptFunctionCall function(injectedScriptObject(), "replayTraceLog"); function.appendArgument(traceLogId); @@ -119,4 +121,4 @@ void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const S } // namespace WebCore -#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL) +#endif // ENABLE(INSPECTOR) diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModule.h b/Source/WebCore/inspector/InjectedScriptCanvasModule.h index cff857fd8..4de223660 100644 --- a/Source/WebCore/inspector/InjectedScriptWebGLModule.h +++ b/Source/WebCore/inspector/InjectedScriptCanvasModule.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InjectedScriptWebGLModule_h -#define InjectedScriptWebGLModule_h +#ifndef InjectedScriptCanvasModule_h +#define InjectedScriptCanvasModule_h #include "InjectedScriptModule.h" #include "ScriptState.h" @@ -40,20 +40,23 @@ namespace WebCore { class InjectedScriptManager; class ScriptObject; -#if ENABLE(INSPECTOR) && ENABLE(WEBGL) +#if ENABLE(INSPECTOR) -class InjectedScriptWebGLModule : public InjectedScriptModule { +class InjectedScriptCanvasModule : public InjectedScriptModule { public: - InjectedScriptWebGLModule(); + InjectedScriptCanvasModule(); virtual String source() const; - static InjectedScriptWebGLModule moduleForState(InjectedScriptManager*, ScriptState*); + static InjectedScriptCanvasModule moduleForState(InjectedScriptManager*, ScriptState*); +#if ENABLE(WEBGL) ScriptObject wrapWebGLContext(const ScriptObject& glContext); +#endif + void captureFrame(ErrorString*, String*); void dropTraceLog(ErrorString*, const String&); - void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>*); + void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::TraceLog>*); void replayTraceLog(ErrorString*, const String&, int, String*); }; @@ -61,4 +64,4 @@ public: } // namespace WebCore -#endif +#endif // !defined(InjectedScriptCanvasModule_h) diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js b/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js index 6780af3c4..6780af3c4 100644 --- a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js +++ b/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js diff --git a/Source/WebCore/inspector/Inspector.json b/Source/WebCore/inspector/Inspector.json index f1137c78d..5c18dad95 100644 --- a/Source/WebCore/inspector/Inspector.json +++ b/Source/WebCore/inspector/Inspector.json @@ -1588,7 +1588,8 @@ { "name": "isAttribute", "type": "boolean", "description": "<code>EventListener</code>'s isAttribute." }, { "name": "nodeId", "$ref": "NodeId", "description": "Target <code>DOMNode</code> id." }, { "name": "handlerBody", "type": "string", "description": "Event handler function body." }, - { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." } + { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." }, + { "name": "sourceName", "type": "string", "optional": true, "description": "Source script URL." } ], "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type." }, @@ -3068,7 +3069,7 @@ ] }, { - "domain": "WebGL", + "domain": "Canvas", "hidden": true, "types": [ { @@ -3100,11 +3101,11 @@ "commands": [ { "name": "enable", - "description": "Enables WebGL inspection." + "description": "Enables Canvas inspection." }, { "name": "disable", - "description": "Disables WebGL inspection." + "description": "Disables Canvas inspection." }, { "name": "dropTraceLog", diff --git a/Source/WebCore/inspector/InspectorAllInOne.cpp b/Source/WebCore/inspector/InspectorAllInOne.cpp index db3f82cbe..d19ad2e0a 100644 --- a/Source/WebCore/inspector/InspectorAllInOne.cpp +++ b/Source/WebCore/inspector/InspectorAllInOne.cpp @@ -32,12 +32,15 @@ #include "IdentifiersFactory.cpp" #include "InjectedScript.cpp" #include "InjectedScriptBase.cpp" +#include "InjectedScriptCanvasModule.cpp" #include "InjectedScriptHost.cpp" #include "InjectedScriptManager.cpp" +#include "InjectedScriptModule.cpp" #include "InspectorAgent.cpp" #include "InspectorApplicationCacheAgent.cpp" #include "InspectorBaseAgent.cpp" #include "InspectorCSSAgent.cpp" +#include "InspectorCanvasAgent.cpp" #include "InspectorClient.cpp" #include "InspectorConsoleAgent.cpp" #include "InspectorController.cpp" @@ -66,7 +69,6 @@ #include "InspectorStyleTextEditor.cpp" #include "InspectorTimelineAgent.cpp" #include "InspectorValues.cpp" -#include "InspectorWebGLAgent.cpp" #include "InspectorWorkerAgent.cpp" #include "InstrumentingAgents.cpp" #include "MemoryInstrumentationImpl.cpp" diff --git a/Source/WebCore/inspector/InspectorWebGLAgent.cpp b/Source/WebCore/inspector/InspectorCanvasAgent.cpp index 16ffbcfa4..dff293845 100644 --- a/Source/WebCore/inspector/InspectorWebGLAgent.cpp +++ b/Source/WebCore/inspector/InspectorCanvasAgent.cpp @@ -30,13 +30,13 @@ #include "config.h" -#if ENABLE(INSPECTOR) && ENABLE(WEBGL) +#if ENABLE(INSPECTOR) -#include "InspectorWebGLAgent.h" +#include "InspectorCanvasAgent.h" #include "InjectedScript.h" +#include "InjectedScriptCanvasModule.h" #include "InjectedScriptManager.h" -#include "InjectedScriptWebGLModule.h" #include "InspectorFrontend.h" #include "InspectorState.h" #include "InstrumentingAgents.h" @@ -46,69 +46,69 @@ namespace WebCore { -namespace WebGLAgentState { -static const char webGLAgentEnabled[] = "webGLAgentEnabled"; +namespace CanvasAgentState { +static const char canvasAgentEnabled[] = "canvasAgentEnabled"; }; -InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager) - : InspectorBaseAgent<InspectorWebGLAgent>("WebGL", instrumentingAgents, state) +InspectorCanvasAgent::InspectorCanvasAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager) + : InspectorBaseAgent<InspectorCanvasAgent>("Canvas", instrumentingAgents, state) , m_inspectedPage(page) , m_injectedScriptManager(injectedScriptManager) , m_frontend(0) , m_enabled(false) { - m_instrumentingAgents->setInspectorWebGLAgent(this); + m_instrumentingAgents->setInspectorCanvasAgent(this); } -InspectorWebGLAgent::~InspectorWebGLAgent() +InspectorCanvasAgent::~InspectorCanvasAgent() { - m_instrumentingAgents->setInspectorWebGLAgent(0); + m_instrumentingAgents->setInspectorCanvasAgent(0); } -void InspectorWebGLAgent::setFrontend(InspectorFrontend* frontend) +void InspectorCanvasAgent::setFrontend(InspectorFrontend* frontend) { ASSERT(frontend); - m_frontend = frontend->webgl(); + m_frontend = frontend->canvas(); } -void InspectorWebGLAgent::clearFrontend() +void InspectorCanvasAgent::clearFrontend() { m_frontend = 0; disable(0); } -void InspectorWebGLAgent::restore() +void InspectorCanvasAgent::restore() { - m_enabled = m_state->getBoolean(WebGLAgentState::webGLAgentEnabled); + m_enabled = m_state->getBoolean(CanvasAgentState::canvasAgentEnabled); } -void InspectorWebGLAgent::enable(ErrorString*) +void InspectorCanvasAgent::enable(ErrorString*) { if (m_enabled) return; m_enabled = true; - m_state->setBoolean(WebGLAgentState::webGLAgentEnabled, m_enabled); + m_state->setBoolean(CanvasAgentState::canvasAgentEnabled, m_enabled); } -void InspectorWebGLAgent::disable(ErrorString*) +void InspectorCanvasAgent::disable(ErrorString*) { if (!m_enabled) return; m_enabled = false; - m_state->setBoolean(WebGLAgentState::webGLAgentEnabled, m_enabled); + m_state->setBoolean(CanvasAgentState::canvasAgentEnabled, m_enabled); } -void InspectorWebGLAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId) +void InspectorCanvasAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId) { - InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId); + InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId); if (!module.hasNoValue()) module.dropTraceLog(errorString, traceLogId); } -void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLogId) +void InspectorCanvasAgent::captureFrame(ErrorString* errorString, String* traceLogId) { ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame()); - InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, scriptState); + InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, scriptState); if (module.hasNoValue()) { *errorString = "Inspected frame has gone"; return; @@ -116,50 +116,52 @@ void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLo module.captureFrame(errorString, traceLogId); } -void InspectorWebGLAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>& traceLog) +void InspectorCanvasAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::Canvas::TraceLog>& traceLog) { - InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId); + InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId); if (!module.hasNoValue()) module.traceLog(errorString, traceLogId, &traceLog); } -void InspectorWebGLAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result) +void InspectorCanvasAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result) { - InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId); + InjectedScriptCanvasModule module = injectedScriptCanvasModuleForTraceLogId(errorString, traceLogId); if (!module.hasNoValue()) module.replayTraceLog(errorString, traceLogId, stepNo, result); } -ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext) +#if ENABLE(WEBGL) +ScriptObject InspectorCanvasAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext) { if (glContext.hasNoValue()) { ASSERT_NOT_REACHED(); return ScriptObject(); } - InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, glContext.scriptState()); + InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, glContext.scriptState()); if (module.hasNoValue()) { ASSERT_NOT_REACHED(); return ScriptObject(); } return module.wrapWebGLContext(glContext); } +#endif -InjectedScriptWebGLModule InspectorWebGLAgent::injectedScriptWebGLModuleForTraceLogId(ErrorString* errorString, const String& traceLogId) +InjectedScriptCanvasModule InspectorCanvasAgent::injectedScriptCanvasModuleForTraceLogId(ErrorString* errorString, const String& traceLogId) { InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(traceLogId); if (injectedScript.hasNoValue()) { *errorString = "Inspected frame has gone"; - return InjectedScriptWebGLModule(); + return InjectedScriptCanvasModule(); } - InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState()); + InjectedScriptCanvasModule module = InjectedScriptCanvasModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState()); if (module.hasNoValue()) { ASSERT_NOT_REACHED(); - *errorString = "Internal error: no WebGL module"; - return InjectedScriptWebGLModule(); + *errorString = "Internal error: no Canvas module"; + return InjectedScriptCanvasModule(); } return module; } } // namespace WebCore -#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL) +#endif // ENABLE(INSPECTOR) diff --git a/Source/WebCore/inspector/InspectorWebGLAgent.h b/Source/WebCore/inspector/InspectorCanvasAgent.h index 31b7afcf3..f460c6410 100644 --- a/Source/WebCore/inspector/InspectorWebGLAgent.h +++ b/Source/WebCore/inspector/InspectorCanvasAgent.h @@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorWebGLAgent_h -#define InspectorWebGLAgent_h +#ifndef InspectorCanvasAgent_h +#define InspectorCanvasAgent_h -#if ENABLE(INSPECTOR) && ENABLE(WEBGL) +#if ENABLE(INSPECTOR) #include "InspectorBaseAgent.h" #include "InspectorFrontend.h" @@ -43,8 +43,8 @@ namespace WebCore { +class InjectedScriptCanvasModule; class InjectedScriptManager; -class InjectedScriptWebGLModule; class InspectorState; class InstrumentingAgents; class Page; @@ -52,13 +52,13 @@ class ScriptObject; typedef String ErrorString; -class InspectorWebGLAgent : public InspectorBaseAgent<InspectorWebGLAgent>, public InspectorBackendDispatcher::WebGLCommandHandler { +class InspectorCanvasAgent : public InspectorBaseAgent<InspectorCanvasAgent>, public InspectorBackendDispatcher::CanvasCommandHandler { public: - static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager) + static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager) { - return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, page, injectedScriptManager)); + return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, state, page, injectedScriptManager)); } - ~InspectorWebGLAgent(); + ~InspectorCanvasAgent(); virtual void setFrontend(InspectorFrontend*); virtual void clearFrontend(); @@ -66,14 +66,16 @@ public: bool enabled() { return m_enabled; } +#if ENABLE(WEBGL) ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&); +#endif // Called from the front-end. virtual void enable(ErrorString*); virtual void disable(ErrorString*); virtual void dropTraceLog(ErrorString*, const String&); virtual void captureFrame(ErrorString*, String*); - virtual void getTraceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>&); + virtual void getTraceLog(ErrorString*, const String&, RefPtr<TypeBuilder::Canvas::TraceLog>&); virtual void replayTraceLog(ErrorString*, const String&, int, String*); // Called from the injected script. @@ -81,18 +83,18 @@ public: // Called from InspectorInstrumentation private: - InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*); + InspectorCanvasAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*); - InjectedScriptWebGLModule injectedScriptWebGLModuleForTraceLogId(ErrorString*, const String&); + InjectedScriptCanvasModule injectedScriptCanvasModuleForTraceLogId(ErrorString*, const String&); Page* m_inspectedPage; InjectedScriptManager* m_injectedScriptManager; - InspectorFrontend::WebGL* m_frontend; + InspectorFrontend::Canvas* m_frontend; bool m_enabled; }; } // namespace WebCore -#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL) +#endif // ENABLE(INSPECTOR) -#endif // !defined(InspectorWebGLAgent_h) +#endif // !defined(InspectorCanvasAgent_h) diff --git a/Source/WebCore/inspector/InspectorWebGLInstrumentation.h b/Source/WebCore/inspector/InspectorCanvasInstrumentation.h index 35675224b..5904b8789 100644 --- a/Source/WebCore/inspector/InspectorWebGLInstrumentation.h +++ b/Source/WebCore/inspector/InspectorCanvasInstrumentation.h @@ -28,11 +28,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorWebGLInstrumentation_h -#define InspectorWebGLInstrumentation_h +#ifndef InspectorCanvasInstrumentation_h +#define InspectorCanvasInstrumentation_h +#include "InspectorCanvasAgent.h" #include "InspectorInstrumentation.h" -#include "InspectorWebGLAgent.h" #include "InstrumentingAgents.h" #include "ScriptObject.h" @@ -43,9 +43,9 @@ ScriptObject InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentati { #if ENABLE(INSPECTOR) if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) { - InspectorWebGLAgent* webGLAgent = instrumentingAgents->inspectorWebGLAgent(); - if (webGLAgent && webGLAgent->enabled()) - return webGLAgent->wrapWebGLRenderingContextForInstrumentation(glContext); + InspectorCanvasAgent* canvasAgent = instrumentingAgents->inspectorCanvasAgent(); + if (canvasAgent && canvasAgent->enabled()) + return canvasAgent->wrapWebGLRenderingContextForInstrumentation(glContext); } #endif return ScriptObject(); @@ -54,4 +54,4 @@ ScriptObject InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentati } // namespace WebCore -#endif // !defined(InspectorWebGLInstrumentation_h) +#endif // !defined(InspectorCanvasInstrumentation_h) diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp index c85f4d4ca..9bd43311f 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp @@ -44,6 +44,7 @@ #include "InspectorBackendDispatcher.h" #include "InspectorBaseAgent.h" #include "InspectorCSSAgent.h" +#include "InspectorCanvasAgent.h" #include "InspectorClient.h" #include "InspectorDOMAgent.h" #include "InspectorDOMDebuggerAgent.h" @@ -62,7 +63,6 @@ #include "InspectorResourceAgent.h" #include "InspectorState.h" #include "InspectorTimelineAgent.h" -#include "InspectorWebGLAgent.h" #include "InspectorWorkerAgent.h" #include "InstrumentingAgents.h" #include "PageConsoleAgent.h" @@ -147,9 +147,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_state.get())); #endif -#if ENABLE(WEBGL) - m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get())); -#endif + m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get())); ASSERT_ARG(inspectorClient, inspectorClient); m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp index 817f1df3b..4491487b3 100644 --- a/Source/WebCore/inspector/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp @@ -1304,12 +1304,15 @@ PassRefPtr<TypeBuilder::DOM::EventListener> InspectorDOMAgent::buildObjectForEve .setNodeId(pushNodePathToFrontend(node)) .setHandlerBody(eventListenerHandlerBody(node->document(), eventListener.get())); String sourceName; + String scriptId; int lineNumber; - if (eventListenerHandlerLocation(node->document(), eventListener.get(), sourceName, lineNumber)) { + if (eventListenerHandlerLocation(node->document(), eventListener.get(), sourceName, scriptId, lineNumber)) { RefPtr<TypeBuilder::Debugger::Location> location = TypeBuilder::Debugger::Location::create() - .setScriptId(sourceName) + .setScriptId(scriptId) .setLineNumber(lineNumber); value->setLocation(location); + if (!sourceName.isEmpty()) + value->setSourceName(sourceName); } return value.release(); } diff --git a/Source/WebCore/inspector/InstrumentingAgents.h b/Source/WebCore/inspector/InstrumentingAgents.h index 1334dc7d6..2306e7a1e 100644 --- a/Source/WebCore/inspector/InstrumentingAgents.h +++ b/Source/WebCore/inspector/InstrumentingAgents.h @@ -38,21 +38,21 @@ namespace WebCore { class InspectorAgent; class InspectorApplicationCacheAgent; -class InspectorPageAgent; -class InspectorDOMDebuggerAgent; class InspectorCSSAgent; +class InspectorCanvasAgent; class InspectorConsoleAgent; class InspectorDOMAgent; +class InspectorDOMDebuggerAgent; class InspectorDOMStorageAgent; class InspectorDatabaseAgent; class InspectorDebuggerAgent; class InspectorFileSystemAgent; +class InspectorPageAgent; class InspectorProfilerAgent; class InspectorResourceAgent; class InspectorRuntimeAgent; class InspectorTimelineAgent; class InspectorWorkerAgent; -class InspectorWebGLAgent; class Page; class PageRuntimeAgent; class WorkerContext; @@ -87,9 +87,7 @@ public: #if ENABLE(WORKERS) , m_inspectorWorkerAgent(0) #endif -#if ENABLE(WEBGL) - , m_inspectorWebGLAgent(0) -#endif + , m_inspectorCanvasAgent(0) { } ~InstrumentingAgents() { } @@ -152,10 +150,8 @@ public: void setInspectorWorkerAgent(InspectorWorkerAgent* agent) { m_inspectorWorkerAgent = agent; } #endif -#if ENABLE(WEBGL) - InspectorWebGLAgent* inspectorWebGLAgent() const { return m_inspectorWebGLAgent; } - void setInspectorWebGLAgent(InspectorWebGLAgent* agent) { m_inspectorWebGLAgent = agent; } -#endif + InspectorCanvasAgent* inspectorCanvasAgent() const { return m_inspectorCanvasAgent; } + void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; } private: InspectorAgent* m_inspectorAgent; @@ -183,9 +179,7 @@ private: #if ENABLE(WORKERS) InspectorWorkerAgent* m_inspectorWorkerAgent; #endif -#if ENABLE(WEBGL) - InspectorWebGLAgent* m_inspectorWebGLAgent; -#endif + InspectorCanvasAgent* m_inspectorCanvasAgent; }; InstrumentingAgents* instrumentationForPage(Page*); diff --git a/Source/WebCore/inspector/compile-front-end.py b/Source/WebCore/inspector/compile-front-end.py index 03eaeee1b..76dcaef34 100755 --- a/Source/WebCore/inspector/compile-front-end.py +++ b/Source/WebCore/inspector/compile-front-end.py @@ -332,7 +332,7 @@ modules = [ "ProfilesPanel.js", "ProfileLauncherView.js", "TopDownProfileDataGridTree.js", - "WebGLProfileView.js", + "CanvasProfileView.js", ] }, { @@ -407,15 +407,15 @@ if not process_recursively: os.system(command) os.system("rm " + inspector_path + "/" + "InjectedScriptSourceTmp.js") - print "Compiling InjectedScriptWebGLModuleSource.js..." - os.system("echo \"var injectedScriptWebGLModuleValue = \" > " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") - os.system("cat " + inspector_path + "/" + "InjectedScriptWebGLModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") + print "Compiling InjectedScriptCanvasModuleSource.js..." + os.system("echo \"var injectedScriptCanvasModuleValue = \" > " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js") + os.system("cat " + inspector_path + "/" + "InjectedScriptCanvasModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js") command = compiler_command command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n" command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" - command += " --js " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js" + " \\\n" + command += " --js " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js" + " \\\n" command += "\n" os.system(command) - os.system("rm " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") + os.system("rm " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTmp.js") shutil.rmtree(modules_dir) diff --git a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js index 0c2cf344b..4bdd4af7b 100644 --- a/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js +++ b/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js @@ -72,9 +72,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = { checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(this, breakpoint), false); element.appendChild(checkbox); - var url = uiLocation.uiSourceCode.url; - var displayName = url ? WebInspector.displayNameForURL(url) : WebInspector.UIString("(program)"); - var labelElement = document.createTextNode(displayName + ":" + (uiLocation.lineNumber + 1)); + var labelElement = document.createTextNode(WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber)); element.appendChild(labelElement); var snippetElement = document.createElement("div"); diff --git a/Source/WebCore/inspector/front-end/CallStackSidebarPane.js b/Source/WebCore/inspector/front-end/CallStackSidebarPane.js index 6ab3ec862..5d543f734 100644 --- a/Source/WebCore/inspector/front-end/CallStackSidebarPane.js +++ b/Source/WebCore/inspector/front-end/CallStackSidebarPane.js @@ -178,7 +178,7 @@ WebInspector.CallStackSidebarPane.Placard = function(callFrame, pane) WebInspector.CallStackSidebarPane.Placard.prototype = { _update: function(uiLocation) { - this.subtitle = WebInspector.displayNameForURL(uiLocation.uiSourceCode.url) + ":" + (uiLocation.lineNumber + 1); + this.subtitle = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber); }, _placardContextMenu: function(event) diff --git a/Source/WebCore/inspector/front-end/WebGLProfileView.js b/Source/WebCore/inspector/front-end/CanvasProfileView.js index 6028536c8..061ad8a37 100644 --- a/Source/WebCore/inspector/front-end/WebGLProfileView.js +++ b/Source/WebCore/inspector/front-end/CanvasProfileView.js @@ -32,24 +32,24 @@ * @constructor * @extends {WebInspector.View} */ -WebInspector.WebGLProfileView = function(profile) +WebInspector.CanvasProfileView = function(profile) { WebInspector.View.call(this); - this.registerRequiredCSS("webGLProfiler.css"); + this.registerRequiredCSS("canvasProfiler.css"); this._profile = profile; - this.element.addStyleClass("webgl-profile-view"); + this.element.addStyleClass("canvas-profile-view"); this._traceLogElement = document.createElement("div"); - this._traceLogElement.className = "webgl-trace-log"; + this._traceLogElement.className = "canvas-trace-log"; this._traceLogElement.addEventListener("click", this._onTraceLogItemClick.bind(this), false); this.element.appendChild(this._traceLogElement); var replayImageContainer = document.createElement("div"); - replayImageContainer.id = "webgl-replay-image-container"; + replayImageContainer.id = "canvas-replay-image-container"; this.element.appendChild(replayImageContainer); this._replayImageElement = document.createElement("image"); - this._replayImageElement.id = "webgl-replay-image"; + this._replayImageElement.id = "canvas-replay-image"; replayImageContainer.appendChild(this._replayImageElement); this._debugInfoElement = document.createElement("div"); @@ -60,11 +60,11 @@ WebInspector.WebGLProfileView = function(profile) this._showTraceLog(); } -WebInspector.WebGLProfileView.prototype = { +WebInspector.CanvasProfileView.prototype = { dispose: function() { this._linkifier.reset(); - WebGLAgent.dropTraceLog(this._profile.traceLogId()); + CanvasAgent.dropTraceLog(this._profile.traceLogId()); }, get statusBarItems() @@ -126,7 +126,7 @@ WebInspector.WebGLProfileView.prototype = { this._traceLogElement.appendChild(traceLogItem); } } - WebGLAgent.getTraceLog(this._profile.traceLogId(), didReceiveTraceLog.bind(this)); + CanvasAgent.getTraceLog(this._profile.traceLogId(), didReceiveTraceLog.bind(this)); }, _onTraceLogItemClick: function(e) @@ -144,30 +144,30 @@ WebInspector.WebGLProfileView.prototype = { this._activeTraceLogItem.style.backgroundColor = "yellow"; this._replayImageElement.src = dataURL; } - WebGLAgent.replayTraceLog(item.traceLogId, item.stepNo, didReplayTraceLog.bind(this)); + CanvasAgent.replayTraceLog(item.traceLogId, item.stepNo, didReplayTraceLog.bind(this)); } } -WebInspector.WebGLProfileView.prototype.__proto__ = WebInspector.View.prototype; +WebInspector.CanvasProfileView.prototype.__proto__ = WebInspector.View.prototype; /** * @constructor * @extends {WebInspector.ProfileType} */ -WebInspector.WebGLProfileType = function() +WebInspector.CanvasProfileType = function() { - WebInspector.ProfileType.call(this, WebInspector.WebGLProfileType.TypeId, WebInspector.UIString("Capture WebGL Frame")); + WebInspector.ProfileType.call(this, WebInspector.CanvasProfileType.TypeId, WebInspector.UIString("Capture Canvas Frame")); this._nextProfileUid = 1; // FIXME: enable/disable by a UI action? - WebGLAgent.enable(); + CanvasAgent.enable(); } -WebInspector.WebGLProfileType.TypeId = "WEBGL_PROFILE"; +WebInspector.CanvasProfileType.TypeId = "CANVAS_PROFILE"; -WebInspector.WebGLProfileType.prototype = { +WebInspector.CanvasProfileType.prototype = { get buttonTooltip() { - return WebInspector.UIString("Capture WebGL frame."); + return WebInspector.UIString("Capture Canvas Frame."); }, /** @@ -177,7 +177,7 @@ WebInspector.WebGLProfileType.prototype = { */ buttonClicked: function(profilesPanel) { - var profileHeader = new WebInspector.WebGLProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid); + var profileHeader = new WebInspector.CanvasProfileHeader(this, WebInspector.UIString("Trace Log %d", this._nextProfileUid), this._nextProfileUid); ++this._nextProfileUid; profileHeader.isTemporary = true; profilesPanel.addProfileHeader(profileHeader); @@ -186,18 +186,18 @@ WebInspector.WebGLProfileType.prototype = { profileHeader._traceLogId = traceLogId; profileHeader.isTemporary = false; } - WebGLAgent.captureFrame(didStartCapturingFrame.bind(this)); + CanvasAgent.captureFrame(didStartCapturingFrame.bind(this)); return false; }, get treeItemTitle() { - return WebInspector.UIString("WEBGL PROFILE"); + return WebInspector.UIString("CANVAS PROFILE"); }, get description() { - return WebInspector.UIString("WebGL calls instrumentation"); + return WebInspector.UIString("Canvas calls instrumentation"); }, /** @@ -216,7 +216,7 @@ WebInspector.WebGLProfileType.prototype = { createTemporaryProfile: function(title) { title = title || WebInspector.UIString("Capturing\u2026"); - return new WebInspector.WebGLProfileHeader(this, title); + return new WebInspector.CanvasProfileHeader(this, title); }, /** @@ -226,20 +226,20 @@ WebInspector.WebGLProfileType.prototype = { */ createProfile: function(profile) { - return new WebInspector.WebGLProfileHeader(this, profile.title, -1); + return new WebInspector.CanvasProfileHeader(this, profile.title, -1); } } -WebInspector.WebGLProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype; +WebInspector.CanvasProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype; /** * @constructor * @extends {WebInspector.ProfileHeader} - * @param {WebInspector.WebGLProfileType} type + * @param {WebInspector.CanvasProfileType} type * @param {string} title * @param {number=} uid */ -WebInspector.WebGLProfileHeader = function(type, title, uid) +WebInspector.CanvasProfileHeader = function(type, title, uid) { WebInspector.ProfileHeader.call(this, type, title, uid); @@ -249,7 +249,7 @@ WebInspector.WebGLProfileHeader = function(type, title, uid) this._traceLogId = null; } -WebInspector.WebGLProfileHeader.prototype = { +WebInspector.CanvasProfileHeader.prototype = { /** * @return {string?} */ @@ -271,8 +271,8 @@ WebInspector.WebGLProfileHeader.prototype = { */ createView: function(profilesPanel) { - return new WebInspector.WebGLProfileView(this); + return new WebInspector.CanvasProfileView(this); } } -WebInspector.WebGLProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype; +WebInspector.CanvasProfileHeader.prototype.__proto__ = WebInspector.ProfileHeader.prototype; diff --git a/Source/WebCore/inspector/front-end/CookieParser.js b/Source/WebCore/inspector/front-end/CookieParser.js index 3c3f379a1..ebb31bbf9 100644 --- a/Source/WebCore/inspector/front-end/CookieParser.js +++ b/Source/WebCore/inspector/front-end/CookieParser.js @@ -231,7 +231,7 @@ WebInspector.Cookie.prototype = { { // RFC 2965 suggests using Discard attribute to mark session cookies, but this does not seem to be widely used. // Check for absence of explicity max-age or expiry date instead. - return !("expries" in this._attributes || "max-age" in this._attributes); + return !("expires" in this._attributes || "max-age" in this._attributes); }, /** diff --git a/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js b/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js index 9324a5467..55ebdb084 100644 --- a/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js +++ b/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js @@ -204,10 +204,10 @@ WebInspector.EventListenerBar.prototype = { properties.push(new WebInspector.RemoteObjectProperty("node", nodeObject)); if (typeof this.eventListener.handlerBody !== "undefined") properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("listenerBody", this.eventListener.handlerBody)); - if (this.eventListener.location) { - properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("sourceName", this.eventListener.location.scriptId)); - properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("lineNumber", this.eventListener.location.lineNumber)); - } + if (this.eventListener.sourceName) + properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("sourceName", this.eventListener.sourceName)); + if (this.eventListener.location) + properties.push(WebInspector.RemoteObjectProperty.fromPrimitiveValue("lineNumber", this.eventListener.location.lineNumber + 1)); this.updateProperties(properties); } @@ -239,11 +239,15 @@ WebInspector.EventListenerBar.prototype = { // Requires that Function.toString() return at least the function's signature. if (this.eventListener.location) { this.subtitleElement.removeChildren(); - // FIXME(62725): eventListener.location should be a debugger Location. - var url = this.eventListener.location.scriptId; - var lineNumber = this.eventListener.location.lineNumber - 1; - var columnNumber = 0; - var urlElement = linkifier.linkifyLocation(url, lineNumber, columnNumber); + var urlElement; + if (this.eventListener.location.scriptId) + urlElement = linkifier.linkifyRawLocation(this.eventListener.location); + if (!urlElement) { + var url = this.eventListener.sourceName; + var lineNumber = this.eventListener.location.lineNumber; + var columnNumber = 0; + urlElement = linkifier.linkifyLocation(url, lineNumber, columnNumber); + } this.subtitleElement.appendChild(urlElement); } else { var match = this.eventListener.handlerBody.match(/function ([^\(]+?)\(/); diff --git a/Source/WebCore/inspector/front-end/ExtensionPanel.js b/Source/WebCore/inspector/front-end/ExtensionPanel.js index 46cdb117f..f96d9e99e 100644 --- a/Source/WebCore/inspector/front-end/ExtensionPanel.js +++ b/Source/WebCore/inspector/front-end/ExtensionPanel.js @@ -41,12 +41,13 @@ WebInspector.ExtensionPanel = function(id, pageURL) this._statusBarItems = []; var extensionView = new WebInspector.ExtensionView(id, pageURL, "extension panel"); extensionView.show(this.element); + this.setDefaultFocusedElement(extensionView.defaultFocusedElement()); } WebInspector.ExtensionPanel.prototype = { defaultFocusedElement: function() { - return this.sidebarTreeElement || this.element; + return WebInspector.View.prototype.defaultFocusedElement.call(this); }, get statusBarItems() diff --git a/Source/WebCore/inspector/front-end/ExtensionServer.js b/Source/WebCore/inspector/front-end/ExtensionServer.js index 3b660d0ab..149c8b8c2 100644 --- a/Source/WebCore/inspector/front-end/ExtensionServer.js +++ b/Source/WebCore/inspector/front-end/ExtensionServer.js @@ -610,6 +610,11 @@ WebInspector.ExtensionServer.prototype = { WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this); WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); + this._initDone = true; + if (this._pendingExtensions) { + this._pendingExtensions.forEach(this._innerAddExtension, this); + delete this._pendingExtensions; + } InspectorExtensionRegistry.getExtensionsAsync(); }, @@ -652,12 +657,23 @@ WebInspector.ExtensionServer.prototype = { */ _addExtensions: function(extensions) { - for (var i = 0; i < extensions.length; ++i) - this._addExtension(extensions[i]); + extensions.forEach(this._addExtension, this); }, _addExtension: function(extensionInfo) { + if (this._initDone) { + this._innerAddExtension(extensionInfo); + return; + } + if (this._pendingExtensions) + this._pendingExtensions.push(extensionInfo); + else + this._pendingExtensions = [extensionInfo]; + }, + + _innerAddExtension: function(extensionInfo) + { const urlOriginRegExp = new RegExp("([^:]+:\/\/[^/]*)\/"); // Can't use regexp literal here, MinJS chokes on it. var startPage = extensionInfo.startPage; var name = extensionInfo.name; diff --git a/Source/WebCore/inspector/front-end/ExtensionView.js b/Source/WebCore/inspector/front-end/ExtensionView.js index d4cd72c4d..170db0b6b 100644 --- a/Source/WebCore/inspector/front-end/ExtensionView.js +++ b/Source/WebCore/inspector/front-end/ExtensionView.js @@ -45,6 +45,7 @@ WebInspector.ExtensionView = function(id, src, className) this._iframe.addEventListener("load", this._onLoad.bind(this), false); this._iframe.src = src; this._iframe.className = className; + this.setDefaultFocusedElement(this._iframe); this.element.appendChild(this._iframe); } diff --git a/Source/WebCore/inspector/front-end/FileUtils.js b/Source/WebCore/inspector/front-end/FileUtils.js index 9d95a531f..65b49cb91 100644 --- a/Source/WebCore/inspector/front-end/FileUtils.js +++ b/Source/WebCore/inspector/front-end/FileUtils.js @@ -151,7 +151,7 @@ WebInspector.ChunkedFileReader.prototype = { { var chunkStart = this._loadedSize; var chunkEnd = Math.min(this._fileSize, chunkStart + this._chunkSize) - var nextPart = this._file.webkitSlice(chunkStart, chunkEnd); + var nextPart = this._file.slice(chunkStart, chunkEnd); this._reader.readAsText(nextPart); } } diff --git a/Source/WebCore/inspector/front-end/Linkifier.js b/Source/WebCore/inspector/front-end/Linkifier.js index d08280b4c..91986bdae 100644 --- a/Source/WebCore/inspector/front-end/Linkifier.js +++ b/Source/WebCore/inspector/front-end/Linkifier.js @@ -121,8 +121,6 @@ WebInspector.Linkifier.DefaultFormatter.prototype = { */ formatLiveAnchor: function(anchor, uiLocation) { - anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber); - var text = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber); if (this._maxLength) text = text.trimMiddle(this._maxLength); diff --git a/Source/WebCore/inspector/front-end/NetworkRequest.js b/Source/WebCore/inspector/front-end/NetworkRequest.js index 7f8995a87..464d9fbeb 100644 --- a/Source/WebCore/inspector/front-end/NetworkRequest.js +++ b/Source/WebCore/inspector/front-end/NetworkRequest.js @@ -420,9 +420,9 @@ WebInspector.NetworkRequest.prototype = { */ get requestHeadersText() { - if (this._requestHeadersText === undefined) { + if (typeof this._requestHeadersText === "undefined") { this._requestHeadersText = this.requestMethod + " " + this.url + " HTTP/1.1\r\n"; - for (var i = 0; i < this.requestHeaders; ++i) + for (var i = 0; i < this.requestHeaders.length; ++i) this._requestHeadersText += this.requestHeaders[i].name + ": " + this.requestHeaders[i].value + "\r\n"; } return this._requestHeadersText; @@ -522,9 +522,9 @@ WebInspector.NetworkRequest.prototype = { */ get responseHeadersText() { - if (this._responseHeadersText === undefined) { + if (typeof this._responseHeadersText === "undefined") { this._responseHeadersText = "HTTP/1.1 " + this.statusCode + " " + this.statusText + "\r\n"; - for (var i = 0; i < this.requestHeaders; ++i) + for (var i = 0; i < this.responseHeaders.length; ++i) this._responseHeadersText += this.responseHeaders[i].name + ": " + this.responseHeaders[i].value + "\r\n"; } return this._responseHeadersText; diff --git a/Source/WebCore/inspector/front-end/ProfilesPanel.js b/Source/WebCore/inspector/front-end/ProfilesPanel.js index 6a8b4d89f..d0d20aa69 100644 --- a/Source/WebCore/inspector/front-end/ProfilesPanel.js +++ b/Source/WebCore/inspector/front-end/ProfilesPanel.js @@ -248,8 +248,8 @@ WebInspector.ProfilesPanel = function() this._registerProfileType(new WebInspector.HeapSnapshotProfileType()); if (WebInspector.experimentsSettings.nativeMemorySnapshots.isEnabled()) this._registerProfileType(new WebInspector.NativeMemoryProfileType()); - if (WebInspector.experimentsSettings.webGLInspection.isEnabled()) - this._registerProfileType(new WebInspector.WebGLProfileType()); + if (WebInspector.experimentsSettings.canvasInspection.isEnabled()) + this._registerProfileType(new WebInspector.CanvasProfileType()); InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this)); @@ -1319,4 +1319,4 @@ importScript("HeapSnapshotWorkerDispatcher.js"); importScript("NativeMemorySnapshotView.js"); importScript("ProfileLauncherView.js"); importScript("TopDownProfileDataGridTree.js"); -importScript("WebGLProfileView.js"); +importScript("CanvasProfileView.js"); diff --git a/Source/WebCore/inspector/front-end/ResourceUtils.js b/Source/WebCore/inspector/front-end/ResourceUtils.js index 16a62676e..5c3f49de6 100644 --- a/Source/WebCore/inspector/front-end/ResourceUtils.js +++ b/Source/WebCore/inspector/front-end/ResourceUtils.js @@ -192,7 +192,7 @@ WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too */ WebInspector.formatLinkText = function(url, lineNumber) { - var text = WebInspector.displayNameForURL(url); + var text = url ? WebInspector.displayNameForURL(url) : WebInspector.UIString("(program)"); if (typeof lineNumber === "number") text += ":" + (lineNumber + 1); return text; diff --git a/Source/WebCore/inspector/front-end/Settings.js b/Source/WebCore/inspector/front-end/Settings.js index e35384b04..a138cb658 100644 --- a/Source/WebCore/inspector/front-end/Settings.js +++ b/Source/WebCore/inspector/front-end/Settings.js @@ -191,7 +191,7 @@ WebInspector.ExperimentsSettings = function() this.nativeMemorySnapshots = this._createExperiment("nativeMemorySnapshots", "Native memory profiling"); this.liveNativeMemoryChart = this._createExperiment("liveNativeMemoryChart", "Live native memory chart"); this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection"); - this.webGLInspection = this._createExperiment("webGLInspection ", "WebGL inspection"); + this.canvasInspection = this._createExperiment("canvasInspection ", "Canvas inspection"); this.mainThreadMonitoring = this._createExperiment("mainThreadMonitoring", "Show CPU activity in Timeline"); this.geolocationOverride = this._createExperiment("geolocationOverride", "Override Device Geolocation"); this.deviceOrientationOverride = this._createExperiment("deviceOrientationOverride", "Override Device Orientation"); diff --git a/Source/WebCore/inspector/front-end/WebKit.qrc b/Source/WebCore/inspector/front-end/WebKit.qrc index cfeb194e4..ac64947a3 100644 --- a/Source/WebCore/inspector/front-end/WebKit.qrc +++ b/Source/WebCore/inspector/front-end/WebKit.qrc @@ -14,6 +14,7 @@ <file>BreakpointManager.js</file> <file>BreakpointsSidebarPane.js</file> <file>CallStackSidebarPane.js</file> + <file>CanvasProfileView.js</file> <file>Checkbox.js</file> <file>CodeMirrorTextEditor.js</file> <file>Color.js</file> @@ -210,13 +211,13 @@ <file>utilities.js</file> <file>View.js</file> <file>WatchExpressionsSidebarPane.js</file> - <file>WebGLProfileView.js</file> <file>WorkerManager.js</file> <file>WorkersSidebarPane.js</file> <file>Workspace.js</file> <file>UglifyJS/parse-js.js</file> <file>auditsPanel.css</file> <file>breadcrumbList.css</file> + <file>canvasProfiler.css</file> <file>cssNamedFlows.css</file> <file>dataGrid.css</file> <file>cmdevtools.css</file> @@ -245,7 +246,6 @@ <file>textEditor.css</file> <file>textPrompt.css</file> <file>timelinePanel.css</file> - <file>webGLProfiler.css</file> <file>Images/applicationCache.png</file> <file>Images/back.png</file> <file>Images/breakpointBorder.png</file> diff --git a/Source/WebCore/inspector/front-end/webGLProfiler.css b/Source/WebCore/inspector/front-end/canvasProfiler.css index ba1681a63..cb4b4a530 100644 --- a/Source/WebCore/inspector/front-end/webGLProfiler.css +++ b/Source/WebCore/inspector/front-end/canvasProfiler.css @@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -.webgl-profile-view { +.canvas-profile-view { overflow: hidden; position: absolute; top: 0; @@ -37,7 +37,7 @@ bottom: 0; } -.webgl-trace-log { +.canvas-trace-log { position: absolute; top: 10px; left: 0; @@ -48,11 +48,11 @@ padding: 0 20px; } -.webgl-trace-log div { +.canvas-trace-log div { padding-bottom: 4px; } -#webgl-replay-image-container { +#canvas-replay-image-container { position: absolute; right: 0; top: 0; @@ -60,7 +60,7 @@ background-color: white; } -#webgl-replay-image { +#canvas-replay-image { width: 400px; height: 400px; display: block; diff --git a/Source/WebCore/inspector/front-end/inspector.css b/Source/WebCore/inspector/front-end/inspector.css index 710171500..d5b13097b 100644 --- a/Source/WebCore/inspector/front-end/inspector.css +++ b/Source/WebCore/inspector/front-end/inspector.css @@ -44,7 +44,7 @@ input[type="search"]:focus, input[type="text"]:focus { } .nowrap { - white-space: nowrap; + white-space: nowrap !important; } #toolbar { |