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

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

Issue 1738073002: DevTools: introduce protocol::Value, baseline for hierarchical data in remote debugging protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/V8InjectedScriptHost.h" 5 #include "platform/v8_inspector/V8InjectedScriptHost.h"
6 6
7 #include "platform/JSONValues.h" 7 #include "platform/inspector_protocol/Values.h"
8 #include "platform/JSONValuesForV8.h"
9 #include "platform/v8_inspector/InjectedScript.h" 8 #include "platform/v8_inspector/InjectedScript.h"
10 #include "platform/v8_inspector/InjectedScriptHost.h" 9 #include "platform/v8_inspector/InjectedScriptHost.h"
11 #include "platform/v8_inspector/InspectorWrapper.h" 10 #include "platform/v8_inspector/InspectorWrapper.h"
12 #include "platform/v8_inspector/JavaScriptCallFrame.h" 11 #include "platform/v8_inspector/JavaScriptCallFrame.h"
13 #include "platform/v8_inspector/V8DebuggerImpl.h" 12 #include "platform/v8_inspector/V8DebuggerImpl.h"
14 #include "platform/v8_inspector/V8StringUtil.h" 13 #include "platform/v8_inspector/V8StringUtil.h"
15 #include "platform/v8_inspector/public/V8DebuggerClient.h" 14 #include "platform/v8_inspector/public/V8DebuggerClient.h"
16 #include "platform/v8_inspector/public/V8EventListenerInfo.h" 15 #include "platform/v8_inspector/public/V8EventListenerInfo.h"
16 #include "platform/v8_inspector/public/V8ToProtocolValue.h"
17 #include "wtf/HashSet.h" 17 #include "wtf/HashSet.h"
18 #include "wtf/NonCopyingSort.h" 18 #include "wtf/NonCopyingSort.h"
19 #include "wtf/RefPtr.h" 19 #include "wtf/RefPtr.h"
20 #include "wtf/text/WTFString.h" 20 #include "wtf/text/WTFString.h"
21 #include <algorithm> 21 #include <algorithm>
22 22
23 namespace blink { 23 namespace blink {
24 24
25 namespace { 25 namespace {
26 26
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 v8SetReturnValue(info, result); 265 v8SetReturnValue(info, result);
266 } 266 }
267 267
268 void V8InjectedScriptHost::inspectCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 268 void V8InjectedScriptHost::inspectCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
269 { 269 {
270 if (info.Length() < 2) 270 if (info.Length() < 2)
271 return; 271 return;
272 272
273 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); 273 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
274 InjectedScriptHost* host = V8InjectedScriptHost::unwrap(context, info.Holder ()); 274 InjectedScriptHost* host = V8InjectedScriptHost::unwrap(context, info.Holder ());
275 host->inspectImpl(toJSONValue(context, info[0]), toJSONValue(context, info[1 ])); 275 host->inspectImpl(toProtocolValue(context, info[0]), toProtocolValue(context , info[1]));
276 } 276 }
277 277
278 void V8InjectedScriptHost::evalCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 278 void V8InjectedScriptHost::evalCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
279 { 279 {
280 v8::Isolate* isolate = info.GetIsolate(); 280 v8::Isolate* isolate = info.GetIsolate();
281 if (info.Length() < 1) { 281 if (info.Length() < 1) {
282 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "One argument expected."))); 282 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "One argument expected.")));
283 return; 283 return;
284 } 284 }
285 285
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 { 605 {
606 return InjectedScriptHostWrapper::wrap(client, constructorTemplate, context, host); 606 return InjectedScriptHostWrapper::wrap(client, constructorTemplate, context, host);
607 } 607 }
608 608
609 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Context> context, v8::Local<v8::Object> object) 609 InjectedScriptHost* V8InjectedScriptHost::unwrap(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
610 { 610 {
611 return InjectedScriptHostWrapper::unwrap(context, object); 611 return InjectedScriptHostWrapper::unwrap(context, object);
612 } 612 }
613 613
614 } // namespace blink 614 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698