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

Side by Side Diff: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 1020233002: [bindings] [devtools] Migrate the usage of ScriptValue.toJSONValue() to ScriptValue::to<JSONValuePt… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 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
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2011 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 void V8InjectedScriptHost::inspectMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& info) 353 void V8InjectedScriptHost::inspectMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& info)
354 { 354 {
355 if (info.Length() < 2) 355 if (info.Length() < 2)
356 return; 356 return;
357 357
358 InjectedScriptHost* host = V8InjectedScriptHost::toImpl(info.Holder()); 358 InjectedScriptHost* host = V8InjectedScriptHost::toImpl(info.Holder());
359 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 359 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
360 ScriptValue object(scriptState, info[0]); 360 ScriptValue object(scriptState, info[0]);
361 ScriptValue hints(scriptState, info[1]); 361 ScriptValue hints(scriptState, info[1]);
362 host->inspectImpl(object.toJSONValue(scriptState), hints.toJSONValue(scriptS tate)); 362 host->inspectImpl(toJSONValue(object), toJSONValue(hints));
363 } 363 }
364 364
365 void V8InjectedScriptHost::evalMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& info) 365 void V8InjectedScriptHost::evalMethodCustom(const v8::FunctionCallbackInfo<v8::V alue>& info)
366 { 366 {
367 v8::Isolate* isolate = info.GetIsolate(); 367 v8::Isolate* isolate = info.GetIsolate();
368 if (info.Length() < 1) { 368 if (info.Length() < 1) {
369 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "One argument expected."))); 369 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "One argument expected.")));
370 return; 370 return;
371 } 371 }
372 372
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder()); 598 InjectedScriptNative* injectedScriptNative = InjectedScriptNative::fromInjec tedScriptHost(info.Holder());
599 if (!injectedScriptNative) 599 if (!injectedScriptNative)
600 return; 600 return;
601 int id = info[0]->ToInt32(info.GetIsolate())->Value(); 601 int id = info[0]->ToInt32(info.GetIsolate())->Value();
602 String groupName = injectedScriptNative->groupName(id); 602 String groupName = injectedScriptNative->groupName(id);
603 if (!groupName.isEmpty()) 603 if (!groupName.isEmpty())
604 info.GetReturnValue().Set(v8String(info.GetIsolate(), groupName)); 604 info.GetReturnValue().Set(v8String(info.GetIsolate(), groupName));
605 } 605 }
606 606
607 } // namespace blink 607 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698