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

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

Issue 1307073002: DevTools: provide an option to return traces as streams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: work around MSVC compiler error due to missing Client definition Created 5 years, 3 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
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 <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "content/browser/devtools/devtools_io_context.h"
11 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
12 #include "content/common/devtools_messages.h" 13 #include "content/common/devtools_messages.h"
13 #include "content/public/browser/devtools_agent_host.h" 14 #include "content/public/browser/devtools_agent_host.h"
14 15
15 namespace IPC { 16 namespace IPC {
16 class Message; 17 class Message;
17 } 18 }
18 19
19 namespace content { 20 namespace content {
20 21
(...skipping 21 matching lines...) Expand all
42 WebContents* GetWebContents() override; 43 WebContents* GetWebContents() override;
43 void DisconnectWebContents() override; 44 void DisconnectWebContents() override;
44 void ConnectWebContents(WebContents* wc) override; 45 void ConnectWebContents(WebContents* wc) override;
45 46
46 protected: 47 protected:
47 DevToolsAgentHostImpl(); 48 DevToolsAgentHostImpl();
48 ~DevToolsAgentHostImpl() override; 49 ~DevToolsAgentHostImpl() override;
49 50
50 void HostClosed(); 51 void HostClosed();
51 void SendMessageToClient(const std::string& message); 52 void SendMessageToClient(const std::string& message);
53 devtools::DevToolsIOContext* GetIOContext() { return &io_context_; }
54
52 static void NotifyCallbacks(DevToolsAgentHostImpl* agent_host, bool attached); 55 static void NotifyCallbacks(DevToolsAgentHostImpl* agent_host, bool attached);
53 56
54 private: 57 private:
55 friend class DevToolsAgentHost; // for static methods 58 friend class DevToolsAgentHost; // for static methods
59 void InnerDetach();
56 60
57 const std::string id_; 61 const std::string id_;
58 DevToolsAgentHostClient* client_; 62 DevToolsAgentHostClient* client_;
63 devtools::DevToolsIOContext io_context_;
59 }; 64 };
60 65
61 class DevToolsMessageChunkProcessor { 66 class DevToolsMessageChunkProcessor {
62 public: 67 public:
63 using SendMessageCallback = base::Callback<void(const std::string&)>; 68 using SendMessageCallback = base::Callback<void(const std::string&)>;
64 explicit DevToolsMessageChunkProcessor(const SendMessageCallback& callback); 69 explicit DevToolsMessageChunkProcessor(const SendMessageCallback& callback);
65 ~DevToolsMessageChunkProcessor(); 70 ~DevToolsMessageChunkProcessor();
66 71
67 std::string state_cookie() const { return state_cookie_; } 72 std::string state_cookie() const { return state_cookie_; }
68 void set_state_cookie(const std::string& cookie) { state_cookie_ = cookie; } 73 void set_state_cookie(const std::string& cookie) { state_cookie_ = cookie; }
69 int last_call_id() const { return last_call_id_; } 74 int last_call_id() const { return last_call_id_; }
70 void ProcessChunkedMessageFromAgent(const DevToolsMessageChunk& chunk); 75 void ProcessChunkedMessageFromAgent(const DevToolsMessageChunk& chunk);
71 76
72 private: 77 private:
73 SendMessageCallback callback_; 78 SendMessageCallback callback_;
74 std::string message_buffer_; 79 std::string message_buffer_;
75 uint32 message_buffer_size_; 80 uint32 message_buffer_size_;
76 std::string state_cookie_; 81 std::string state_cookie_;
77 int last_call_id_; 82 int last_call_id_;
78 }; 83 };
79 84
80 } // namespace content 85 } // namespace content
81 86
82 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ 87 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/browser_devtools_agent_host.cc ('k') | content/browser/devtools/devtools_agent_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698