Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (212447 => 212448)
--- trunk/Source/_javascript_Core/ChangeLog 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-02-16 18:49:40 UTC (rev 212448)
@@ -1,3 +1,90 @@
+2017-02-16 Yusuke Suzuki <[email protected]>
+
+ [JSC] Drop PassRefPtr in inspector/
+ https://bugs.webkit.org/show_bug.cgi?id=168420
+
+ Reviewed by Alex Christensen.
+
+ Drop PassRefPtr uses.
+ And use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
+ It drops some unnecessary null checks.
+
+ * debugger/Debugger.cpp:
+ (JSC::Debugger::hasBreakpoint):
+ (JSC::Debugger::currentDebuggerCallFrame):
+ * debugger/Debugger.h:
+ * inspector/AsyncStackTrace.cpp:
+ (Inspector::AsyncStackTrace::create):
+ (Inspector::AsyncStackTrace::AsyncStackTrace):
+ (Inspector::AsyncStackTrace::buildInspectorObject):
+ (Inspector::AsyncStackTrace::truncate):
+ * inspector/AsyncStackTrace.h:
+ * inspector/ConsoleMessage.cpp:
+ (Inspector::ConsoleMessage::ConsoleMessage):
+ * inspector/ConsoleMessage.h:
+ * inspector/InjectedScriptManager.cpp:
+ (Inspector::InjectedScriptManager::InjectedScriptManager):
+ (Inspector::InjectedScriptManager::injectedScriptHost):
+ * inspector/InjectedScriptManager.h:
+ * inspector/JSGlobalObjectConsoleClient.cpp:
+ (Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel):
+ (Inspector::JSGlobalObjectConsoleClient::count):
+ (Inspector::JSGlobalObjectConsoleClient::timeEnd):
+ (Inspector::JSGlobalObjectConsoleClient::timeStamp):
+ (Inspector::JSGlobalObjectConsoleClient::warnUnimplemented):
+ * inspector/JSGlobalObjectConsoleClient.h:
+ ConsoleClient now takes Ref<ScriptArgument>&& instead of RefPtr<ScriptArgument>&&.
+
+ * inspector/JSGlobalObjectInspectorController.cpp:
+ (Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
+ (Inspector::JSGlobalObjectInspectorController::reportAPIException):
+ * inspector/JSGlobalObjectInspectorController.h:
+ * inspector/JSJavaScriptCallFrame.cpp:
+ (Inspector::JSJavaScriptCallFrame::JSJavaScriptCallFrame):
+ (Inspector::toJS):
+ * inspector/JSJavaScriptCallFrame.h:
+ (Inspector::JSJavaScriptCallFrame::create):
+ * inspector/_javascript_CallFrame.cpp:
+ (Inspector::_javascript_CallFrame::_javascript_CallFrame):
+ (Inspector::_javascript_CallFrame::caller):
+ * inspector/_javascript_CallFrame.h:
+ (Inspector::_javascript_CallFrame::create):
+ * inspector/ScriptDebugServer.cpp:
+ (Inspector::ScriptDebugServer::evaluateBreakpointAction):
+ (Inspector::ScriptDebugServer::dispatchDidPause):
+ (Inspector::ScriptDebugServer::exceptionOrCaughtValue):
+ * inspector/agents/InspectorConsoleAgent.cpp:
+ (Inspector::InspectorConsoleAgent::stopTiming):
+ (Inspector::InspectorConsoleAgent::count):
+ * inspector/agents/InspectorConsoleAgent.h:
+ * inspector/agents/InspectorDebuggerAgent.cpp:
+ (Inspector::InspectorDebuggerAgent::didScheduleAsyncCall):
+ * runtime/ConsoleClient.cpp:
+ (JSC::ConsoleClient::printConsoleMessageWithArguments):
+ (JSC::ConsoleClient::internalMessageWithTypeAndLevel):
+ (JSC::ConsoleClient::logWithLevel):
+ (JSC::ConsoleClient::dir):
+ (JSC::ConsoleClient::dirXML):
+ (JSC::ConsoleClient::table):
+ (JSC::ConsoleClient::trace):
+ (JSC::ConsoleClient::assertion):
+ (JSC::ConsoleClient::group):
+ (JSC::ConsoleClient::groupCollapsed):
+ (JSC::ConsoleClient::groupEnd):
+ * runtime/ConsoleClient.h:
+ * runtime/ConsoleObject.cpp:
+ (JSC::consoleLogWithLevel):
+ (JSC::consoleProtoFuncDir):
+ (JSC::consoleProtoFuncDirXML):
+ (JSC::consoleProtoFuncTable):
+ (JSC::consoleProtoFuncTrace):
+ (JSC::consoleProtoFuncAssert):
+ (JSC::consoleProtoFuncCount):
+ (JSC::consoleProtoFuncTimeStamp):
+ (JSC::consoleProtoFuncGroup):
+ (JSC::consoleProtoFuncGroupCollapsed):
+ (JSC::consoleProtoFuncGroupEnd):
+
2017-02-15 Keith Miller <[email protected]>
Weak should not use jsCast in its accessors
Modified: trunk/Source/_javascript_Core/debugger/Debugger.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/debugger/Debugger.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/debugger/Debugger.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -502,9 +502,9 @@
TemporaryPausedState pausedState(*this);
NakedPtr<Exception> exception;
- DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
+ DebuggerCallFrame& debuggerCallFrame = currentDebuggerCallFrame();
JSObject* scopeExtensionObject = nullptr;
- JSValue result = debuggerCallFrame->evaluateWithScopeExtension(breakpoint->condition, scopeExtensionObject, exception);
+ JSValue result = debuggerCallFrame.evaluateWithScopeExtension(breakpoint->condition, scopeExtensionObject, exception);
// We can lose the debugger while executing _javascript_.
if (!m_currentCallFrame)
@@ -911,11 +911,11 @@
updateCallFrame(callFrame, AttemptPause);
}
-DebuggerCallFrame* Debugger::currentDebuggerCallFrame()
+DebuggerCallFrame& Debugger::currentDebuggerCallFrame()
{
if (!m_currentDebuggerCallFrame)
m_currentDebuggerCallFrame = DebuggerCallFrame::create(m_currentCallFrame);
- return m_currentDebuggerCallFrame.get();
+ return *m_currentDebuggerCallFrame;
}
bool Debugger::isBlacklisted(SourceID sourceID) const
Modified: trunk/Source/_javascript_Core/debugger/Debugger.h (212447 => 212448)
--- trunk/Source/_javascript_Core/debugger/Debugger.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/debugger/Debugger.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -50,7 +50,7 @@
VM& vm() { return m_vm; }
- JSC::DebuggerCallFrame* currentDebuggerCallFrame();
+ JSC::DebuggerCallFrame& currentDebuggerCallFrame();
bool hasHandlerForExceptionCallback() const
{
ASSERT(m_reasonForPause == PausedForException);
Modified: trunk/Source/_javascript_Core/inspector/AsyncStackTrace.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/AsyncStackTrace.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/AsyncStackTrace.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -31,14 +31,14 @@
namespace Inspector {
-RefPtr<AsyncStackTrace> AsyncStackTrace::create(RefPtr<ScriptCallStack> callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
+RefPtr<AsyncStackTrace> AsyncStackTrace::create(Ref<ScriptCallStack>&& callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
{
- ASSERT(callStack && callStack->size());
+ ASSERT(callStack->size());
return adoptRef(*new AsyncStackTrace(WTFMove(callStack), singleShot, WTFMove(parent)));
}
-AsyncStackTrace::AsyncStackTrace(RefPtr<ScriptCallStack> callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
- : m_callStack(callStack)
+AsyncStackTrace::AsyncStackTrace(Ref<ScriptCallStack>&& callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
+ : m_callStack(WTFMove(callStack))
, m_parent(parent)
, m_singleShot(singleShot)
{
@@ -104,8 +104,8 @@
auto* stackTrace = this;
while (stackTrace) {
- auto callStack = stackTrace->m_callStack;
- ASSERT(callStack && callStack->size());
+ auto& callStack = stackTrace->m_callStack;
+ ASSERT(callStack->size());
RefPtr<Inspector::Protocol::Console::StackTrace> protocolObject = Inspector::Protocol::Console::StackTrace::create()
.setCallFrames(callStack->buildInspectorArray())
@@ -166,7 +166,7 @@
auto* currentNode = lastUnlockedAncestor;
while (currentNode->m_parent) {
auto& parentNode = currentNode->m_parent;
- currentNode->m_parent = AsyncStackTrace::create(parentNode->m_callStack, true, parentNode->m_parent);
+ currentNode->m_parent = AsyncStackTrace::create(parentNode->m_callStack.copyRef(), true, parentNode->m_parent);
currentNode = currentNode->m_parent.get();
if (parentNode.get() == newStackTraceRoot)
Modified: trunk/Source/_javascript_Core/inspector/AsyncStackTrace.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/AsyncStackTrace.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/AsyncStackTrace.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -42,7 +42,7 @@
Canceled,
};
- static RefPtr<AsyncStackTrace> create(RefPtr<ScriptCallStack>, bool singleShot, RefPtr<AsyncStackTrace> parent);
+ static RefPtr<AsyncStackTrace> create(Ref<ScriptCallStack>&&, bool singleShot, RefPtr<AsyncStackTrace> parent);
bool isPending() const;
bool isLocked() const;
@@ -56,12 +56,12 @@
~AsyncStackTrace();
private:
- AsyncStackTrace(RefPtr<ScriptCallStack>, bool, RefPtr<AsyncStackTrace>);
+ AsyncStackTrace(Ref<ScriptCallStack>&&, bool, RefPtr<AsyncStackTrace>);
void truncate(size_t maxDepth);
void remove();
- RefPtr<ScriptCallStack> m_callStack;
+ Ref<ScriptCallStack> m_callStack;
RefPtr<AsyncStackTrace> m_parent;
unsigned m_childCount { 0 };
State m_state { State::Pending };
Modified: trunk/Source/_javascript_Core/inspector/ConsoleMessage.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/ConsoleMessage.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/ConsoleMessage.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -66,16 +66,15 @@
autogenerateMetadata(state);
}
-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
+ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, Ref<ScriptCallStack>&& callStack, unsigned long requestIdentifier)
: m_source(source)
, m_type(type)
, m_level(level)
, m_message(message)
+ , m_callStack(WTFMove(callStack))
, m_url()
, m_requestId(IdentifiersFactory::requestId(requestIdentifier))
{
- m_callStack = callStack;
-
const ScriptCallFrame* frame = m_callStack ? m_callStack->firstNonNativeCallFrame() : nullptr;
if (frame) {
m_url = frame->sourceURL();
@@ -84,12 +83,12 @@
}
}
-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, JSC::ExecState* state, unsigned long requestIdentifier)
+ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, Ref<ScriptArguments>&& arguments, JSC::ExecState* state, unsigned long requestIdentifier)
: m_source(source)
, m_type(type)
, m_level(level)
, m_message(message)
- , m_arguments(arguments)
+ , m_arguments(WTFMove(arguments))
, m_url()
, m_requestId(IdentifiersFactory::requestId(requestIdentifier))
{
Modified: trunk/Source/_javascript_Core/inspector/ConsoleMessage.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/ConsoleMessage.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/ConsoleMessage.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -50,8 +50,8 @@
public:
ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned long requestIdentifier = 0);
ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, Ref<ScriptCallStack>&&, unsigned long requestIdentifier = 0);
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, Ref<ScriptArguments>&&, JSC::ExecState*, unsigned long requestIdentifier = 0);
~ConsoleMessage();
void addToFrontend(ConsoleFrontendDispatcher&, InjectedScriptManager&, bool generatePreview);
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -45,9 +45,9 @@
namespace Inspector {
-InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, PassRefPtr<InjectedScriptHost> injectedScriptHost)
+InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, Ref<InjectedScriptHost>&& injectedScriptHost)
: m_environment(environment)
- , m_injectedScriptHost(injectedScriptHost)
+ , m_injectedScriptHost(WTFMove(injectedScriptHost))
, m_nextInjectedScriptId(1)
{
}
@@ -68,7 +68,7 @@
m_scriptStateToId.clear();
}
-InjectedScriptHost* InjectedScriptManager::injectedScriptHost()
+InjectedScriptHost& InjectedScriptManager::injectedScriptHost()
{
return m_injectedScriptHost.get();
}
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -49,13 +49,13 @@
class JS_EXPORT_PRIVATE InjectedScriptManager {
WTF_MAKE_NONCOPYABLE(InjectedScriptManager); WTF_MAKE_FAST_ALLOCATED;
public:
- InjectedScriptManager(InspectorEnvironment&, PassRefPtr<InjectedScriptHost>);
+ InjectedScriptManager(InspectorEnvironment&, Ref<InjectedScriptHost>&&);
virtual ~InjectedScriptManager();
virtual void disconnect();
virtual void discardInjectedScripts();
- InjectedScriptHost* injectedScriptHost();
+ InjectedScriptHost& injectedScriptHost();
InspectorEnvironment& inspectorEnvironment() const { return m_environment; }
InjectedScript injectedScriptFor(JSC::ExecState*);
@@ -76,7 +76,7 @@
JSC::JSObject* createInjectedScript(const String& source, JSC::ExecState*, int id);
InspectorEnvironment& m_environment;
- RefPtr<InjectedScriptHost> m_injectedScriptHost;
+ Ref<InjectedScriptHost> m_injectedScriptHost;
int m_nextInjectedScriptId;
};
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -62,7 +62,7 @@
{
}
-void JSGlobalObjectConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void JSGlobalObjectConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, Ref<ScriptArguments>&& arguments)
{
if (JSGlobalObjectConsoleClient::logToSystemConsole())
ConsoleClient::printConsoleMessageWithArguments(MessageSource::ConsoleAPI, type, level, exec, arguments.copyRef());
@@ -72,9 +72,9 @@
m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, type, level, message, WTFMove(arguments), exec));
}
-void JSGlobalObjectConsoleClient::count(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void JSGlobalObjectConsoleClient::count(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
- m_consoleAgent->count(exec, arguments);
+ m_consoleAgent->count(exec, WTFMove(arguments));
}
void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String& title)
@@ -156,11 +156,10 @@
void JSGlobalObjectConsoleClient::timeEnd(ExecState* exec, const String& title)
{
- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(exec, 1));
- m_consoleAgent->stopTiming(title, WTFMove(callStack));
+ m_consoleAgent->stopTiming(title, createScriptCallStackForConsole(exec, 1));
}
-void JSGlobalObjectConsoleClient::timeStamp(ExecState*, RefPtr<ScriptArguments>&&)
+void JSGlobalObjectConsoleClient::timeStamp(ExecState*, Ref<ScriptArguments>&&)
{
// FIXME: JSContext inspection needs a timeline.
warnUnimplemented(ASCIILiteral("console.timeStamp"));
@@ -169,7 +168,7 @@
void JSGlobalObjectConsoleClient::warnUnimplemented(const String& method)
{
String message = method + " is currently ignored in _javascript_ context inspection.";
- m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Warning, message, nullptr, nullptr));
+ m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Warning, message));
}
} // namespace Inspector
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -45,18 +45,18 @@
static void setLogToSystemConsole(bool);
protected:
- void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
- void count(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
+ void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<ScriptArguments>&&) override;
+ void count(JSC::ExecState*, Ref<ScriptArguments>&&) override;
void profile(JSC::ExecState*, const String& title) override;
void profileEnd(JSC::ExecState*, const String& title) override;
void takeHeapSnapshot(JSC::ExecState*, const String& title) override;
void time(JSC::ExecState*, const String& title) override;
void timeEnd(JSC::ExecState*, const String& title) override;
- void timeStamp(JSC::ExecState*, RefPtr<ScriptArguments>&&) override;
+ void timeStamp(JSC::ExecState*, Ref<ScriptArguments>&&) override;
private:
void warnUnimplemented(const String& method);
- void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&);
+ void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, Ref<ScriptArguments>&&);
void startConsoleProfile();
void stopConsoleProfile();
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -187,7 +187,7 @@
m_debuggerAgent->pause(dummyError);
}
-void JSGlobalObjectInspectorController::appendAPIBacktrace(ScriptCallStack* callStack)
+void JSGlobalObjectInspectorController::appendAPIBacktrace(ScriptCallStack& callStack)
{
#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK))
static const int framesToShow = 31;
@@ -208,9 +208,9 @@
if (mangledName)
cxaDemangled = abi::__cxa_demangle(mangledName, nullptr, nullptr, nullptr);
if (mangledName || cxaDemangled)
- callStack->append(ScriptCallFrame(cxaDemangled ? cxaDemangled : mangledName, ASCIILiteral("[native code]"), noSourceID, 0, 0));
+ callStack.append(ScriptCallFrame(cxaDemangled ? cxaDemangled : mangledName, ASCIILiteral("[native code]"), noSourceID, 0, 0));
else
- callStack->append(ScriptCallFrame(ASCIILiteral("?"), ASCIILiteral("[native code]"), noSourceID, 0, 0));
+ callStack.append(ScriptCallFrame(ASCIILiteral("?"), ASCIILiteral("[native code]"), noSourceID, 0, 0));
free(cxaDemangled);
}
#else
@@ -227,7 +227,7 @@
auto scope = DECLARE_CATCH_SCOPE(vm);
ErrorHandlingScope errorScope(vm);
- RefPtr<ScriptCallStack> callStack = createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture);
+ Ref<ScriptCallStack> callStack = createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture);
if (includesNativeCallStackWhenReportingExceptions())
appendAPIBacktrace(callStack.get());
@@ -244,7 +244,7 @@
ConsoleClient::printConsoleMessage(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage, String(), 0, 0);
}
- m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage, callStack));
+ m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage, WTFMove(callStack)));
}
ConsoleClient* JSGlobalObjectInspectorController::consoleClient() const
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -102,7 +102,7 @@
#endif
private:
- void appendAPIBacktrace(ScriptCallStack* callStack);
+ void appendAPIBacktrace(ScriptCallStack&);
JSC::JSGlobalObject& m_globalObject;
std::unique_ptr<InjectedScriptManager> m_injectedScriptManager;
Modified: trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -39,9 +39,9 @@
const ClassInfo JSJavaScriptCallFrame::s_info = { "_javascript_CallFrame", &Base::s_info, 0, CREATE_METHOD_TABLE(JSJavaScriptCallFrame) };
-JSJavaScriptCallFrame::JSJavaScriptCallFrame(VM& vm, Structure* structure, PassRefPtr<_javascript_CallFrame> impl)
+JSJavaScriptCallFrame::JSJavaScriptCallFrame(VM& vm, Structure* structure, Ref<_javascript_CallFrame>&& impl)
: JSDestructibleObject(vm, structure)
- , m_impl(impl.leakRef())
+ , m_impl(&impl.leakRef())
{
}
@@ -228,7 +228,7 @@
JSObject* prototype = JSJavaScriptCallFrame::createPrototype(exec->vm(), globalObject);
Structure* structure = JSJavaScriptCallFrame::createStructure(exec->vm(), globalObject, prototype);
- JSJavaScriptCallFrame* _javascript_CallFrame = JSJavaScriptCallFrame::create(exec->vm(), structure, impl);
+ JSJavaScriptCallFrame* _javascript_CallFrame = JSJavaScriptCallFrame::create(exec->vm(), structure, *impl);
return _javascript_CallFrame;
}
Modified: trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -42,9 +42,9 @@
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
- static JSJavaScriptCallFrame* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<_javascript_CallFrame> impl)
+ static JSJavaScriptCallFrame* create(JSC::VM& vm, JSC::Structure* structure, Ref<_javascript_CallFrame>&& impl)
{
- JSJavaScriptCallFrame* instance = new (NotNull, JSC::allocateCell<JSJavaScriptCallFrame>(vm.heap)) JSJavaScriptCallFrame(vm, structure, impl);
+ JSJavaScriptCallFrame* instance = new (NotNull, JSC::allocateCell<JSJavaScriptCallFrame>(vm.heap)) JSJavaScriptCallFrame(vm, structure, WTFMove(impl));
instance->finishCreation(vm);
return instance;
}
@@ -83,7 +83,7 @@
void finishCreation(JSC::VM&);
private:
- JSJavaScriptCallFrame(JSC::VM&, JSC::Structure*, PassRefPtr<_javascript_CallFrame>);
+ JSJavaScriptCallFrame(JSC::VM&, JSC::Structure*, Ref<_javascript_CallFrame>&&);
~JSJavaScriptCallFrame();
_javascript_CallFrame* m_impl;
Modified: trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -30,8 +30,8 @@
namespace Inspector {
-_javascript_CallFrame::_javascript_CallFrame(PassRefPtr<DebuggerCallFrame> debuggerCallFrame)
- : m_debuggerCallFrame(debuggerCallFrame)
+_javascript_CallFrame::_javascript_CallFrame(Ref<DebuggerCallFrame>&& debuggerCallFrame)
+ : m_debuggerCallFrame(WTFMove(debuggerCallFrame))
{
}
@@ -44,7 +44,7 @@
if (!debuggerCallerFrame)
return nullptr;
- m_caller = create(debuggerCallerFrame);
+ m_caller = create(debuggerCallerFrame.releaseNonNull());
return m_caller.get();
}
Modified: trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -37,9 +37,9 @@
class _javascript_CallFrame : public RefCounted<_javascript_CallFrame> {
public:
- static Ref<_javascript_CallFrame> create(PassRefPtr<JSC::DebuggerCallFrame> debuggerCallFrame)
+ static Ref<_javascript_CallFrame> create(Ref<JSC::DebuggerCallFrame>&& debuggerCallFrame)
{
- return adoptRef(*new _javascript_CallFrame(debuggerCallFrame));
+ return adoptRef(*new _javascript_CallFrame(WTFMove(debuggerCallFrame)));
}
_javascript_CallFrame* caller();
@@ -58,9 +58,9 @@
JSC::JSValue evaluateWithScopeExtension(const String& script, JSC::JSObject* scopeExtension, NakedPtr<JSC::Exception>& exception) const { return m_debuggerCallFrame->evaluateWithScopeExtension(script, scopeExtension, exception); }
private:
- _javascript_CallFrame(PassRefPtr<JSC::DebuggerCallFrame>);
+ _javascript_CallFrame(Ref<JSC::DebuggerCallFrame>&&);
- RefPtr<JSC::DebuggerCallFrame> m_debuggerCallFrame;
+ Ref<JSC::DebuggerCallFrame> m_debuggerCallFrame;
RefPtr<_javascript_CallFrame> m_caller;
};
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -89,29 +89,29 @@
bool ScriptDebugServer::evaluateBreakpointAction(const ScriptBreakpointAction& breakpointAction)
{
- DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
+ DebuggerCallFrame& debuggerCallFrame = currentDebuggerCallFrame();
switch (breakpointAction.type) {
case ScriptBreakpointActionTypeLog: {
- dispatchBreakpointActionLog(debuggerCallFrame->globalExec(), breakpointAction.data);
+ dispatchBreakpointActionLog(debuggerCallFrame.globalExec(), breakpointAction.data);
break;
}
case ScriptBreakpointActionTypeEvaluate: {
NakedPtr<Exception> exception;
JSObject* scopeExtensionObject = nullptr;
- debuggerCallFrame->evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
+ debuggerCallFrame.evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
if (exception)
- reportException(debuggerCallFrame->globalExec(), exception);
+ reportException(debuggerCallFrame.globalExec(), exception);
break;
}
case ScriptBreakpointActionTypeSound:
- dispatchBreakpointActionSound(debuggerCallFrame->globalExec(), breakpointAction.identifier);
+ dispatchBreakpointActionSound(debuggerCallFrame.globalExec(), breakpointAction.identifier);
break;
case ScriptBreakpointActionTypeProbe: {
NakedPtr<Exception> exception;
JSObject* scopeExtensionObject = nullptr;
- JSValue result = debuggerCallFrame->evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
- JSC::ExecState* exec = debuggerCallFrame->globalExec();
+ JSValue result = debuggerCallFrame.evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
+ JSC::ExecState* exec = debuggerCallFrame.globalExec();
if (exception)
reportException(exec, exception);
@@ -128,8 +128,8 @@
void ScriptDebugServer::dispatchDidPause(ScriptDebugListener* listener)
{
ASSERT(isPaused());
- DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
- JSGlobalObject* globalObject = debuggerCallFrame->scope()->globalObject();
+ DebuggerCallFrame& debuggerCallFrame = currentDebuggerCallFrame();
+ JSGlobalObject* globalObject = debuggerCallFrame.scope()->globalObject();
JSC::ExecState& state = *globalObject->globalExec();
JSValue jsCallFrame = toJS(&state, globalObject, _javascript_CallFrame::create(debuggerCallFrame).ptr());
listener->didPause(state, jsCallFrame, exceptionOrCaughtValue(&state));
@@ -345,7 +345,7 @@
if (reasonForPause() == PausedForException)
return currentException();
- for (RefPtr<DebuggerCallFrame> frame = currentDebuggerCallFrame(); frame; frame = frame->callerFrame()) {
+ for (RefPtr<DebuggerCallFrame> frame = ¤tDebuggerCallFrame(); frame; frame = frame->callerFrame()) {
DebuggerScope& scope = *frame->scope();
if (scope.isCatchScope())
return scope.caughtValue(state);
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -145,7 +145,7 @@
}
}
-void InspectorConsoleAgent::stopTiming(const String& title, PassRefPtr<ScriptCallStack> callStack)
+void InspectorConsoleAgent::stopTiming(const String& title, Ref<ScriptCallStack>&& callStack)
{
ASSERT(!title.isNull());
if (title.isNull())
@@ -164,7 +164,7 @@
double elapsed = monotonicallyIncreasingTime() - startTime;
String message = title + String::format(": %.3fms", elapsed * 1000);
- addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Timing, MessageLevel::Debug, message, callStack));
+ addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Timing, MessageLevel::Debug, message, WTFMove(callStack)));
}
void InspectorConsoleAgent::takeHeapSnapshot(const String& title)
@@ -180,9 +180,9 @@
m_frontendDispatcher->heapSnapshot(timestamp, snapshotData, title.isEmpty() ? nullptr : &title);
}
-void InspectorConsoleAgent::count(JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments)
+void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& arguments)
{
- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, ScriptCallStack::maxCallStackSizeToCapture));
+ Ref<ScriptCallStack> callStack = createScriptCallStackForConsole(state, ScriptCallStack::maxCallStackSizeToCapture);
String title;
String identifier;
@@ -203,7 +203,7 @@
// FIXME: Web Inspector should have a better UI for counters, but for now we just log an updated counter value.
String message = makeString(title, ": ", String::number(result.iterator->value));
- addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Debug, message, callStack));
+ addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Debug, message, WTFMove(callStack)));
}
static bool isGroupMessage(MessageType type)
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.h (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -71,9 +71,9 @@
void addMessageToConsole(std::unique_ptr<ConsoleMessage>);
void startTiming(const String& title);
- void stopTiming(const String& title, PassRefPtr<ScriptCallStack>);
+ void stopTiming(const String& title, Ref<ScriptCallStack>&&);
void takeHeapSnapshot(const String& title);
- void count(JSC::ExecState*, PassRefPtr<ScriptArguments>);
+ void count(JSC::ExecState*, Ref<ScriptArguments>&&);
protected:
void addConsoleMessage(std::unique_ptr<ConsoleMessage>);
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -230,9 +230,9 @@
if (!m_scriptDebugServer.breakpointsActive())
return;
- RefPtr<ScriptCallStack> callStack = createScriptCallStack(exec, m_asyncStackTraceDepth);
- ASSERT(callStack && callStack->size());
- if (!callStack || !callStack->size())
+ Ref<ScriptCallStack> callStack = createScriptCallStack(exec, m_asyncStackTraceDepth);
+ ASSERT(callStack->size());
+ if (!callStack->size())
return;
RefPtr<AsyncStackTrace> parentStackTrace;
Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -147,11 +147,11 @@
WTFLogAlways("%s", builder.toString().utf8().data());
}
-void ConsoleClient::printConsoleMessageWithArguments(MessageSource source, MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::printConsoleMessageWithArguments(MessageSource source, MessageType type, MessageLevel level, JSC::ExecState* exec, Ref<ScriptArguments>&& arguments)
{
bool isTraceMessage = type == MessageType::Trace;
size_t stackSize = isTraceMessage ? ScriptCallStack::maxCallStackSizeToCapture : 1;
- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(exec, stackSize));
+ Ref<ScriptCallStack> callStack = createScriptCallStackForConsole(exec, stackSize);
const ScriptCallFrame& lastCaller = callStack->at(0);
StringBuilder builder;
@@ -190,7 +190,7 @@
}
}
-void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments, ArgumentRequirement argumentRequirement)
+void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, Ref<ScriptArguments>&& arguments, ArgumentRequirement argumentRequirement)
{
if (argumentRequirement == ArgumentRequired && !arguments->argumentCount())
return;
@@ -198,7 +198,7 @@
messageWithTypeAndLevel(type, level, exec, WTFMove(arguments));
}
-void ConsoleClient::logWithLevel(ExecState* exec, RefPtr<ScriptArguments>&& arguments, MessageLevel level)
+void ConsoleClient::logWithLevel(ExecState* exec, Ref<ScriptArguments>&& arguments, MessageLevel level)
{
internalMessageWithTypeAndLevel(MessageType::Log, level, exec, WTFMove(arguments), ArgumentRequired);
}
@@ -208,42 +208,42 @@
internalMessageWithTypeAndLevel(MessageType::Clear, MessageLevel::Log, exec, ScriptArguments::createEmpty(exec), ArgumentNotRequired);
}
-void ConsoleClient::dir(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::dir(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::Dir, MessageLevel::Log, exec, WTFMove(arguments), ArgumentRequired);
}
-void ConsoleClient::dirXML(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::dirXML(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::DirXML, MessageLevel::Log, exec, WTFMove(arguments), ArgumentRequired);
}
-void ConsoleClient::table(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::table(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::Table, MessageLevel::Log, exec, WTFMove(arguments), ArgumentRequired);
}
-void ConsoleClient::trace(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::trace(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::Trace, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
}
-void ConsoleClient::assertion(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::assertion(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::Assert, MessageLevel::Error, exec, WTFMove(arguments), ArgumentNotRequired);
}
-void ConsoleClient::group(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::group(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::StartGroup, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
}
-void ConsoleClient::groupCollapsed(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::groupCollapsed(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::StartGroupCollapsed, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
}
-void ConsoleClient::groupEnd(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::groupEnd(ExecState* exec, Ref<ScriptArguments>&& arguments)
{
internalMessageWithTypeAndLevel(MessageType::EndGroup, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
}
Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.h (212447 => 212448)
--- trunk/Source/_javascript_Core/runtime/ConsoleClient.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -41,31 +41,31 @@
virtual ~ConsoleClient() { }
JS_EXPORT_PRIVATE static void printConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned lineNumber, unsigned columnNumber);
- JS_EXPORT_PRIVATE static void printConsoleMessageWithArguments(MessageSource, MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+ JS_EXPORT_PRIVATE static void printConsoleMessageWithArguments(MessageSource, MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&);
- void logWithLevel(ExecState*, RefPtr<Inspector::ScriptArguments>&&, MessageLevel);
+ void logWithLevel(ExecState*, Ref<Inspector::ScriptArguments>&&, MessageLevel);
void clear(ExecState*);
- void dir(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void dirXML(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void table(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void trace(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void assertion(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void group(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void groupCollapsed(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- void groupEnd(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+ void dir(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void dirXML(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void table(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void trace(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void assertion(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void group(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void groupCollapsed(ExecState*, Ref<Inspector::ScriptArguments>&&);
+ void groupEnd(ExecState*, Ref<Inspector::ScriptArguments>&&);
- virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
- virtual void count(ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
+ virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) = 0;
+ virtual void count(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0;
virtual void profile(ExecState*, const String& title) = 0;
virtual void profileEnd(ExecState*, const String& title) = 0;
virtual void takeHeapSnapshot(ExecState*, const String& title) = 0;
virtual void time(ExecState*, const String& title) = 0;
virtual void timeEnd(ExecState*, const String& title) = 0;
- virtual void timeStamp(ExecState*, RefPtr<Inspector::ScriptArguments>&&) = 0;
+ virtual void timeStamp(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0;
private:
enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired };
- void internalMessageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&, ArgumentRequirement);
+ void internalMessageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&, ArgumentRequirement);
};
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp (212447 => 212448)
--- trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -110,8 +110,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->logWithLevel(exec, WTFMove(arguments), level);
+ client->logWithLevel(exec, Inspector::createScriptArguments(exec, 0), level);
return JSValue::encode(jsUndefined());
}
@@ -156,8 +155,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->dir(exec, WTFMove(arguments));
+ client->dir(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -167,8 +165,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->dirXML(exec, WTFMove(arguments));
+ client->dirXML(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -178,8 +175,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->table(exec, WTFMove(arguments));
+ client->table(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -189,8 +185,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->trace(exec, WTFMove(arguments));
+ client->trace(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -208,8 +203,7 @@
if (condition)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 1));
- client->assertion(exec, WTFMove(arguments));
+ client->assertion(exec, Inspector::createScriptArguments(exec, 1));
return JSValue::encode(jsUndefined());
}
@@ -219,8 +213,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->count(exec, WTFMove(arguments));
+ client->count(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -340,8 +333,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->timeStamp(exec, WTFMove(arguments));
+ client->timeStamp(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -351,8 +343,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->group(exec, WTFMove(arguments));
+ client->group(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -362,8 +353,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->groupCollapsed(exec, WTFMove(arguments));
+ client->groupCollapsed(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
@@ -373,8 +363,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->groupEnd(exec, WTFMove(arguments));
+ client->groupEnd(exec, Inspector::createScriptArguments(exec, 0));
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/ChangeLog (212447 => 212448)
--- trunk/Source/WebCore/ChangeLog 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/ChangeLog 2017-02-16 18:49:40 UTC (rev 212448)
@@ -1,3 +1,55 @@
+2017-02-16 Yusuke Suzuki <[email protected]>
+
+ [JSC] Drop PassRefPtr in inspector/
+ https://bugs.webkit.org/show_bug.cgi?id=168420
+
+ Reviewed by Alex Christensen.
+
+ Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
+ It drops some unnecessary null checks.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateCallWith):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::PendingException::PendingException):
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::consoleCountImpl):
+ (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
+ (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::consoleCount):
+ (WebCore::InspectorInstrumentation::stopConsoleTiming):
+ (WebCore::InspectorInstrumentation::consoleTimeStamp):
+ * inspector/InspectorNetworkAgent.cpp:
+ (WebCore::InspectorNetworkAgent::buildInitiatorObject):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createGenericRecord):
+ * inspector/WebInjectedScriptManager.cpp:
+ (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
+ * inspector/WebInjectedScriptManager.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::postMessageTimerFired):
+ We dispatch appropriate addMessage function according to whether
+ `timer.stackTrace()` is nullptr.
+
+ * page/PageConsoleClient.cpp:
+ (WebCore::PageConsoleClient::addMessage):
+ (WebCore::PageConsoleClient::messageWithTypeAndLevel):
+ (WebCore::PageConsoleClient::count):
+ (WebCore::PageConsoleClient::timeEnd):
+ (WebCore::PageConsoleClient::timeStamp):
+ * page/PageConsoleClient.h:
+ * workers/WorkerConsoleClient.cpp:
+ (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
+ (WebCore::WorkerConsoleClient::count):
+ (WebCore::WorkerConsoleClient::timeEnd):
+ (WebCore::WorkerConsoleClient::timeStamp):
+ * workers/WorkerConsoleClient.h:
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::addMessage):
+
2017-02-16 Chris Fleizach <[email protected]>
AX: Make form validation accessible on iOS
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (212447 => 212448)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2017-02-16 18:49:40 UTC (rev 212448)
@@ -4529,7 +4529,7 @@
push(@callWithArgs, "*document");
}
if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) {
- push(@$outputArray, " RefPtr<Inspector::ScriptArguments> scriptArguments(Inspector::createScriptArguments($statePointer, " . @{$function->arguments} . "));\n");
+ push(@$outputArray, " Ref<Inspector::ScriptArguments> scriptArguments(Inspector::createScriptArguments($statePointer, " . @{$function->arguments} . "));\n");
$implIncludes{"<inspector/ScriptArguments.h>"} = 1;
$implIncludes{"<inspector/ScriptCallStackFactory.h>"} = 1;
push(@callWithArgs, "WTFMove(scriptArguments)");
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (212447 => 212448)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -6112,7 +6112,7 @@
UNUSED_PARAM(state);
UNUSED_PARAM(throwScope);
auto& impl = castedThis->wrapped();
- RefPtr<Inspector::ScriptArguments> scriptArguments(Inspector::createScriptArguments(state, 0));
+ Ref<Inspector::ScriptArguments> scriptArguments(Inspector::createScriptArguments(state, 0));
impl.withScriptArgumentsAndCallStack(WTFMove(scriptArguments));
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (212447 => 212448)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -61,7 +61,7 @@
, m_lineNumber(lineNumber)
, m_columnNumber(columnNumber)
, m_sourceURL(sourceURL)
- , m_callStack(callStack)
+ , m_callStack(WTFMove(callStack))
{
}
String m_errorMessage;
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (212447 => 212448)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -838,10 +838,10 @@
}
}
-void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents& instrumentingAgents, JSC::ExecState* state, RefPtr<ScriptArguments>&& arguments)
+void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents& instrumentingAgents, JSC::ExecState* state, Ref<ScriptArguments>&& arguments)
{
if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
- consoleAgent->count(state, arguments);
+ consoleAgent->count(state, WTFMove(arguments));
}
void InspectorInstrumentation::takeHeapSnapshotImpl(InstrumentingAgents& instrumentingAgents, const String& title)
@@ -864,21 +864,21 @@
consoleAgent->startTiming(title);
}
-void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& title, RefPtr<ScriptCallStack>&& stack)
+void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& title, Ref<ScriptCallStack>&& stack)
{
if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
- consoleAgent->stopTiming(title, stack);
+ consoleAgent->stopTiming(title, WTFMove(stack));
if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
timelineAgent->timeEnd(frame, title);
}
-void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents& instrumentingAgents, const String& title, RefPtr<ScriptCallStack>&& stack)
+void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents& instrumentingAgents, const String& title, Ref<ScriptCallStack>&& stack)
{
if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
- consoleAgent->stopTiming(title, stack);
+ consoleAgent->stopTiming(title, WTFMove(stack));
}
-void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, RefPtr<ScriptArguments>&& arguments)
+void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, Ref<ScriptArguments>&& arguments)
{
if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) {
String message;
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (212447 => 212448)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -184,14 +184,14 @@
static void addMessageToConsole(Page&, std::unique_ptr<Inspector::ConsoleMessage>);
static void addMessageToConsole(WorkerGlobalScope&, std::unique_ptr<Inspector::ConsoleMessage>);
- static void consoleCount(Page&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
- static void consoleCount(WorkerGlobalScope&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+ static void consoleCount(Page&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&);
+ static void consoleCount(WorkerGlobalScope&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&);
static void takeHeapSnapshot(Frame&, const String& title);
static void startConsoleTiming(Frame&, const String& title);
static void startConsoleTiming(WorkerGlobalScope&, const String& title);
- static void stopConsoleTiming(Frame&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
- static void stopConsoleTiming(WorkerGlobalScope&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
- static void consoleTimeStamp(Frame&, RefPtr<Inspector::ScriptArguments>&&);
+ static void stopConsoleTiming(Frame&, const String& title, Ref<Inspector::ScriptCallStack>&&);
+ static void stopConsoleTiming(WorkerGlobalScope&, const String& title, Ref<Inspector::ScriptCallStack>&&);
+ static void consoleTimeStamp(Frame&, Ref<Inspector::ScriptArguments>&&);
static void startProfiling(Page&, JSC::ExecState*, const String& title);
static void stopProfiling(Page&, JSC::ExecState*, const String& title);
@@ -349,13 +349,13 @@
static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);
- static void consoleCountImpl(InstrumentingAgents&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+ static void consoleCountImpl(InstrumentingAgents&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&);
static void takeHeapSnapshotImpl(InstrumentingAgents&, const String& title);
static void startConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title);
static void startConsoleTimingImpl(InstrumentingAgents&, const String& title);
- static void stopConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
- static void stopConsoleTimingImpl(InstrumentingAgents&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
- static void consoleTimeStampImpl(InstrumentingAgents&, Frame&, RefPtr<Inspector::ScriptArguments>&&);
+ static void stopConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title, Ref<Inspector::ScriptCallStack>&&);
+ static void stopConsoleTimingImpl(InstrumentingAgents&, const String& title, Ref<Inspector::ScriptCallStack>&&);
+ static void consoleTimeStampImpl(InstrumentingAgents&, Frame&, Ref<Inspector::ScriptArguments>&&);
static void didRequestAnimationFrameImpl(InstrumentingAgents&, int callbackId, Frame*);
static void didCancelAnimationFrameImpl(InstrumentingAgents&, int callbackId, Frame*);
@@ -1195,12 +1195,12 @@
addMessageToConsoleImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), WTFMove(message));
}
-inline void InspectorInstrumentation::consoleCount(Page& page, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments)
+inline void InspectorInstrumentation::consoleCount(Page& page, JSC::ExecState* state, Ref<Inspector::ScriptArguments>&& arguments)
{
consoleCountImpl(instrumentingAgentsForPage(page), state, WTFMove(arguments));
}
-inline void InspectorInstrumentation::consoleCount(WorkerGlobalScope& workerGlobalScope, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments)
+inline void InspectorInstrumentation::consoleCount(WorkerGlobalScope& workerGlobalScope, JSC::ExecState* state, Ref<Inspector::ScriptArguments>&& arguments)
{
consoleCountImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), state, WTFMove(arguments));
}
@@ -1223,18 +1223,18 @@
startConsoleTimingImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), title);
}
-inline void InspectorInstrumentation::stopConsoleTiming(Frame& frame, const String& title, RefPtr<Inspector::ScriptCallStack>&& stack)
+inline void InspectorInstrumentation::stopConsoleTiming(Frame& frame, const String& title, Ref<Inspector::ScriptCallStack>&& stack)
{
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
stopConsoleTimingImpl(*instrumentingAgents, frame, title, WTFMove(stack));
}
-inline void InspectorInstrumentation::stopConsoleTiming(WorkerGlobalScope& workerGlobalScope, const String& title, RefPtr<Inspector::ScriptCallStack>&& stack)
+inline void InspectorInstrumentation::stopConsoleTiming(WorkerGlobalScope& workerGlobalScope, const String& title, Ref<Inspector::ScriptCallStack>&& stack)
{
stopConsoleTimingImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), title, WTFMove(stack));
}
-inline void InspectorInstrumentation::consoleTimeStamp(Frame& frame, RefPtr<Inspector::ScriptArguments>&& arguments)
+inline void InspectorInstrumentation::consoleTimeStamp(Frame& frame, Ref<Inspector::ScriptArguments>&& arguments)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
Modified: trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp (212447 => 212448)
--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -502,8 +502,8 @@
RefPtr<Inspector::Protocol::Network::Initiator> InspectorNetworkAgent::buildInitiatorObject(Document* document)
{
- RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
- if (stackTrace && stackTrace->size() > 0) {
+ Ref<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
+ if (stackTrace->size() > 0) {
auto initiatorObject = Inspector::Protocol::Network::Initiator::create()
.setType(Inspector::Protocol::Network::Initiator::Type::Script)
.release();
Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (212447 => 212448)
--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -50,8 +50,8 @@
record->setDouble(ASCIILiteral("startTime"), startTime);
if (maxCallStackDepth) {
- RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), maxCallStackDepth);
- if (stackTrace && stackTrace->size())
+ Ref<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), maxCallStackDepth);
+ if (stackTrace->size())
record->setValue(ASCIILiteral("stackTrace"), stackTrace->buildInspectorArray());
}
return record;
Modified: trunk/Source/WebCore/inspector/WebInjectedScriptManager.cpp (212447 => 212448)
--- trunk/Source/WebCore/inspector/WebInjectedScriptManager.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/WebInjectedScriptManager.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -33,7 +33,7 @@
namespace WebCore {
-WebInjectedScriptManager::WebInjectedScriptManager(InspectorEnvironment& environment, RefPtr<InjectedScriptHost>&& host)
+WebInjectedScriptManager::WebInjectedScriptManager(InspectorEnvironment& environment, Ref<InjectedScriptHost>&& host)
: InjectedScriptManager(environment, WTFMove(host))
, m_commandLineAPIHost(CommandLineAPIHost::create())
{
Modified: trunk/Source/WebCore/inspector/WebInjectedScriptManager.h (212447 => 212448)
--- trunk/Source/WebCore/inspector/WebInjectedScriptManager.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/inspector/WebInjectedScriptManager.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -35,7 +35,7 @@
class WebInjectedScriptManager final : public Inspector::InjectedScriptManager {
public:
- WebInjectedScriptManager(Inspector::InspectorEnvironment&, RefPtr<Inspector::InjectedScriptHost>&&);
+ WebInjectedScriptManager(Inspector::InspectorEnvironment&, Ref<Inspector::InjectedScriptHost>&&);
virtual ~WebInjectedScriptManager() { }
CommandLineAPIHost* commandLineAPIHost() const { return m_commandLineAPIHost.get(); }
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (212447 => 212448)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -993,7 +993,10 @@
if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrigin())) {
if (auto* pageConsole = console()) {
String message = makeString("Unable to post message to ", intendedTargetOrigin->toString(), ". Recipient has origin ", document()->securityOrigin().toString(), ".\n");
- pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message, timer.stackTrace());
+ if (timer.stackTrace())
+ pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message, *timer.stackTrace());
+ else
+ pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message);
}
return;
}
Modified: trunk/Source/WebCore/page/PageConsoleClient.cpp (212447 => 212448)
--- trunk/Source/WebCore/page/PageConsoleClient.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/page/PageConsoleClient.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -115,7 +115,7 @@
addMessage(source, level, message, url, line, column, 0, JSMainThreadExecState::currentState(), requestIdentifier);
}
-void PageConsoleClient::addMessage(MessageSource source, MessageLevel level, const String& message, RefPtr<ScriptCallStack>&& callStack)
+void PageConsoleClient::addMessage(MessageSource source, MessageLevel level, const String& message, Ref<ScriptCallStack>&& callStack)
{
addMessage(source, level, message, String(), 0, 0, WTFMove(callStack), 0);
}
@@ -128,7 +128,7 @@
std::unique_ptr<Inspector::ConsoleMessage> message;
if (callStack)
- message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, WTFMove(callStack), requestIdentifier);
+ message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, callStack.releaseNonNull(), requestIdentifier);
else
message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, suggestedURL, suggestedLineNumber, suggestedColumnNumber, state, requestIdentifier);
@@ -153,7 +153,7 @@
}
-void PageConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<Inspector::ScriptArguments>&& arguments)
+void PageConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, Ref<Inspector::ScriptArguments>&& arguments)
{
String messageText;
bool gotMessage = arguments->getFirstArgumentAsString(messageText);
@@ -176,7 +176,7 @@
ConsoleClient::printConsoleMessageWithArguments(MessageSource::ConsoleAPI, type, level, exec, WTFMove(arguments));
}
-void PageConsoleClient::count(JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void PageConsoleClient::count(JSC::ExecState* exec, Ref<ScriptArguments>&& arguments)
{
InspectorInstrumentation::consoleCount(m_page, exec, WTFMove(arguments));
}
@@ -205,11 +205,10 @@
void PageConsoleClient::timeEnd(JSC::ExecState* exec, const String& title)
{
- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(exec, 1));
- InspectorInstrumentation::stopConsoleTiming(m_page.mainFrame(), title, WTFMove(callStack));
+ InspectorInstrumentation::stopConsoleTiming(m_page.mainFrame(), title, createScriptCallStackForConsole(exec, 1));
}
-void PageConsoleClient::timeStamp(JSC::ExecState*, RefPtr<ScriptArguments>&& arguments)
+void PageConsoleClient::timeStamp(JSC::ExecState*, Ref<ScriptArguments>&& arguments)
{
InspectorInstrumentation::consoleTimeStamp(m_page.mainFrame(), WTFMove(arguments));
}
Modified: trunk/Source/WebCore/page/PageConsoleClient.h (212447 => 212448)
--- trunk/Source/WebCore/page/PageConsoleClient.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/page/PageConsoleClient.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -54,18 +54,18 @@
static void unmute();
void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&& = nullptr, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
- void addMessage(MessageSource, MessageLevel, const String& message, RefPtr<Inspector::ScriptCallStack>&&);
+ void addMessage(MessageSource, MessageLevel, const String& message, Ref<Inspector::ScriptCallStack>&&);
void addMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0, Document* = nullptr);
protected:
- void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
- void count(JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
+ void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
+ void count(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
void profile(JSC::ExecState*, const String& title) override;
void profileEnd(JSC::ExecState*, const String& title) override;
void takeHeapSnapshot(JSC::ExecState*, const String& title) override;
void time(JSC::ExecState*, const String& title) override;
void timeEnd(JSC::ExecState*, const String& title) override;
- void timeStamp(JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
+ void timeStamp(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
private:
Page& m_page;
Modified: trunk/Source/WebCore/workers/WorkerConsoleClient.cpp (212447 => 212448)
--- trunk/Source/WebCore/workers/WorkerConsoleClient.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/workers/WorkerConsoleClient.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -45,7 +45,7 @@
{
}
-void WorkerConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, RefPtr<Inspector::ScriptArguments>&& arguments)
+void WorkerConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLevel level, JSC::ExecState* exec, Ref<Inspector::ScriptArguments>&& arguments)
{
String messageText;
arguments->getFirstArgumentAsString(messageText);
@@ -53,7 +53,7 @@
m_workerGlobalScope.addConsoleMessage(WTFMove(message));
}
-void WorkerConsoleClient::count(JSC::ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void WorkerConsoleClient::count(JSC::ExecState* exec, Ref<ScriptArguments>&& arguments)
{
InspectorInstrumentation::consoleCount(m_workerGlobalScope, exec, WTFMove(arguments));
}
@@ -65,8 +65,7 @@
void WorkerConsoleClient::timeEnd(JSC::ExecState* exec, const String& title)
{
- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(exec, 1));
- InspectorInstrumentation::stopConsoleTiming(m_workerGlobalScope, title, WTFMove(callStack));
+ InspectorInstrumentation::stopConsoleTiming(m_workerGlobalScope, title, createScriptCallStackForConsole(exec, 1));
}
// FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
@@ -75,6 +74,6 @@
// FIXME: <https://webkit.org/b/127634> Web Inspector: support debugging web workers
void WorkerConsoleClient::takeHeapSnapshot(JSC::ExecState*, const String&) { }
-void WorkerConsoleClient::timeStamp(JSC::ExecState*, RefPtr<ScriptArguments>&&) { }
+void WorkerConsoleClient::timeStamp(JSC::ExecState*, Ref<ScriptArguments>&&) { }
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/WorkerConsoleClient.h (212447 => 212448)
--- trunk/Source/WebCore/workers/WorkerConsoleClient.h 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/workers/WorkerConsoleClient.h 2017-02-16 18:49:40 UTC (rev 212448)
@@ -42,14 +42,14 @@
virtual ~WorkerConsoleClient();
protected:
- void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
- void count(JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
+ void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
+ void count(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
void profile(JSC::ExecState*, const String& title) override;
void profileEnd(JSC::ExecState*, const String& title) override;
void takeHeapSnapshot(JSC::ExecState*, const String& title) override;
void time(JSC::ExecState*, const String& title) override;
void timeEnd(JSC::ExecState*, const String& title) override;
- void timeStamp(JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&) override;
+ void timeStamp(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override;
private:
WorkerGlobalScope& m_workerGlobalScope;
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (212447 => 212448)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-02-16 18:49:40 UTC (rev 212448)
@@ -285,7 +285,7 @@
std::unique_ptr<Inspector::ConsoleMessage> message;
if (callStack)
- message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, WTFMove(callStack), requestIdentifier);
+ message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, callStack.releaseNonNull(), requestIdentifier);
else
message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, sourceURL, lineNumber, columnNumber, state, requestIdentifier);
InspectorInstrumentation::addMessageToConsole(*this, WTFMove(message));
Modified: trunk/Source/WebKit/mac/ChangeLog (212447 => 212448)
--- trunk/Source/WebKit/mac/ChangeLog 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebKit/mac/ChangeLog 2017-02-16 18:49:40 UTC (rev 212448)
@@ -1,3 +1,13 @@
+2017-02-16 Yusuke Suzuki <[email protected]>
+
+ [JSC] Drop PassRefPtr in inspector/
+ https://bugs.webkit.org/show_bug.cgi?id=168420
+
+ Reviewed by Alex Christensen.
+
+ * WebView/WebScriptDebugger.mm:
+ (WebScriptDebugger::handlePause):
+
2017-02-16 Simon Fraser <[email protected]>
Clean up use of some CALayer-related SPI
Modified: trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm (212447 => 212448)
--- trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm 2017-02-16 18:38:14 UTC (rev 212447)
+++ trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm 2017-02-16 18:49:40 UTC (rev 212448)
@@ -131,9 +131,9 @@
WebFrame *webFrame = toWebFrame(globalObject);
WebView *webView = [webFrame webView];
- DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
+ DebuggerCallFrame& debuggerCallFrame = currentDebuggerCallFrame();
JSValue exceptionValue = currentException();
- String functionName = debuggerCallFrame->functionName();
+ String functionName = debuggerCallFrame.functionName();
RetainPtr<WebScriptCallFrame> webCallFrame = adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script().windowScriptObject() functionName:functionName exceptionValue:exceptionValue]);
WebScriptDebugDelegateImplementationCache* cache = WebViewGetScriptDebugDelegateImplementations(webView);
@@ -140,9 +140,9 @@
if (cache->exceptionWasRaisedFunc) {
if (cache->exceptionWasRaisedExpectsHasHandlerFlag) {
bool hasHandler = hasHandlerForExceptionCallback();
- CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:hasHandler:sourceId:line:forWebFrame:), webCallFrame.get(), hasHandler, debuggerCallFrame->sourceID(), debuggerCallFrame->line(), webFrame);
+ CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:hasHandler:sourceId:line:forWebFrame:), webCallFrame.get(), hasHandler, debuggerCallFrame.sourceID(), debuggerCallFrame.line(), webFrame);
} else
- CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), webCallFrame.get(), debuggerCallFrame->sourceID(), debuggerCallFrame->line(), webFrame);
+ CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), webCallFrame.get(), debuggerCallFrame.sourceID(), debuggerCallFrame.line(), webFrame);
}
m_callingDelegate = false;