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

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

Issue 2214193002: [DevTools] Introduce unserializableValue in RemoteObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hidden Created 4 years, 4 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return v8::MaybeLocal<v8::Value>(); 282 return v8::MaybeLocal<v8::Value>();
283 if (remoteObjectId->contextId() != m_context->contextId()) { 283 if (remoteObjectId->contextId() != m_context->contextId()) {
284 *errorString = "Argument should belong to the same JavaScript world as target object"; 284 *errorString = "Argument should belong to the same JavaScript world as target object";
285 return v8::MaybeLocal<v8::Value>(); 285 return v8::MaybeLocal<v8::Value>();
286 } 286 }
287 v8::Local<v8::Value> object; 287 v8::Local<v8::Value> object;
288 if (!findObject(errorString, *remoteObjectId, &object)) 288 if (!findObject(errorString, *remoteObjectId, &object))
289 return v8::MaybeLocal<v8::Value>(); 289 return v8::MaybeLocal<v8::Value>();
290 return object; 290 return object;
291 } 291 }
292 if (callArgument->hasValue()) { 292 if (callArgument->hasValue() || callArgument->hasUnserializableValue()) {
293 String16 value = callArgument->getValue(nullptr)->toJSONString(); 293 String16 value = callArgument->hasValue() ?
294 if (callArgument->getType(String16()) == "number") 294 callArgument->getValue(nullptr)->toJSONString() :
295 value = "Number(" + value + ")"; 295 "Number(\"" + callArgument->getUnserializableValue("") + "\")";
296 v8::Local<v8::Value> object; 296 v8::Local<v8::Value> object;
297 if (!m_context->inspector()->compileAndRunInternalScript(m_context->cont ext(), toV8String(m_context->isolate(), value)).ToLocal(&object)) { 297 if (!m_context->inspector()->compileAndRunInternalScript(m_context->cont ext(), toV8String(m_context->isolate(), value)).ToLocal(&object)) {
298 *errorString = "Couldn't parse value object in call argument"; 298 *errorString = "Couldn't parse value object in call argument";
299 return v8::MaybeLocal<v8::Value>(); 299 return v8::MaybeLocal<v8::Value>();
300 } 300 }
301 return object; 301 return object;
302 } 302 }
303 return v8::Undefined(m_context->isolate()); 303 return v8::Undefined(m_context->isolate());
304 } 304 }
305 305
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl* session) 488 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl* session)
489 { 489 {
490 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err orString, m_remoteCallFrameId); 490 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err orString, m_remoteCallFrameId);
491 if (!remoteId) 491 if (!remoteId)
492 return; 492 return;
493 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); 493 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal());
494 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get() ); 494 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get() );
495 } 495 }
496 496
497 } // namespace blink 497 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698