Skip to content

Commit

Permalink
Unreviewed, rolling out r126028.
Browse files Browse the repository at this point in the history
http://trac.webkit.org/changeset/126028
https://bugs.webkit.org/show_bug.cgi?id=94576

it broke compilation on apple webkit win. (Requested by loislo
on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-21

* inspector/CodeGeneratorInspector.py:
* inspector/InjectedScriptWebGLModule.cpp:
(WebCore::InjectedScriptWebGLModule::captureFrame):
* inspector/InjectedScriptWebGLModule.h:
(InjectedScriptWebGLModule):
* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorWebGLAgent.cpp:
(WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
* inspector/InspectorWebGLAgent.h:
(WebCore):
(WebCore::InspectorWebGLAgent::create):
(InspectorWebGLAgent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
loislo committed Aug 21, 2012
1 parent 95987a7 commit 42eec54
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 163 deletions.
24 changes: 24 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,27 @@
2012-08-21 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r126028.
http://trac.webkit.org/changeset/126028
https://bugs.webkit.org/show_bug.cgi?id=94576

it broke compilation on apple webkit win. (Requested by loislo
on #webkit).

* inspector/CodeGeneratorInspector.py:
* inspector/InjectedScriptWebGLModule.cpp:
(WebCore::InjectedScriptWebGLModule::captureFrame):
* inspector/InjectedScriptWebGLModule.h:
(InjectedScriptWebGLModule):
* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorWebGLAgent.cpp:
(WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
* inspector/InspectorWebGLAgent.h:
(WebCore):
(WebCore::InspectorWebGLAgent::create):
(InspectorWebGLAgent):

2012-08-20 Ilya Tikhonovsky <loislo@chromium.org>

Web Inspector: NMI: wrong size was reported for immutable StylePropertySet
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/inspector/CodeGeneratorInspector.py
Expand Up @@ -58,7 +58,7 @@


TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor",
"Debugger.FunctionDetails", "Debugger.CallFrame", "WebGL.TraceLog",
"Debugger.FunctionDetails", "Debugger.CallFrame",
# This should be a temporary hack. TimelineEvent should be created via generated C++ API.
"Timeline.TimelineEvent"])

Expand Down
40 changes: 3 additions & 37 deletions Source/WebCore/inspector/InjectedScriptWebGLModule.cpp
Expand Up @@ -72,49 +72,15 @@ ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glC
return ScriptObject(glContext.scriptState(), resultValue);
}

void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* traceLogId)
void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, const String& contextId)
{
ScriptFunctionCall function(injectedScriptObject(), "captureFrame");
RefPtr<InspectorValue> resultValue;
makeCall(function, &resultValue);
if (!resultValue || resultValue->type() != InspectorValue::TypeString || !resultValue->asString(traceLogId))
*errorString = "Internal error: captureFrame";
}

void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const String& traceLogId)
{
ScriptFunctionCall function(injectedScriptObject(), "dropTraceLog");
function.appendArgument(traceLogId);
function.appendArgument(contextId);
bool hadException = false;
callFunctionWithEvalEnabled(function, hadException);
ASSERT(!hadException);
if (hadException)
*errorString = "Internal error: dropTraceLog";
}

void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>* traceLog)
{
ScriptFunctionCall function(injectedScriptObject(), "traceLog");
function.appendArgument(traceLogId);
RefPtr<InspectorValue> resultValue;
makeCall(function, &resultValue);
if (!resultValue || resultValue->type() != InspectorValue::TypeObject) {
if (!resultValue->asString(errorString))
*errorString = "Internal error: traceLog";
return;
}
*traceLog = TypeBuilder::WebGL::TraceLog::runtimeCast(resultValue);
}

void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
{
ScriptFunctionCall function(injectedScriptObject(), "replayTraceLog");
function.appendArgument(traceLogId);
function.appendArgument(stepNo);
RefPtr<InspectorValue> resultValue;
makeCall(function, &resultValue);
if (!resultValue || resultValue->type() != InspectorValue::TypeString || !resultValue->asString(result))
*errorString = "Internal error: replayTraceLog";
*errorString = "Internal error";
}

} // namespace WebCore
Expand Down
10 changes: 4 additions & 6 deletions Source/WebCore/inspector/InjectedScriptWebGLModule.h
Expand Up @@ -44,17 +44,15 @@ class ScriptObject;

class InjectedScriptWebGLModule : public InjectedScriptModule {
public:
InjectedScriptWebGLModule();

virtual String source() const;

static InjectedScriptWebGLModule moduleForState(InjectedScriptManager*, ScriptState*);

ScriptObject wrapWebGLContext(const ScriptObject& glContext);
void captureFrame(ErrorString*, String*);
void dropTraceLog(ErrorString*, const String&);
void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>*);
void replayTraceLog(ErrorString*, const String&, int, String*);
void captureFrame(ErrorString*, const String& contextId);

private:
InjectedScriptWebGLModule();
};

#endif
Expand Down
54 changes: 1 addition & 53 deletions Source/WebCore/inspector/Inspector.json
Expand Up @@ -3117,28 +3117,7 @@
{
"domain": "WebGL",
"hidden": true,
"types": [
{
"id": "TraceLogId",
"type": "string",
"description": "Unique object identifier."
},
{
"id": "Call",
"type": "object",
"properties": [
{ "name": "functionName", "type": "string" }
]
},
{
"id": "TraceLog",
"type": "object",
"properties": [
{ "name": "id", "$ref": "TraceLogId" },
{ "name": "calls", "type": "array", "items": { "$ref": "Call" }}
]
}
],
"types": [],
"commands": [
{
"name": "enable",
Expand All @@ -3147,37 +3126,6 @@
{
"name": "disable",
"description": "Disables WebGL inspection."
},
{
"name": "dropTraceLog",
"parameters": [
{ "name": "traceLogId", "$ref": "TraceLogId" }
]
},
{
"name": "captureFrame",
"returns": [
{ "name": "traceLogId", "$ref": "TraceLogId" }
]
},
{
"name": "getTraceLog",
"parameters": [
{ "name": "traceLogId", "$ref": "TraceLogId" }
],
"returns": [
{ "name": "traceLog", "$ref": "TraceLog" }
]
},
{
"name": "replayTraceLog",
"parameters": [
{ "name": "traceLogId", "$ref": "TraceLogId" },
{ "name": "stepNo", "type": "integer" }
],
"returns": [
{ "name": "screenshotDataUrl", "type": "string" }
]
}
],
"events": []
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/inspector/InspectorController.cpp
Expand Up @@ -148,7 +148,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
#endif

#if ENABLE(WEBGL)
m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get()));
m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get()));
#endif

ASSERT_ARG(inspectorClient, inspectorClient);
Expand Down
53 changes: 1 addition & 52 deletions Source/WebCore/inspector/InspectorWebGLAgent.cpp
Expand Up @@ -34,13 +34,11 @@

#include "InspectorWebGLAgent.h"

#include "InjectedScript.h"
#include "InjectedScriptManager.h"
#include "InjectedScriptWebGLModule.h"
#include "InspectorFrontend.h"
#include "InspectorState.h"
#include "InstrumentingAgents.h"
#include "Page.h"
#include "ScriptObject.h"
#include "ScriptState.h"

Expand All @@ -50,9 +48,8 @@ namespace WebGLAgentState {
static const char webGLAgentEnabled[] = "webGLAgentEnabled";
};

InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager)
: InspectorBaseAgent<InspectorWebGLAgent>("WebGL", instrumentingAgents, state)
, m_inspectedPage(page)
, m_injectedScriptManager(injectedScriptManager)
, m_frontend(0)
, m_enabled(false)
Expand Down Expand Up @@ -98,38 +95,6 @@ void InspectorWebGLAgent::disable(ErrorString*)
m_state->setBoolean(WebGLAgentState::webGLAgentEnabled, m_enabled);
}

void InspectorWebGLAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId)
{
InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.dropTraceLog(errorString, traceLogId);
}

void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLogId)
{
ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame());
InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, scriptState);
if (module.hasNoValue()) {
*errorString = "Inspected frame has gone";
return;
}
module.captureFrame(errorString, traceLogId);
}

void InspectorWebGLAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>& traceLog)
{
InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.traceLog(errorString, traceLogId, &traceLog);
}

void InspectorWebGLAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)
{
InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);
if (!module.hasNoValue())
module.replayTraceLog(errorString, traceLogId, stepNo, result);
}

ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext)
{
if (glContext.hasNoValue()) {
Expand All @@ -144,22 +109,6 @@ ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(co
return module.wrapWebGLContext(glContext);
}

InjectedScriptWebGLModule InspectorWebGLAgent::injectedScriptWebGLModuleForTraceLogId(ErrorString* errorString, const String& traceLogId)
{
InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(traceLogId);
if (injectedScript.hasNoValue()) {
*errorString = "Inspected frame has gone";
return InjectedScriptWebGLModule();
}
InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState());
if (module.hasNoValue()) {
ASSERT_NOT_REACHED();
*errorString = "Internal error: no WebGL module";
return InjectedScriptWebGLModule();
}
return module;
}

} // namespace WebCore

#endif // ENABLE(INSPECTOR) && ENABLE(WEBGL)
16 changes: 3 additions & 13 deletions Source/WebCore/inspector/InspectorWebGLAgent.h
Expand Up @@ -35,7 +35,6 @@

#include "InspectorBaseAgent.h"
#include "InspectorFrontend.h"
#include "InspectorTypeBuilder.h"
#include "PlatformString.h"
#include "ScriptState.h"
#include <wtf/PassOwnPtr.h>
Expand All @@ -44,19 +43,17 @@
namespace WebCore {

class InjectedScriptManager;
class InjectedScriptWebGLModule;
class InspectorState;
class InstrumentingAgents;
class Page;
class ScriptObject;

typedef String ErrorString;

class InspectorWebGLAgent : public InspectorBaseAgent<InspectorWebGLAgent>, public InspectorBackendDispatcher::WebGLCommandHandler {
public:
static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InjectedScriptManager* injectedScriptManager)
static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager)
{
return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, page, injectedScriptManager));
return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, injectedScriptManager));
}
~InspectorWebGLAgent();

Expand All @@ -71,21 +68,14 @@ class InspectorWebGLAgent : public InspectorBaseAgent<InspectorWebGLAgent>, publ
// 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 replayTraceLog(ErrorString*, const String&, int, String*);

// Called from the injected script.

// Called from InspectorInstrumentation

private:
InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, Page*, InjectedScriptManager*);
InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*);

InjectedScriptWebGLModule injectedScriptWebGLModuleForTraceLogId(ErrorString*, const String&);

Page* m_inspectedPage;
InjectedScriptManager* m_injectedScriptManager;
InspectorFrontend::WebGL* m_frontend;
bool m_enabled;
Expand Down

0 comments on commit 42eec54

Please sign in to comment.