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

Side by Side Diff: content/browser/devtools/devtools_agent_host_impl.h

Issue 2698883004: DevTools: expose session to handlers. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | content/browser/devtools/protocol/devtools_domain_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "content/browser/devtools/devtools_io_context.h" 13 #include "content/browser/devtools/devtools_io_context.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/common/devtools_messages.h" 15 #include "content/common/devtools_messages.h"
16 #include "content/public/browser/devtools_agent_host.h" 16 #include "content/public/browser/devtools_agent_host.h"
17 17
18 namespace content { 18 namespace content {
19 19
20 class BrowserContext; 20 class BrowserContext;
21 class DevToolsSession; 21 class DevToolsSession;
22 22
23 namespace protocol {
24 class DevToolsDomainHandler;
25 }
26
23 // Describes interface for managing devtools agents from the browser process. 27 // Describes interface for managing devtools agents from the browser process.
24 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost { 28 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
25 public: 29 public:
26 // DevToolsAgentHost implementation. 30 // DevToolsAgentHost implementation.
27 bool AttachClient(DevToolsAgentHostClient* client) override; 31 bool AttachClient(DevToolsAgentHostClient* client) override;
28 void ForceAttachClient(DevToolsAgentHostClient* client) override; 32 void ForceAttachClient(DevToolsAgentHostClient* client) override;
29 bool DetachClient(DevToolsAgentHostClient* client) override; 33 bool DetachClient(DevToolsAgentHostClient* client) override;
30 bool DispatchProtocolMessage(DevToolsAgentHostClient* client, 34 bool DispatchProtocolMessage(DevToolsAgentHostClient* client,
31 const std::string& message) override; 35 const std::string& message) override;
32 bool IsAttached() override; 36 bool IsAttached() override;
(...skipping 27 matching lines...) Expand all
60 64
61 void NotifyCreated(); 65 void NotifyCreated();
62 void ForceDetach(bool replaced); 66 void ForceDetach(bool replaced);
63 DevToolsIOContext* GetIOContext() { return &io_context_; } 67 DevToolsIOContext* GetIOContext() { return &io_context_; }
64 68
65 // TODO(dgozman): remove this accessor. 69 // TODO(dgozman): remove this accessor.
66 DevToolsSession* session() { return session_.get(); } 70 DevToolsSession* session() { return session_.get(); }
67 71
68 private: 72 private:
69 friend class DevToolsAgentHost; // for static methods 73 friend class DevToolsAgentHost; // for static methods
74 friend class protocol::DevToolsDomainHandler;
70 bool InnerAttachClient(DevToolsAgentHostClient* client, bool force); 75 bool InnerAttachClient(DevToolsAgentHostClient* client, bool force);
71 void InnerDetachClient(); 76 void InnerDetachClient();
72 void NotifyAttached(); 77 void NotifyAttached();
73 void NotifyDetached(); 78 void NotifyDetached();
74 void NotifyDestroyed(); 79 void NotifyDestroyed();
75 80
76 const std::string id_; 81 const std::string id_;
77 int last_session_id_; 82 int last_session_id_;
78 std::unique_ptr<DevToolsSession> session_; 83 std::unique_ptr<DevToolsSession> session_;
79 DevToolsIOContext io_context_; 84 DevToolsIOContext io_context_;
(...skipping 16 matching lines...) Expand all
96 SendMessageCallback callback_; 101 SendMessageCallback callback_;
97 std::string message_buffer_; 102 std::string message_buffer_;
98 uint32_t message_buffer_size_; 103 uint32_t message_buffer_size_;
99 std::string state_cookie_; 104 std::string state_cookie_;
100 int last_call_id_; 105 int last_call_id_;
101 }; 106 };
102 107
103 } // namespace content 108 } // namespace content
104 109
105 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ 110 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/devtools_domain_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698