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

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

Issue 1779033003: DevTools: always use 16bit strings for inspector 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 /* 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 return nullptr; 440 return nullptr;
441 } 441 }
442 442
443 bool hadException = false; 443 bool hadException = false;
444 v8::Local<v8::Value> resultValue = callFunctionWithEvalEnabled(function, had Exception); 444 v8::Local<v8::Value> resultValue = callFunctionWithEvalEnabled(function, had Exception);
445 445
446 ASSERT(!hadException); 446 ASSERT(!hadException);
447 if (!hadException) { 447 if (!hadException) {
448 result = toProtocolValue(function.context(), resultValue); 448 result = toProtocolValue(function.context(), resultValue);
449 if (!result) 449 if (!result)
450 result = protocol::StringValue::create("Object has too long referenc e chain(must not be longer than " + String16::number(protocol::Value::maxDepth) + ")"); 450 result = protocol::StringValue::create("Object has too long referenc e chain");
451 } else { 451 } else {
452 result = protocol::StringValue::create("Exception while making a call.") ; 452 result = protocol::StringValue::create("Exception while making a call.") ;
453 } 453 }
454 return result.release(); 454 return result.release();
455 } 455 }
456 456
457 PassOwnPtr<protocol::Runtime::RemoteObject> InjectedScript::makeEvalCall(ErrorSt ring* errorString, V8FunctionCall& function, Maybe<bool>* wasThrown, Maybe<proto col::Runtime::ExceptionDetails>* exceptionDetails) 457 PassOwnPtr<protocol::Runtime::RemoteObject> InjectedScript::makeEvalCall(ErrorSt ring* errorString, V8FunctionCall& function, Maybe<bool>* wasThrown, Maybe<proto col::Runtime::ExceptionDetails>* exceptionDetails)
458 { 458 {
459 OwnPtr<protocol::Value> result = makeCall(function); 459 OwnPtr<protocol::Value> result = makeCall(function);
460 if (!result) { 460 if (!result) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 v8::Context::Scope scope(context()); 494 v8::Context::Scope scope(context());
495 v8::TryCatch tryCatch(m_isolate); 495 v8::TryCatch tryCatch(m_isolate);
496 v8::Local<v8::Value> resultValue = function.callWithoutExceptionHandling(); 496 v8::Local<v8::Value> resultValue = function.callWithoutExceptionHandling();
497 if (tryCatch.HasCaught()) { 497 if (tryCatch.HasCaught()) {
498 v8::Local<v8::Message> message = tryCatch.Message(); 498 v8::Local<v8::Message> message = tryCatch.Message();
499 String16 text = !message.IsEmpty() ? toProtocolStringWithTypeCheck(messa ge->Get()) : "Internal error"; 499 String16 text = !message.IsEmpty() ? toProtocolStringWithTypeCheck(messa ge->Get()) : "Internal error";
500 *exceptionDetails = protocol::Runtime::ExceptionDetails::create().setTex t(text).build(); 500 *exceptionDetails = protocol::Runtime::ExceptionDetails::create().setTex t(text).build();
501 } else { 501 } else {
502 result = toProtocolValue(function.context(), resultValue); 502 result = toProtocolValue(function.context(), resultValue);
503 if (!result) 503 if (!result)
504 result = protocol::StringValue::create("Object has too long referenc e chain(must not be longer than " + String16::number(protocol::Value::maxDepth) + ")"); 504 result = protocol::StringValue::create("Object has too long referenc e chain");
505 } 505 }
506 return result.release(); 506 return result.release();
507 } 507 }
508 508
509 void InjectedScript::dispose() 509 void InjectedScript::dispose()
510 { 510 {
511 m_manager->discardInjectedScript(m_contextId); 511 m_manager->discardInjectedScript(m_contextId);
512 } 512 }
513 513
514 } // namespace blink 514 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698