| Index: Source/bindings/v8/V8PerContextDebugData.h
|
| diff --git a/Source/core/inspector/InspectorHistory.h b/Source/bindings/v8/V8PerContextDebugData.h
|
| similarity index 56%
|
| copy from Source/core/inspector/InspectorHistory.h
|
| copy to Source/bindings/v8/V8PerContextDebugData.h
|
| index 852bfde128441d7c746ccd0cb89bc8370169806e..e8a021a922f8f73235be9f1e0f2e9d9a88a8231b 100644
|
| --- a/Source/core/inspector/InspectorHistory.h
|
| +++ b/Source/bindings/v8/V8PerContextDebugData.h
|
| @@ -28,61 +28,47 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef InspectorHistory_h
|
| -#define InspectorHistory_h
|
| +#ifndef V8PerContextDebugData_h
|
| +#define V8PerContextDebugData_h
|
|
|
| -#include "ExceptionCode.h"
|
| -
|
| -#include <wtf/OwnPtr.h>
|
| -#include <wtf/Vector.h>
|
| -#include <wtf/text/WTFString.h>
|
| +#include <v8.h>
|
| +#include "wtf/text/WTFString.h"
|
|
|
| namespace WebCore {
|
|
|
| -class ContainerNode;
|
| -class Element;
|
| -class Node;
|
| -
|
| +enum V8ContextEmbedderDataField {
|
| + v8ContextDebugIdIndex,
|
| + v8ContextPerContextDataIndex,
|
| + v8ContextIsolatedWorld,
|
| + v8ContextCreatorIndex
|
| + // Rather than adding more embedder data fields to v8::Context,
|
| + // consider adding the data to V8PerContextData instead.
|
| +};
|
|
|
| -class InspectorHistory {
|
| - WTF_MAKE_NONCOPYABLE(InspectorHistory); WTF_MAKE_FAST_ALLOCATED;
|
| +class V8PerContextDebugData {
|
| public:
|
| - class Action {
|
| - WTF_MAKE_FAST_ALLOCATED;
|
| - public:
|
| - Action(const String& name);
|
| - virtual ~Action();
|
| - virtual String toString();
|
| -
|
| - virtual String mergeId();
|
| - virtual void merge(PassOwnPtr<Action>);
|
| -
|
| - virtual bool perform(ExceptionCode&) = 0;
|
| + static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldName, int debugId);
|
| + static int contextDebugId(v8::Handle<v8::Context>);
|
| + // returns 'page', 'injected', or 'worker'
|
| + static String contextCategory(v8::Handle<v8::Context> context);
|
|
|
| - virtual bool undo(ExceptionCode&) = 0;
|
| - virtual bool redo(ExceptionCode&) = 0;
|
| + static bool isSystemScope(v8::Handle<v8::Context>);
|
|
|
| - virtual bool isUndoableStateMark();
|
| + // Instances of this class mark a context as temporarily used by the System, for eg
|
| + // miscellaneous_bindings, console-defining initial injected script and devtools
|
| + // command line evaluations, all within a page context
|
| + class SystemScope {
|
| + public:
|
| + SystemScope(v8::Handle<v8::Context>);
|
| + ~SystemScope();
|
| + bool matches(v8::Handle<v8::Context>);
|
| private:
|
| - String m_name;
|
| + v8::Persistent<v8::Context> m_context;
|
| + friend class V8PerContextDebugData;
|
| };
|
| -
|
| - InspectorHistory();
|
| - virtual ~InspectorHistory();
|
| -
|
| - bool perform(PassOwnPtr<Action>, ExceptionCode&);
|
| - void markUndoableState();
|
| -
|
| - bool undo(ExceptionCode&);
|
| - bool redo(ExceptionCode&);
|
| - void reset();
|
| -
|
| -private:
|
| - Vector<OwnPtr<Action> > m_history;
|
| - size_t m_afterLastActionIndex;
|
| + friend class SystemScope;
|
| };
|
|
|
| -
|
| } // namespace WebCore
|
|
|
| -#endif // !defined(InspectorHistory_h)
|
| +#endif // V8PerContextDebugData_h
|
|
|