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

Side by Side Diff: Source/bindings/v8/ScriptDebugServer.cpp

Issue 341713008: Fix crash in ScriptDebugServer::setBreakpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 v8::Local<v8::Object> info = v8::Object::New(m_isolate); 94 v8::Local<v8::Object> info = v8::Object::New(m_isolate);
95 info->Set(v8AtomicString(m_isolate, "sourceID"), v8String(debuggerContext->G etIsolate(), sourceID)); 95 info->Set(v8AtomicString(m_isolate, "sourceID"), v8String(debuggerContext->G etIsolate(), sourceID));
96 info->Set(v8AtomicString(m_isolate, "lineNumber"), v8::Integer::New(debugger Context->GetIsolate(), scriptBreakpoint.lineNumber)); 96 info->Set(v8AtomicString(m_isolate, "lineNumber"), v8::Integer::New(debugger Context->GetIsolate(), scriptBreakpoint.lineNumber));
97 info->Set(v8AtomicString(m_isolate, "columnNumber"), v8::Integer::New(debugg erContext->GetIsolate(), scriptBreakpoint.columnNumber)); 97 info->Set(v8AtomicString(m_isolate, "columnNumber"), v8::Integer::New(debugg erContext->GetIsolate(), scriptBreakpoint.columnNumber));
98 info->Set(v8AtomicString(m_isolate, "interstatementLocation"), v8Boolean(int erstatementLocation, debuggerContext->GetIsolate())); 98 info->Set(v8AtomicString(m_isolate, "interstatementLocation"), v8Boolean(int erstatementLocation, debuggerContext->GetIsolate()));
99 info->Set(v8AtomicString(m_isolate, "condition"), v8String(debuggerContext-> GetIsolate(), scriptBreakpoint.condition)); 99 info->Set(v8AtomicString(m_isolate, "condition"), v8String(debuggerContext-> GetIsolate(), scriptBreakpoint.condition));
100 100
101 v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Ca st(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "setBreak point"))); 101 v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Ca st(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "setBreak point")));
102 v8::Handle<v8::Value> breakpointId = v8::Debug::Call(setBreakpointFunction, info); 102 v8::Handle<v8::Value> breakpointId = v8::Debug::Call(setBreakpointFunction, info);
103 if (!breakpointId->IsString()) 103 if (breakpointId.IsEmpty() || !breakpointId->IsString())
104 return ""; 104 return "";
105 *actualLineNumber = info->Get(v8AtomicString(m_isolate, "lineNumber"))->Int3 2Value(); 105 *actualLineNumber = info->Get(v8AtomicString(m_isolate, "lineNumber"))->Int3 2Value();
106 *actualColumnNumber = info->Get(v8AtomicString(m_isolate, "columnNumber"))-> Int32Value(); 106 *actualColumnNumber = info->Get(v8AtomicString(m_isolate, "columnNumber"))-> Int32Value();
107 return toCoreString(breakpointId.As<v8::String>()); 107 return toCoreString(breakpointId.As<v8::String>());
108 } 108 }
109 109
110 void ScriptDebugServer::removeBreakpoint(const String& breakpointId) 110 void ScriptDebugServer::removeBreakpoint(const String& breakpointId)
111 { 111 {
112 v8::HandleScope scope(m_isolate); 112 v8::HandleScope scope(m_isolate);
113 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); 113 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 { 636 {
637 return PassOwnPtr<ScriptSourceCode>(); 637 return PassOwnPtr<ScriptSourceCode>();
638 } 638 }
639 639
640 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName) 640 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName)
641 { 641 {
642 return source; 642 return source;
643 } 643 }
644 644
645 } // namespace WebCore 645 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698