| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 namespace blink { | 43 namespace blink { |
| 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 ScriptValue; | 50 class ScriptValue; |
| 51 class V8Debugger; | 51 class V8Debugger; |
| 52 | 52 |
| 53 struct EventListenerInfo; | 53 class EventListenerInfo; |
| 54 | 54 |
| 55 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, | 55 // SECURITY NOTE: Although the InjectedScriptHost is intended for use solely by
the inspector, |
| 56 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the | 56 // a reference to the InjectedScriptHost may be leaked to the page being inspect
ed. Thus, the |
| 57 // InjectedScriptHost must never implemment methods that have more power over th
e page than the | 57 // InjectedScriptHost must never implemment methods that have more power over th
e page than the |
| 58 // page already has itself (e.g. origin restriction bypasses). | 58 // page already has itself (e.g. origin restriction bypasses). |
| 59 | 59 |
| 60 class InjectedScriptHost : public RefCountedWillBeGarbageCollectedFinalized<Inje
ctedScriptHost> { | 60 class InjectedScriptHost : public RefCountedWillBeGarbageCollectedFinalized<Inje
ctedScriptHost> { |
| 61 public: | 61 public: |
| 62 static PassRefPtrWillBeRawPtr<InjectedScriptHost> create(); | 62 static PassRefPtrWillBeRawPtr<InjectedScriptHost> create(); |
| 63 ~InjectedScriptHost(); | 63 ~InjectedScriptHost(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 82 WTF_MAKE_FAST_ALLOCATED(InspectableObject); | 82 WTF_MAKE_FAST_ALLOCATED(InspectableObject); |
| 83 public: | 83 public: |
| 84 virtual ScriptValue get(ScriptState*); | 84 virtual ScriptValue get(ScriptState*); |
| 85 virtual ~InspectableObject() { } | 85 virtual ~InspectableObject() { } |
| 86 }; | 86 }; |
| 87 void addInspectedObject(PassOwnPtr<InspectableObject>); | 87 void addInspectedObject(PassOwnPtr<InspectableObject>); |
| 88 void clearInspectedObjects(); | 88 void clearInspectedObjects(); |
| 89 InspectableObject* inspectedObject(unsigned num); | 89 InspectableObject* inspectedObject(unsigned num); |
| 90 | 90 |
| 91 void inspectImpl(PassRefPtr<JSONValue> objectToInspect, PassRefPtr<JSONValue
> hints); | 91 void inspectImpl(PassRefPtr<JSONValue> objectToInspect, PassRefPtr<JSONValue
> hints); |
| 92 void getEventListenersImpl(EventTarget*, Vector<EventListenerInfo>& listener
sArray); | 92 void getEventListenersImpl(EventTarget*, WillBeHeapVector<EventListenerInfo>
& listenersArray); |
| 93 | 93 |
| 94 void clearConsoleMessages(); | 94 void clearConsoleMessages(); |
| 95 void debugFunction(const String& scriptId, int lineNumber, int columnNumber)
; | 95 void debugFunction(const String& scriptId, int lineNumber, int columnNumber)
; |
| 96 void undebugFunction(const String& scriptId, int lineNumber, int columnNumbe
r); | 96 void undebugFunction(const String& scriptId, int lineNumber, int columnNumbe
r); |
| 97 void monitorFunction(const String& scriptId, int lineNumber, int columnNumbe
r, const String& functionName); | 97 void monitorFunction(const String& scriptId, int lineNumber, int columnNumbe
r, const String& functionName); |
| 98 void unmonitorFunction(const String& scriptId, int lineNumber, int columnNum
ber); | 98 void unmonitorFunction(const String& scriptId, int lineNumber, int columnNum
ber); |
| 99 | 99 |
| 100 V8Debugger& debugger() { return *m_debugger; } | 100 V8Debugger& debugger() { return *m_debugger; } |
| 101 InjectedScriptHostClient* client() { return m_client.get(); } | 101 InjectedScriptHostClient* client() { return m_client.get(); } |
| 102 | 102 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 113 V8Debugger* m_debugger; | 113 V8Debugger* m_debugger; |
| 114 Vector<OwnPtr<InspectableObject> > m_inspectedObjects; | 114 Vector<OwnPtr<InspectableObject> > m_inspectedObjects; |
| 115 OwnPtr<InspectableObject> m_defaultInspectableObject; | 115 OwnPtr<InspectableObject> m_defaultInspectableObject; |
| 116 OwnPtr<InjectedScriptHostClient> m_client; | 116 OwnPtr<InjectedScriptHostClient> m_client; |
| 117 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; | 117 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| 121 | 121 |
| 122 #endif // InjectedScriptHost_h | 122 #endif // InjectedScriptHost_h |
| OLD | NEW |