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 23 matching lines...) Expand all Loading... |
34 #include "bindings/core/v8/ScriptDebugServer.h" | 34 #include "bindings/core/v8/ScriptDebugServer.h" |
35 #include <v8.h> | 35 #include <v8.h> |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class WorkerGlobalScope; | 39 class WorkerGlobalScope; |
40 | 40 |
41 class WorkerScriptDebugServer final : public ScriptDebugServer { | 41 class WorkerScriptDebugServer final : public ScriptDebugServer { |
42 WTF_MAKE_NONCOPYABLE(WorkerScriptDebugServer); | 42 WTF_MAKE_NONCOPYABLE(WorkerScriptDebugServer); |
43 public: | 43 public: |
44 explicit WorkerScriptDebugServer(WorkerGlobalScope*); | 44 static PassOwnPtrWillBeRawPtr<WorkerScriptDebugServer> create(WorkerGlobalSc
ope* workerGlobalScope) |
| 45 { |
| 46 return adoptPtrWillBeNoop(new WorkerScriptDebugServer(workerGlobalScope)
); |
| 47 } |
| 48 |
45 ~WorkerScriptDebugServer() override { } | 49 ~WorkerScriptDebugServer() override { } |
| 50 void trace(Visitor*) override; |
46 | 51 |
47 void addListener(ScriptDebugListener*); | 52 void addListener(ScriptDebugListener*); |
48 void removeListener(ScriptDebugListener*); | 53 void removeListener(ScriptDebugListener*); |
49 | 54 |
50 void interruptAndRunTask(PassOwnPtr<Task>); | 55 void interruptAndRunTask(PassOwnPtr<Task>); |
51 | 56 |
52 private: | 57 private: |
| 58 explicit WorkerScriptDebugServer(WorkerGlobalScope*); |
| 59 |
53 ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) ove
rride; | 60 ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) ove
rride; |
54 void runMessageLoopOnPause(v8::Handle<v8::Context>) override; | 61 void runMessageLoopOnPause(v8::Handle<v8::Context>) override; |
55 void quitMessageLoopOnPause() override; | 62 void quitMessageLoopOnPause() override; |
56 | 63 |
57 typedef HashMap<WorkerGlobalScope*, ScriptDebugListener*> ListenersMap; | |
58 ScriptDebugListener* m_listener; | 64 ScriptDebugListener* m_listener; |
59 WorkerGlobalScope* m_workerGlobalScope; | 65 RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; |
60 }; | 66 }; |
61 | 67 |
62 } // namespace blink | 68 } // namespace blink |
63 | 69 |
64 #endif // WorkerScriptDebugServer_h | 70 #endif // WorkerScriptDebugServer_h |
OLD | NEW |