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

Unified Diff: Source/bindings/v8/ScriptDebugServer.cpp

Issue 110663003: Remove uses of deprecated toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptDebugServer.cpp
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp
index 11b48147d0ee3924ece7c3c9c4a8d2bfa450917e..157000c4b4a6d5ba7ec251556f0a2f139fa16b1d 100644
--- a/Source/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/bindings/v8/ScriptDebugServer.cpp
@@ -298,13 +298,23 @@ bool ScriptDebugServer::setScriptSource(const String& sourceID, const String& ne
// Compile error.
case 1:
{
+ V8StringResource<WithUndefinedOrNullCheck> message(resultTuple->Get(2));
+ if (!message.prepare()) {
+ *error = "Unknown error.";
+ return false;
+ }
RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> compileError =
TypeBuilder::Debugger::SetScriptSourceError::CompileError::create()
- .setMessage(toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(2)))
+ .setMessage(message)
.setLineNumber(resultTuple->Get(3)->ToInteger()->Value())
.setColumnNumber(resultTuple->Get(4)->ToInteger()->Value());
- *error = toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1));
+ V8StringResource<WithUndefinedOrNullCheck> errorResource(resultTuple->Get(1));
+ if (!errorResource.prepare()) {
+ *error = "Unknown error.";
+ return false;
+ }
+ *error = errorResource;
errorData = TypeBuilder::Debugger::SetScriptSourceError::create();
errorData->setCompileError(compileError);
return false;
@@ -384,8 +394,10 @@ void ScriptDebugServer::handleProgramBreak(v8::Handle<v8::Object> executionState
Vector<String> breakpointIds;
if (!hitBreakpointNumbers.IsEmpty()) {
breakpointIds.resize(hitBreakpointNumbers->Length());
- for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++)
- breakpointIds[i] = toWebCoreStringWithUndefinedOrNullCheck(hitBreakpointNumbers->Get(i));
+ for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) {
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i));
+ breakpointIds[i] = hitBreakpointNumber;
+ }
}
m_executionState.set(m_isolate, executionState);
@@ -489,12 +501,15 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object)
{
- String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "id")));
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, sourceID, object->Get(v8AtomicString(m_isolate, "id")));
ScriptDebugListener::Script script;
- script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "name")));
- script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "source")));
- script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "sourceMappingURL")));
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, url, object->Get(v8AtomicString(m_isolate, "name")));
+ script.url = url;
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, source, object->Get(v8AtomicString(m_isolate, "source")));
+ script.source = source;
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, sourceMappingURL, object->Get(v8AtomicString(m_isolate, "sourceMappingURL")));
+ script.sourceMappingURL = sourceMappingURL;
script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToInteger()->Value();
script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))->ToInteger()->Value();
script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToInteger()->Value();
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698