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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include <wtf/HashSet.h> | 7 #include <wtf/HashSet.h> |
8 #include <wtf/RefPtr.h> | 8 #include <wtf/RefPtr.h> |
9 #include <wtf/Vector.h> | 9 #include <wtf/Vector.h> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 void DebuggerAgentImpl::DebugBreak() { | 53 void DebuggerAgentImpl::DebugBreak() { |
54 DebuggerAgentManager::DebugBreak(this); | 54 DebuggerAgentManager::DebugBreak(this); |
55 } | 55 } |
56 | 56 |
57 void DebuggerAgentImpl::GetContextId() { | 57 void DebuggerAgentImpl::GetContextId() { |
58 delegate_->DidGetContextId(webdevtools_agent_->host_id()); | 58 delegate_->DidGetContextId(webdevtools_agent_->host_id()); |
59 } | 59 } |
60 | 60 |
| 61 void DebuggerAgentImpl::StartProfiling() { |
| 62 v8::V8::ResumeProfiler(); |
| 63 } |
| 64 |
| 65 void DebuggerAgentImpl::StopProfiling() { |
| 66 v8::V8::PauseProfiler(); |
| 67 } |
| 68 |
| 69 void DebuggerAgentImpl::GetLogLines(int position) { |
| 70 static char buffer[65536]; |
| 71 int read_size = v8::V8::GetLogLines(position, buffer, sizeof(buffer) - 1); |
| 72 buffer[read_size] = '\0'; |
| 73 DidGetLogLines(buffer, position + read_size); |
| 74 } |
| 75 |
61 void DebuggerAgentImpl::DebuggerOutput(const std::string& command) { | 76 void DebuggerAgentImpl::DebuggerOutput(const std::string& command) { |
62 delegate_->DebuggerOutput(command); | 77 delegate_->DebuggerOutput(command); |
63 webdevtools_agent_->ForceRepaint(); | 78 webdevtools_agent_->ForceRepaint(); |
64 } | 79 } |
65 | 80 |
| 81 void DebuggerAgentImpl::DidGetLogLines( |
| 82 const std::string& log, int new_position) { |
| 83 delegate_->DidGetLogLines(log, new_position); |
| 84 } |
| 85 |
66 // static | 86 // static |
67 void DebuggerAgentImpl::ResetUtilityContext( | 87 void DebuggerAgentImpl::ResetUtilityContext( |
68 Document* document, | 88 Document* document, |
69 v8::Persistent<v8::Context>* context) { | 89 v8::Persistent<v8::Context>* context) { |
70 if (!context->IsEmpty()) { | 90 if (!context->IsEmpty()) { |
71 context->Dispose(); | 91 context->Dispose(); |
72 context->Clear(); | 92 context->Clear(); |
73 } | 93 } |
74 if (!document) { | 94 if (!document) { |
75 return; | 95 return; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return ""; | 174 return ""; |
155 } else { | 175 } else { |
156 v8::Handle<v8::String> res_json = v8::Handle<v8::String>::Cast(res_obj); | 176 v8::Handle<v8::String> res_json = v8::Handle<v8::String>::Cast(res_obj); |
157 return WebCore::toWebCoreString(res_json); | 177 return WebCore::toWebCoreString(res_json); |
158 } | 178 } |
159 } | 179 } |
160 | 180 |
161 WebCore::Page* DebuggerAgentImpl::GetPage() { | 181 WebCore::Page* DebuggerAgentImpl::GetPage() { |
162 return web_view_impl_->page(); | 182 return web_view_impl_->page(); |
163 } | 183 } |
OLD | NEW |