| Index: sky/engine/core/inspector/InjectedScriptBase.h
|
| diff --git a/sky/engine/core/inspector/ScriptArguments.h b/sky/engine/core/inspector/InjectedScriptBase.h
|
| similarity index 57%
|
| copy from sky/engine/core/inspector/ScriptArguments.h
|
| copy to sky/engine/core/inspector/InjectedScriptBase.h
|
| index 6e5934da6efc1de57473e0e974bd54e3b374f67f..22a755ba30aa489e29e22f0f498bf60f881d9970 100644
|
| --- a/sky/engine/core/inspector/ScriptArguments.h
|
| +++ b/sky/engine/core/inspector/InjectedScriptBase.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (c) 2010 Google Inc. All rights reserved.
|
| + * Copyright (C) 2012 Google Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -28,40 +28,50 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef ScriptArguments_h
|
| -#define ScriptArguments_h
|
| +#ifndef InjectedScriptBase_h
|
| +#define InjectedScriptBase_h
|
|
|
| #include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/ScriptValue.h"
|
| +#include "core/InspectorTypeBuilder.h"
|
| #include "wtf/Forward.h"
|
| -#include "wtf/RefCounted.h"
|
| -#include "wtf/Vector.h"
|
| -#include "wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
|
|
| -class ScriptValue;
|
| +class JSONValue;
|
| +class ScriptFunctionCall;
|
|
|
| -class ScriptArguments : public RefCounted<ScriptArguments> {
|
| - DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ScriptArguments);
|
| -public:
|
| - static PassRefPtr<ScriptArguments> create(ScriptState*, Vector<ScriptValue>& arguments);
|
| +typedef String ErrorString;
|
|
|
| - const ScriptValue& argumentAt(size_t) const;
|
| - size_t argumentCount() const { return m_arguments.size(); }
|
|
|
| - ScriptState* scriptState() const { return m_scriptState.get(); }
|
| +class InjectedScriptBase {
|
| +public:
|
| + virtual ~InjectedScriptBase() { }
|
|
|
| - bool getFirstArgumentAsString(WTF::String& result, bool checkForNullOrUndefined = false);
|
| + const String& name() const { return m_name; }
|
| + bool isEmpty() const { return m_injectedScriptObject.isEmpty(); }
|
| + ScriptState* scriptState() const
|
| + {
|
| + ASSERT(!isEmpty());
|
| + return m_injectedScriptObject.scriptState();
|
| + }
|
|
|
| - void trace(Visitor*) { }
|
| +protected:
|
| + explicit InjectedScriptBase(const String& name);
|
| + InjectedScriptBase(const String& name, ScriptValue);
|
|
|
| -private:
|
| - ScriptArguments(ScriptState*, Vector<ScriptValue>& arguments);
|
| + void initialize(ScriptValue);
|
| + const ScriptValue& injectedScriptObject() const;
|
| + ScriptValue callFunctionWithEvalEnabled(ScriptFunctionCall&, bool& hadException) const;
|
| + void makeCall(ScriptFunctionCall&, RefPtr<JSONValue>* result);
|
| + void makeEvalCall(ErrorString*, ScriptFunctionCall&, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>* = 0);
|
|
|
| - ScriptStateProtectingContext m_scriptState;
|
| - Vector<ScriptValue> m_arguments;
|
| +private:
|
| + String m_name;
|
| + ScriptValue m_injectedScriptObject;
|
| };
|
|
|
| +
|
| } // namespace blink
|
|
|
| -#endif // ScriptArguments_h
|
| +#endif
|
|
|