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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp

Issue 1810283003: [DevTools] Move getCollectionEntries to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-get-function-details
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 , m_native(injectedScriptNative) 69 , m_native(injectedScriptNative)
70 , m_contextId(contextId) 70 , m_contextId(contextId)
71 { 71 {
72 m_context.SetWeak(this, &weakCallback, v8::WeakCallbackType::kParameter); 72 m_context.SetWeak(this, &weakCallback, v8::WeakCallbackType::kParameter);
73 } 73 }
74 74
75 InjectedScript::~InjectedScript() 75 InjectedScript::~InjectedScript()
76 { 76 {
77 } 77 }
78 78
79 void InjectedScript::getCollectionEntries(ErrorString* errorString, const String 16& objectId, OwnPtr<Array<CollectionEntry>>* result)
80 {
81 v8::HandleScope handles(m_isolate);
82 V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "getCol lectionEntries");
83 function.appendArgument(objectId);
84 OwnPtr<protocol::Value> resultValue = makeCall(function);
85 protocol::ErrorSupport errors(errorString);
86 *result = Array<CollectionEntry>::parse(resultValue.get(), &errors);
87 }
88
89 void InjectedScript::getProperties(ErrorString* errorString, const String16& obj ectId, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, Ow nPtr<Array<PropertyDescriptor>>* properties, Maybe<protocol::Runtime::ExceptionD etails>* exceptionDetails) 79 void InjectedScript::getProperties(ErrorString* errorString, const String16& obj ectId, bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, Ow nPtr<Array<PropertyDescriptor>>* properties, Maybe<protocol::Runtime::ExceptionD etails>* exceptionDetails)
90 { 80 {
91 v8::HandleScope handles(m_isolate); 81 v8::HandleScope handles(m_isolate);
92 V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "getPro perties"); 82 V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "getPro perties");
93 function.appendArgument(objectId); 83 function.appendArgument(objectId);
94 function.appendArgument(ownProperties); 84 function.appendArgument(ownProperties);
95 function.appendArgument(accessorPropertiesOnly); 85 function.appendArgument(accessorPropertiesOnly);
96 function.appendArgument(generatePreview); 86 function.appendArgument(generatePreview);
97 87
98 OwnPtr<protocol::Value> result = makeCallWithExceptionDetails(function, exce ptionDetails); 88 OwnPtr<protocol::Value> result = makeCallWithExceptionDetails(function, exce ptionDetails);
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 return; 409 return;
420 *result = remoteObject.release(); 410 *result = remoteObject.release();
421 if (exceptionDetails) 411 if (exceptionDetails)
422 *exceptionDetails = createExceptionDetails(tryCatch.Message()); 412 *exceptionDetails = createExceptionDetails(tryCatch.Message());
423 if (wasThrown) 413 if (wasThrown)
424 *wasThrown = true; 414 *wasThrown = true;
425 } 415 }
426 } 416 }
427 417
428 } // namespace blink 418 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698