| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 class InspectorFrontend; | 39 class InspectorFrontend; |
| 40 class InstrumentingAgents; | 40 class InstrumentingAgents; |
| 41 class JSONObject; | 41 class JSONObject; |
| 42 class KURL; | 42 class KURL; |
| 43 class WorkerGlobalScopeProxy; | 43 class WorkerGlobalScopeProxy; |
| 44 | 44 |
| 45 typedef String ErrorString; | 45 typedef String ErrorString; |
| 46 | 46 |
| 47 class InspectorWorkerAgent : public InspectorBaseAgent<InspectorWorkerAgent>, pu
blic InspectorBackendDispatcher::WorkerCommandHandler { | 47 class InspectorWorkerAgent FINAL : public InspectorBaseAgent<InspectorWorkerAgen
t>, public InspectorBackendDispatcher::WorkerCommandHandler { |
| 48 public: | 48 public: |
| 49 static PassOwnPtr<InspectorWorkerAgent> create(InstrumentingAgents*, Inspect
orCompositeState*); | 49 static PassOwnPtr<InspectorWorkerAgent> create(InstrumentingAgents*, Inspect
orCompositeState*); |
| 50 ~InspectorWorkerAgent(); | 50 virtual ~InspectorWorkerAgent(); |
| 51 | 51 |
| 52 virtual void setFrontend(InspectorFrontend*); | 52 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 53 virtual void restore(); | 53 virtual void restore() OVERRIDE; |
| 54 virtual void clearFrontend(); | 54 virtual void clearFrontend() OVERRIDE; |
| 55 | 55 |
| 56 // Called from InspectorInstrumentation | 56 // Called from InspectorInstrumentation |
| 57 bool shouldPauseDedicatedWorkerOnStart(); | 57 bool shouldPauseDedicatedWorkerOnStart(); |
| 58 void didStartWorkerGlobalScope(WorkerGlobalScopeProxy*, const KURL&); | 58 void didStartWorkerGlobalScope(WorkerGlobalScopeProxy*, const KURL&); |
| 59 void workerGlobalScopeTerminated(WorkerGlobalScopeProxy*); | 59 void workerGlobalScopeTerminated(WorkerGlobalScopeProxy*); |
| 60 | 60 |
| 61 // Called from InspectorBackendDispatcher | 61 // Called from InspectorBackendDispatcher |
| 62 virtual void enable(ErrorString*); | 62 virtual void enable(ErrorString*) OVERRIDE; |
| 63 virtual void disable(ErrorString*); | 63 virtual void disable(ErrorString*) OVERRIDE; |
| 64 virtual void canInspectWorkers(ErrorString*, bool*); | 64 virtual void canInspectWorkers(ErrorString*, bool*) OVERRIDE; |
| 65 virtual void connectToWorker(ErrorString*, int workerId); | 65 virtual void connectToWorker(ErrorString*, int workerId) OVERRIDE; |
| 66 virtual void disconnectFromWorker(ErrorString*, int workerId); | 66 virtual void disconnectFromWorker(ErrorString*, int workerId) OVERRIDE; |
| 67 virtual void sendMessageToWorker(ErrorString*, int workerId, const RefPtr<JS
ONObject>& message); | 67 virtual void sendMessageToWorker(ErrorString*, int workerId, const RefPtr<JS
ONObject>& message) OVERRIDE; |
| 68 virtual void setAutoconnectToWorkers(ErrorString*, bool value); | 68 virtual void setAutoconnectToWorkers(ErrorString*, bool value) OVERRIDE; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 InspectorWorkerAgent(InstrumentingAgents*, InspectorCompositeState*); | 71 InspectorWorkerAgent(InstrumentingAgents*, InspectorCompositeState*); |
| 72 void createWorkerFrontendChannelsForExistingWorkers(); | 72 void createWorkerFrontendChannelsForExistingWorkers(); |
| 73 void createWorkerFrontendChannel(WorkerGlobalScopeProxy*, const String& url)
; | 73 void createWorkerFrontendChannel(WorkerGlobalScopeProxy*, const String& url)
; |
| 74 void destroyWorkerFrontendChannels(); | 74 void destroyWorkerFrontendChannels(); |
| 75 | 75 |
| 76 InspectorFrontend* m_inspectorFrontend; | 76 InspectorFrontend* m_inspectorFrontend; |
| 77 | 77 |
| 78 class WorkerFrontendChannel; | 78 class WorkerFrontendChannel; |
| 79 typedef HashMap<int, WorkerFrontendChannel*> WorkerChannels; | 79 typedef HashMap<int, WorkerFrontendChannel*> WorkerChannels; |
| 80 WorkerChannels m_idToChannel; | 80 WorkerChannels m_idToChannel; |
| 81 typedef HashMap<WorkerGlobalScopeProxy*, String> DedicatedWorkers; | 81 typedef HashMap<WorkerGlobalScopeProxy*, String> DedicatedWorkers; |
| 82 DedicatedWorkers m_dedicatedWorkers; | 82 DedicatedWorkers m_dedicatedWorkers; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace WebCore | 85 } // namespace WebCore |
| 86 | 86 |
| 87 #endif // !defined(InspectorWorkerAgent_h) | 87 #endif // !defined(InspectorWorkerAgent_h) |
| OLD | NEW |