OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ | 5 #ifndef WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ |
6 #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ | 6 #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ |
7 | 7 |
8 #include <wtf/HashMap.h> | 8 #include <wtf/HashMap.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 WebDevToolsAgent::MessageLoopDispatchHandler handler); | 45 WebDevToolsAgent::MessageLoopDispatchHandler handler); |
46 | 46 |
47 // Sets |host_id| as the frame context data. This id is used to filter scripts | 47 // Sets |host_id| as the frame context data. This id is used to filter scripts |
48 // related to the inspected page. | 48 // related to the inspected page. |
49 static void SetHostId(WebFrameImpl* webframe, int host_id); | 49 static void SetHostId(WebFrameImpl* webframe, int host_id); |
50 | 50 |
51 static void OnWebViewClosed(WebViewImpl* webview); | 51 static void OnWebViewClosed(WebViewImpl* webview); |
52 | 52 |
53 static void OnNavigate(); | 53 static void OnNavigate(); |
54 | 54 |
| 55 class UtilityContextScope { |
| 56 public: |
| 57 UtilityContextScope() { |
| 58 DCHECK(!in_utility_context_); |
| 59 in_utility_context_ = true; |
| 60 } |
| 61 ~UtilityContextScope() { |
| 62 if (debug_break_delayed_) { |
| 63 v8::Debug::DebugBreak(); |
| 64 debug_break_delayed_ = false; |
| 65 } |
| 66 in_utility_context_ = false; |
| 67 } |
| 68 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(UtilityContextScope); |
| 70 }; |
| 71 |
55 private: | 72 private: |
56 DebuggerAgentManager(); | 73 DebuggerAgentManager(); |
57 ~DebuggerAgentManager(); | 74 ~DebuggerAgentManager(); |
58 | 75 |
59 static void V8DebugHostDispatchHandler(); | 76 static void V8DebugHostDispatchHandler(); |
60 static void OnV8DebugMessage(const v8::Debug::Message& message); | 77 static void OnV8DebugMessage(const v8::Debug::Message& message); |
61 static void SendCommandToV8(const string16& cmd, | 78 static void SendCommandToV8(const string16& cmd, |
62 v8::Debug::ClientData* data); | 79 v8::Debug::ClientData* data); |
63 static void SendContinueCommandToV8(); | 80 static void SendContinueCommandToV8(); |
64 | 81 |
65 static DebuggerAgentImpl* FindAgentForCurrentV8Context(); | 82 static DebuggerAgentImpl* FindAgentForCurrentV8Context(); |
66 static DebuggerAgentImpl* DebuggerAgentForHostId(int host_id); | 83 static DebuggerAgentImpl* DebuggerAgentForHostId(int host_id); |
67 | 84 |
68 typedef HashMap<int, DebuggerAgentImpl*> AttachedAgentsMap; | 85 typedef HashMap<int, DebuggerAgentImpl*> AttachedAgentsMap; |
69 static AttachedAgentsMap* attached_agents_map_; | 86 static AttachedAgentsMap* attached_agents_map_; |
70 | 87 |
71 static WebDevToolsAgent::MessageLoopDispatchHandler | 88 static WebDevToolsAgent::MessageLoopDispatchHandler |
72 message_loop_dispatch_handler_; | 89 message_loop_dispatch_handler_; |
73 static bool in_host_dispatch_handler_; | 90 static bool in_host_dispatch_handler_; |
74 typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*> | 91 typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*> |
75 DeferrersMap; | 92 DeferrersMap; |
76 static DeferrersMap page_deferrers_; | 93 static DeferrersMap page_deferrers_; |
77 | 94 |
| 95 static bool in_utility_context_; |
| 96 static bool debug_break_delayed_; |
| 97 |
78 DISALLOW_COPY_AND_ASSIGN(DebuggerAgentManager); | 98 DISALLOW_COPY_AND_ASSIGN(DebuggerAgentManager); |
79 }; | 99 }; |
80 | 100 |
81 #endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ | 101 #endif // WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_MANAGER_H_ |
OLD | NEW |