| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 class EventTarget; | 45 class EventTarget; |
| 46 class InjectedScriptHostClient; | 46 class InjectedScriptHostClient; |
| 47 class InspectorConsoleAgent; | 47 class InspectorConsoleAgent; |
| 48 class InspectorDebuggerAgent; | 48 class InspectorDebuggerAgent; |
| 49 class JSONValue; | 49 class JSONValue; |
| 50 class Node; | 50 class Node; |
| 51 class ScriptValue; | 51 class ScriptValue; |
| 52 class V8Debugger; | 52 class V8Debugger; |
| 53 | 53 |
| 54 struct EventListenerInfo; | 54 class EventListenerInfo; |
| 55 | 55 |
| 56 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, | 56 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, |
| 57 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the | 57 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the |
| 58 // InjectedScriptHost must never implemment methods that have more power over th
e page than the | 58 // InjectedScriptHost must never implemment methods that have more power over th
e page than the |
| 59 // page already has itself (e.g. origin restriction bypasses). | 59 // page already has itself (e.g. origin restriction bypasses). |
| 60 | 60 |
| 61 class InjectedScriptHost : public RefCountedWillBeGarbageCollectedFinalized<Inje
ctedScriptHost> { | 61 class InjectedScriptHost : public RefCountedWillBeGarbageCollectedFinalized<Inje
ctedScriptHost> { |
| 62 public: | 62 public: |
| 63 static PassRefPtrWillBeRawPtr<InjectedScriptHost> create(); | 63 static PassRefPtrWillBeRawPtr<InjectedScriptHost> create(); |
| 64 ~InjectedScriptHost(); | 64 ~InjectedScriptHost(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 85 WTF_MAKE_FAST_ALLOCATED(InspectableObject); | 85 WTF_MAKE_FAST_ALLOCATED(InspectableObject); |
| 86 public: | 86 public: |
| 87 virtual ScriptValue get(ScriptState*); | 87 virtual ScriptValue get(ScriptState*); |
| 88 virtual ~InspectableObject() { } | 88 virtual ~InspectableObject() { } |
| 89 }; | 89 }; |
| 90 void addInspectedObject(PassOwnPtr<InspectableObject>); | 90 void addInspectedObject(PassOwnPtr<InspectableObject>); |
| 91 void clearInspectedObjects(); | 91 void clearInspectedObjects(); |
| 92 InspectableObject* inspectedObject(unsigned num); | 92 InspectableObject* inspectedObject(unsigned num); |
| 93 | 93 |
| 94 void inspectImpl(PassRefPtr<JSONValue> objectToInspect, PassRefPtr<JSONValue
> hints); | 94 void inspectImpl(PassRefPtr<JSONValue> objectToInspect, PassRefPtr<JSONValue
> hints); |
| 95 void getEventListenersImpl(EventTarget*, Vector<EventListenerInfo>& listener
sArray); | 95 void getEventListenersImpl(EventTarget*, WillBeHeapVector<EventListenerInfo>
& listenersArray); |
| 96 | 96 |
| 97 void clearConsoleMessages(); | 97 void clearConsoleMessages(); |
| 98 void debugFunction(const String& scriptId, int lineNumber, int columnNumber)
; | 98 void debugFunction(const String& scriptId, int lineNumber, int columnNumber)
; |
| 99 void undebugFunction(const String& scriptId, int lineNumber, int columnNumbe
r); | 99 void undebugFunction(const String& scriptId, int lineNumber, int columnNumbe
r); |
| 100 void monitorFunction(const String& scriptId, int lineNumber, int columnNumbe
r, const String& functionName); | 100 void monitorFunction(const String& scriptId, int lineNumber, int columnNumbe
r, const String& functionName); |
| 101 void unmonitorFunction(const String& scriptId, int lineNumber, int columnNum
ber); | 101 void unmonitorFunction(const String& scriptId, int lineNumber, int columnNum
ber); |
| 102 | 102 |
| 103 V8Debugger& debugger() { return *m_debugger; } | 103 V8Debugger& debugger() { return *m_debugger; } |
| 104 InjectedScriptHostClient* client() { return m_client.get(); } | 104 InjectedScriptHostClient* client() { return m_client.get(); } |
| 105 | 105 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 116 RawPtrWillBeMember<V8Debugger> m_debugger; | 116 RawPtrWillBeMember<V8Debugger> m_debugger; |
| 117 Vector<OwnPtr<InspectableObject> > m_inspectedObjects; | 117 Vector<OwnPtr<InspectableObject> > m_inspectedObjects; |
| 118 OwnPtr<InspectableObject> m_defaultInspectableObject; | 118 OwnPtr<InspectableObject> m_defaultInspectableObject; |
| 119 OwnPtr<InjectedScriptHostClient> m_client; | 119 OwnPtr<InjectedScriptHostClient> m_client; |
| 120 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; | 120 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| 124 | 124 |
| 125 #endif // InjectedScriptHost_h | 125 #endif // InjectedScriptHost_h |
| OLD | NEW |