OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef PageScriptDebugServer_h | 31 #ifndef PageScriptDebugServer_h |
32 #define PageScriptDebugServer_h | 32 #define PageScriptDebugServer_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptDebugServer.h" | |
35 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/inspector/PerIsolateDebuggerClient.h" | |
36 #include <v8.h> | 36 #include <v8.h> |
37 | 37 |
38 namespace WTF { | 38 namespace WTF { |
39 class Mutex; | 39 class Mutex; |
40 } | 40 } |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class Page; | 44 class Page; |
45 | 45 |
46 class CORE_EXPORT PageScriptDebugServer final : public ScriptDebugServer { | 46 class CORE_EXPORT PageScriptDebugServer final : public PerIsolateDebuggerClient { |
pfeldman
2015/05/11 07:25:02
So PageScriptDebugServer is no longer a ScriptDebu
| |
47 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); | 47 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); |
48 public: | 48 public: |
49 class ClientMessageLoop { | 49 class ClientMessageLoop { |
50 public: | 50 public: |
51 virtual ~ClientMessageLoop() { } | 51 virtual ~ClientMessageLoop() { } |
52 virtual void run(LocalFrame*) = 0; | 52 virtual void run(LocalFrame*) = 0; |
53 virtual void quitNow() = 0; | 53 virtual void quitNow() = 0; |
54 }; | 54 }; |
55 | 55 |
56 PageScriptDebugServer(PassOwnPtr<ClientMessageLoop>, v8::Isolate*); | 56 PageScriptDebugServer(PassOwnPtr<ClientMessageLoop>, v8::Isolate*); |
57 ~PageScriptDebugServer() override; | 57 ~PageScriptDebugServer() override; |
58 DECLARE_VIRTUAL_TRACE(); | |
59 | 58 |
60 static void setContextDebugData(v8::Local<v8::Context>, const String& type, int contextDebugId); | 59 static void setContextDebugData(v8::Local<v8::Context>, const String& type, int contextDebugId); |
61 void addListener(ScriptDebugListener*, LocalFrame*, int contextDebugId); | 60 void addListener(ScriptDebugListener*, LocalFrame*, int contextDebugId); |
62 void removeListener(ScriptDebugListener*, LocalFrame*); | 61 void removeListener(ScriptDebugListener*, LocalFrame*); |
63 | 62 |
64 static PageScriptDebugServer* instance(); | 63 static PageScriptDebugServer* instance(); |
65 static void interruptMainThreadAndRun(PassOwnPtr<Task>); | 64 static void interruptMainThreadAndRun(PassOwnPtr<ScriptDebugServer::Task>); |
66 | 65 |
67 private: | 66 private: |
68 ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Context>) over ride; | 67 ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Context>) over ride; |
69 void runMessageLoopOnPause(v8::Local<v8::Context>) override; | 68 void runMessageLoopOnPause(v8::Local<v8::Context>) override; |
70 void quitMessageLoopOnPause() override; | 69 void quitMessageLoopOnPause() override; |
70 | |
71 static WTF::Mutex& creationMutex(); | 71 static WTF::Mutex& creationMutex(); |
72 | 72 |
73 using ListenersMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, Scrip tDebugListener*>; | 73 using ListenersMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, Scrip tDebugListener*>; |
74 ListenersMap m_listenersMap; | 74 ListenersMap m_listenersMap; |
75 OwnPtr<ClientMessageLoop> m_clientMessageLoop; | 75 OwnPtr<ClientMessageLoop> m_clientMessageLoop; |
76 RawPtrWillBeMember<LocalFrame> m_pausedFrame; | 76 RawPtrWillBeMember<LocalFrame> m_pausedFrame; |
77 | 77 |
78 static PageScriptDebugServer* s_instance; | 78 static PageScriptDebugServer* s_instance; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 | 83 |
84 #endif // PageScriptDebugServer_h | 84 #endif // PageScriptDebugServer_h |
OLD | NEW |