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

Side by Side Diff: content/renderer/devtools/devtools_agent.h

Issue 744653002: Ignore DevTools messages from the old inspected RVH after navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use WebContents instead of RVH when creating DTFH Created 6 years 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_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ 5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_
6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/atomicops.h" 11 #include "base/atomicops.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "content/public/common/console_message_level.h" 15 #include "content/public/common/console_message_level.h"
16 #include "content/public/renderer/render_view_observer.h" 16 #include "content/public/renderer/render_frame_observer.h"
17 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h" 17 #include "third_party/WebKit/public/web/WebDevToolsAgentClient.h"
18 18
19 namespace blink { 19 namespace blink {
20 class WebDevToolsAgent; 20 class WebDevToolsAgent;
21 } 21 }
22 22
23 struct GpuTaskInfo; 23 struct GpuTaskInfo;
24 24
25 namespace content { 25 namespace content {
26 class RenderViewImpl;
27 26
28 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's 27 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's
29 // agents with the communication capabilities. All messages from/to Glue's 28 // agents with the communication capabilities. All messages from/to Glue's
30 // agents infrastructure are flowing through this communication agent. 29 // agents infrastructure are flowing through this communication agent.
31 // There is a corresponding DevToolsClient object on the client side. 30 // There is a corresponding DevToolsClient object on the client side.
32 class DevToolsAgent : public RenderViewObserver, 31 class DevToolsAgent : public RenderFrameObserver,
33 public base::SupportsWeakPtr<DevToolsAgent>, 32 public base::SupportsWeakPtr<DevToolsAgent>,
34 public blink::WebDevToolsAgentClient { 33 public blink::WebDevToolsAgentClient {
35 public: 34 public:
36 explicit DevToolsAgent(RenderViewImpl* render_view); 35 explicit DevToolsAgent(RenderFrame* main_render_frame);
37 ~DevToolsAgent() override; 36 ~DevToolsAgent() override;
38 37
39 // Returns agent instance for its routing id. 38 // Returns agent instance for its routing id.
40 static DevToolsAgent* FromRoutingId(int routing_id); 39 static DevToolsAgent* FromRoutingId(int routing_id);
41 40
42 blink::WebDevToolsAgent* GetWebAgent(); 41 blink::WebDevToolsAgent* GetWebAgent();
43 42
44 bool IsAttached(); 43 bool IsAttached();
45 44
46 private: 45 private:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 int num_args, 95 int num_args,
97 const char* const arg_names[], 96 const char* const arg_names[],
98 const unsigned char arg_types[], 97 const unsigned char arg_types[],
99 const unsigned long long arg_values[], 98 const unsigned long long arg_values[],
100 unsigned char flags); 99 unsigned char flags);
101 100
102 bool is_attached_; 101 bool is_attached_;
103 bool is_devtools_client_; 102 bool is_devtools_client_;
104 int32 gpu_route_id_; 103 int32 gpu_route_id_;
105 bool paused_in_mouse_move_; 104 bool paused_in_mouse_move_;
105 RenderFrame* main_render_frame_;
106 106
107 static base::subtle::AtomicWord /* TraceEventCallback */ event_callback_; 107 static base::subtle::AtomicWord /* TraceEventCallback */ event_callback_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); 109 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent);
110 }; 110 };
111 111
112 } // namespace content 112 } // namespace content
113 113
114 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_ 114 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698