| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/v8_inspector/V8InspectorSessionImpl.h" | 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/Parser.h" | 7 #include "platform/inspector_protocol/Parser.h" |
| 8 #include "platform/v8_inspector/InjectedScript.h" | 8 #include "platform/v8_inspector/InjectedScript.h" |
| 9 #include "platform/v8_inspector/InspectedContext.h" | 9 #include "platform/v8_inspector/InspectedContext.h" |
| 10 #include "platform/v8_inspector/RemoteObjectId.h" | 10 #include "platform/v8_inspector/RemoteObjectId.h" |
| 11 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" | 11 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" |
| 12 #include "platform/v8_inspector/V8Debugger.h" |
| 12 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 13 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 13 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" | 14 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" |
| 14 #include "platform/v8_inspector/V8InspectorImpl.h" | 15 #include "platform/v8_inspector/V8InspectorImpl.h" |
| 15 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" | 16 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" |
| 16 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" | 17 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" |
| 17 #include "platform/v8_inspector/V8StringUtil.h" | 18 #include "platform/v8_inspector/V8StringUtil.h" |
| 18 #include "platform/v8_inspector/public/V8ContextInfo.h" | 19 #include "platform/v8_inspector/public/V8ContextInfo.h" |
| 19 #include "platform/v8_inspector/public/V8InspectorClient.h" | 20 #include "platform/v8_inspector/public/V8InspectorClient.h" |
| 20 | 21 |
| 21 namespace blink { | 22 namespace blink { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 210 } |
| 210 | 211 |
| 211 std::unique_ptr<protocol::Runtime::API::RemoteObject> V8InspectorSessionImpl::wr
apObject(v8::Local<v8::Context> context, v8::Local<v8::Value> value, const Strin
g16& groupName) | 212 std::unique_ptr<protocol::Runtime::API::RemoteObject> V8InspectorSessionImpl::wr
apObject(v8::Local<v8::Context> context, v8::Local<v8::Value> value, const Strin
g16& groupName) |
| 212 { | 213 { |
| 213 return wrapObject(context, value, groupName, false); | 214 return wrapObject(context, value, groupName, false); |
| 214 } | 215 } |
| 215 | 216 |
| 216 std::unique_ptr<protocol::Runtime::RemoteObject> V8InspectorSessionImpl::wrapObj
ect(v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String16&
groupName, bool generatePreview) | 217 std::unique_ptr<protocol::Runtime::RemoteObject> V8InspectorSessionImpl::wrapObj
ect(v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String16&
groupName, bool generatePreview) |
| 217 { | 218 { |
| 218 ErrorString errorString; | 219 ErrorString errorString; |
| 219 InjectedScript* injectedScript = findInjectedScript(&errorString, V8Inspecto
rImpl::contextId(context)); | 220 InjectedScript* injectedScript = findInjectedScript(&errorString, V8Debugger
::contextId(context)); |
| 220 if (!injectedScript) | 221 if (!injectedScript) |
| 221 return nullptr; | 222 return nullptr; |
| 222 return injectedScript->wrapObject(&errorString, value, groupName, false, gen
eratePreview); | 223 return injectedScript->wrapObject(&errorString, value, groupName, false, gen
eratePreview); |
| 223 } | 224 } |
| 224 | 225 |
| 225 std::unique_ptr<protocol::Runtime::RemoteObject> V8InspectorSessionImpl::wrapTab
le(v8::Local<v8::Context> context, v8::Local<v8::Value> table, v8::Local<v8::Val
ue> columns) | 226 std::unique_ptr<protocol::Runtime::RemoteObject> V8InspectorSessionImpl::wrapTab
le(v8::Local<v8::Context> context, v8::Local<v8::Value> table, v8::Local<v8::Val
ue> columns) |
| 226 { | 227 { |
| 227 ErrorString errorString; | 228 ErrorString errorString; |
| 228 InjectedScript* injectedScript = findInjectedScript(&errorString, V8Inspecto
rImpl::contextId(context)); | 229 InjectedScript* injectedScript = findInjectedScript(&errorString, V8Debugger
::contextId(context)); |
| 229 if (!injectedScript) | 230 if (!injectedScript) |
| 230 return nullptr; | 231 return nullptr; |
| 231 return injectedScript->wrapTable(table, columns); | 232 return injectedScript->wrapTable(table, columns); |
| 232 } | 233 } |
| 233 | 234 |
| 234 void V8InspectorSessionImpl::setCustomObjectFormatterEnabled(bool enabled) | 235 void V8InspectorSessionImpl::setCustomObjectFormatterEnabled(bool enabled) |
| 235 { | 236 { |
| 236 m_customObjectFormatterEnabled = enabled; | 237 m_customObjectFormatterEnabled = enabled; |
| 237 const V8InspectorImpl::ContextByIdMap* contexts = m_inspector->contextGroup(
m_contextGroupId); | 238 const V8InspectorImpl::ContextByIdMap* contexts = m_inspector->contextGroup(
m_contextGroupId); |
| 238 if (!contexts) | 239 if (!contexts) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> V8Inspect
orSessionImpl::searchInTextByLines(const String16& text, const String16& query,
bool caseSensitive, bool isRegex) | 314 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> V8Inspect
orSessionImpl::searchInTextByLines(const String16& text, const String16& query,
bool caseSensitive, bool isRegex) |
| 314 { | 315 { |
| 315 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> matches = sear
chInTextByLinesImpl(this, text, query, caseSensitive, isRegex); | 316 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> matches = sear
chInTextByLinesImpl(this, text, query, caseSensitive, isRegex); |
| 316 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> resul
t = protocol::Array<protocol::Debugger::API::SearchMatch>::create(); | 317 std::unique_ptr<protocol::Array<protocol::Debugger::API::SearchMatch>> resul
t = protocol::Array<protocol::Debugger::API::SearchMatch>::create(); |
| 317 for (size_t i = 0; i < matches.size(); ++i) | 318 for (size_t i = 0; i < matches.size(); ++i) |
| 318 result->addItem(std::move(matches[i])); | 319 result->addItem(std::move(matches[i])); |
| 319 return result; | 320 return result; |
| 320 } | 321 } |
| 321 | 322 |
| 322 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |