diff options
Diffstat (limited to 'Source/JavaScriptCore/debugger/DebuggerCallFrame.h')
-rw-r--r-- | Source/JavaScriptCore/debugger/DebuggerCallFrame.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h index 09c3fb9d8..aa3cca52b 100644 --- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h +++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2013, 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,26 +29,32 @@ #ifndef DebuggerCallFrame_h #define DebuggerCallFrame_h -#include "CallFrame.h" #include "DebuggerPrimitives.h" +#include "Strong.h" +#include <wtf/NakedPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/text/TextPosition.h> namespace JSC { +class DebuggerScope; +class Exception; +class ExecState; +typedef ExecState CallFrame; + class DebuggerCallFrame : public RefCounted<DebuggerCallFrame> { public: enum Type { ProgramType, FunctionType }; - static PassRefPtr<DebuggerCallFrame> create(CallFrame* callFrame) + static Ref<DebuggerCallFrame> create(CallFrame* callFrame) { - return adoptRef(new DebuggerCallFrame(callFrame)); + return adoptRef(*new DebuggerCallFrame(callFrame)); } JS_EXPORT_PRIVATE explicit DebuggerCallFrame(CallFrame*); - JS_EXPORT_PRIVATE PassRefPtr<DebuggerCallFrame> callerFrame(); + JS_EXPORT_PRIVATE RefPtr<DebuggerCallFrame> callerFrame(); ExecState* exec() const { return m_callFrame; } JS_EXPORT_PRIVATE SourceID sourceID() const; @@ -58,11 +64,11 @@ public: JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; } JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject() const; - JS_EXPORT_PRIVATE JSScope* scope() const; + JS_EXPORT_PRIVATE DebuggerScope* scope(); JS_EXPORT_PRIVATE String functionName() const; JS_EXPORT_PRIVATE Type type() const; JS_EXPORT_PRIVATE JSValue thisValue() const; - JS_EXPORT_PRIVATE JSValue evaluate(const String&, JSValue& exception) const; + JSValue evaluate(const String&, NakedPtr<Exception>&); bool isValid() const { return !!m_callFrame; } JS_EXPORT_PRIVATE void invalidate(); @@ -70,7 +76,6 @@ public: // The following are only public for the Debugger's use only. They will be // made private soon. Other clients should not use these. - JS_EXPORT_PRIVATE static JSValue evaluateWithCallFrame(CallFrame*, const String& script, JSValue& exception); JS_EXPORT_PRIVATE static TextPosition positionForCallFrame(CallFrame*); JS_EXPORT_PRIVATE static SourceID sourceIDForCallFrame(CallFrame*); static JSValue thisValueForCallFrame(CallFrame*); @@ -79,6 +84,9 @@ private: CallFrame* m_callFrame; RefPtr<DebuggerCallFrame> m_caller; TextPosition m_position; + // The DebuggerPausedScope is responsible for calling invalidate() which, + // in turn, will clear this strong ref. + Strong<DebuggerScope> m_scope; }; } // namespace JSC |