| 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 29 matching lines...) Expand all Loading... |
| 40 namespace blink { | 40 namespace blink { |
| 41 class PageConsoleAgent; | 41 class PageConsoleAgent; |
| 42 class KURL; | 42 class KURL; |
| 43 class WorkerInspectorProxy; | 43 class WorkerInspectorProxy; |
| 44 | 44 |
| 45 typedef String ErrorString; | 45 typedef String ErrorString; |
| 46 | 46 |
| 47 class CORE_EXPORT InspectorWorkerAgent final : public InspectorBaseAgent<Inspect
orWorkerAgent, InspectorFrontend::Worker>, public InspectorBackendDispatcher::Wo
rkerCommandHandler { | 47 class CORE_EXPORT InspectorWorkerAgent final : public InspectorBaseAgent<Inspect
orWorkerAgent, InspectorFrontend::Worker>, public InspectorBackendDispatcher::Wo
rkerCommandHandler { |
| 48 public: | 48 public: |
| 49 static PassOwnPtrWillBeRawPtr<InspectorWorkerAgent> create(PageConsoleAgent*
); | 49 static PassOwnPtrWillBeRawPtr<InspectorWorkerAgent> create(PageConsoleAgent*
); |
| 50 virtual ~InspectorWorkerAgent(); | 50 ~InspectorWorkerAgent() override; |
| 51 | 51 |
| 52 void init() override; | 52 void init() override; |
| 53 void disable(ErrorString*) override; | 53 void disable(ErrorString*) override; |
| 54 void restore() override; | 54 void restore() override; |
| 55 | 55 |
| 56 // Called from InspectorInstrumentation | 56 // Called from InspectorInstrumentation |
| 57 bool shouldPauseDedicatedWorkerOnStart(); | 57 bool shouldPauseDedicatedWorkerOnStart(); |
| 58 void didStartWorker(WorkerInspectorProxy*, const KURL&); | 58 void didStartWorker(WorkerInspectorProxy*, const KURL&); |
| 59 void workerTerminated(WorkerInspectorProxy*); | 59 void workerTerminated(WorkerInspectorProxy*); |
| 60 | 60 |
| 61 // Called from InspectorBackendDispatcher | 61 // Called from InspectorBackendDispatcher |
| 62 virtual void enable(ErrorString*) override; | 62 void enable(ErrorString*) override; |
| 63 virtual void connectToWorker(ErrorString*, const String& workerId) override; | 63 void connectToWorker(ErrorString*, const String& workerId) override; |
| 64 virtual void disconnectFromWorker(ErrorString*, const String& workerId) over
ride; | 64 void disconnectFromWorker(ErrorString*, const String& workerId) override; |
| 65 virtual void sendMessageToWorker(ErrorString*, const String& workerId, const
String& message) override; | 65 void sendMessageToWorker(ErrorString*, const String& workerId, const String&
message) override; |
| 66 virtual void setAutoconnectToWorkers(ErrorString*, bool value) override; | 66 void setAutoconnectToWorkers(ErrorString*, bool value) override; |
| 67 | 67 |
| 68 void setTracingSessionId(const String&); | 68 void setTracingSessionId(const String&); |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 InspectorWorkerAgent(PageConsoleAgent*); | 71 InspectorWorkerAgent(PageConsoleAgent*); |
| 72 void createWorkerAgentClientsForExistingWorkers(); | 72 void createWorkerAgentClientsForExistingWorkers(); |
| 73 void createWorkerAgentClient(WorkerInspectorProxy*, const String& url, const
String& id); | 73 void createWorkerAgentClient(WorkerInspectorProxy*, const String& url, const
String& id); |
| 74 void destroyWorkerAgentClients(); | 74 void destroyWorkerAgentClients(); |
| 75 | 75 |
| 76 class WorkerInfo { | 76 class WorkerInfo { |
| 77 public: | 77 public: |
| 78 WorkerInfo() { } | 78 WorkerInfo() { } |
| 79 WorkerInfo(const String& url, const String& id) : url(url), id(id) { } | 79 WorkerInfo(const String& url, const String& id) : url(url), id(id) { } |
| 80 String url; | 80 String url; |
| 81 String id; | 81 String id; |
| 82 }; | 82 }; |
| 83 class WorkerAgentClient; | 83 class WorkerAgentClient; |
| 84 typedef HashMap<String, WorkerAgentClient*> WorkerClients; | 84 typedef HashMap<String, WorkerAgentClient*> WorkerClients; |
| 85 WorkerClients m_idToClient; | 85 WorkerClients m_idToClient; |
| 86 typedef HashMap<WorkerInspectorProxy*, WorkerInfo> WorkerInfos; | 86 typedef HashMap<WorkerInspectorProxy*, WorkerInfo> WorkerInfos; |
| 87 WorkerInfos m_workerInfos; | 87 WorkerInfos m_workerInfos; |
| 88 String m_tracingSessionId; | 88 String m_tracingSessionId; |
| 89 PageConsoleAgent* m_consoleAgent; | 89 PageConsoleAgent* m_consoleAgent; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace blink | 92 } // namespace blink |
| 93 | 93 |
| 94 #endif // !defined(InspectorWorkerAgent_h) | 94 #endif // !defined(InspectorWorkerAgent_h) |
| OLD | NEW |