Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/worker/worker_devtools_agent.h

Issue 7248076: DevTools: add initial support for shared workers debugging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_ 5 #ifndef CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_
6 #define CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_ 6 #define CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 class Message; 14 class Message;
15 } 15 }
16 16
17 namespace WebKit { 17 namespace WebKit {
18 class WebSharedWorker;
18 class WebString; 19 class WebString;
19 class WebWorker; 20 class WebWorker;
20 } 21 }
21 22
22 class WorkerDevToolsAgent { 23 class WorkerDevToolsAgent {
23 public: 24 public:
24 WorkerDevToolsAgent(int route_id, WebKit::WebWorker*); 25 static WorkerDevToolsAgent* CreateForDedicatedWorker(
25 ~WorkerDevToolsAgent(); 26 int route_id,
27 WebKit::WebWorker*);
28 static WorkerDevToolsAgent* CreateForSharedWorker(
29 int route_id,
30 WebKit::WebSharedWorker*);
31 virtual ~WorkerDevToolsAgent();
26 32
27 bool OnMessageReceived(const IPC::Message& message); 33 // Called on the Worker thread.
34 virtual bool OnMessageReceived(const IPC::Message& message) = 0;
35 virtual void SendDevToolsMessage(const WebKit::WebString&) = 0;
28 36
29 void SendDevToolsMessage(const WebKit::WebString&); 37 protected:
30 38 explicit WorkerDevToolsAgent(int route_id);
31 private:
32 void OnAttach();
33 void OnDetach();
34 void OnDispatchOnInspectorBackend(const std::string& message);
35 39
36 bool Send(IPC::Message* message); 40 bool Send(IPC::Message* message);
37 41 const int route_id_;
38 int route_id_;
39 WebKit::WebWorker* webworker_;
40 42
41 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgent); 43 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgent);
42 }; 44 };
43 45
44 #endif // CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_ 46 #endif // CONTENT_WORKER_WORKER_DEVTOOLS_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698