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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp

Issue 1942073002: [DevTools] Move getCompletions to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
index dac95be11b5d65e70751095b81d9f729658e411c..b81e8a6a749d8145b6e45b0decf812a7524ed1bf 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
@@ -238,6 +238,35 @@ void V8RuntimeAgentImpl::getProperties(
*internalProperties = propertiesProtocolArray.release();
}
+void V8RuntimeAgentImpl::getCompletions(
+ ErrorString* errorString,
+ const Maybe<String16>& objectId,
+ const Maybe<String16>& primitiveType,
+ OwnPtr<protocol::Array<String16>>* completions)
+{
+ if (!objectId.isJust() && !primitiveType.isJust() && !(primitiveType.isJust() && objectId.isJust())) {
+ *errorString = "'objectId' or 'primitiveType 'should be passed.";
+ return;
+ }
+ if (objectId.isJust()) {
+ InjectedScript::ObjectScope scope(errorString, m_debugger, m_session->contextGroupId(), objectId.fromJust());
+ if (!scope.initialize())
+ return;
+ scope.injectedScript()->getCompletions(errorString, scope.object(), completions);
+ } else {
+ int contextId = m_debugger->client()->ensureDefaultContextInGroup(m_session->contextGroupId());
+ if (!contextId) {
+ *errorString = "Cannot find default execution context";
+ return;
+ }
+ InjectedScript::ContextScope scope(errorString, m_debugger, m_session->contextGroupId(), contextId);
+ if (!scope.initialize())
+ return;
+ scope.injectedScript()->getCompletions(errorString, primitiveType.fromJust(), completions);
+ }
+}
+
+
void V8RuntimeAgentImpl::releaseObject(ErrorString* errorString, const String16& objectId)
{
InjectedScript::ObjectScope scope(errorString, m_debugger, m_session->contextGroupId(), objectId);

Powered by Google App Engine
This is Rietveld 408576698