| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/inspector/v8-debugger-script.h" | 5 #include "src/inspector/v8-debugger-script.h" |
| 6 | 6 |
| 7 #include "src/inspector/string-util.h" | 7 #include "src/inspector/string-util.h" |
| 8 | 8 |
| 9 namespace v8_inspector { | 9 namespace v8_inspector { |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 for (size_t i = 0; i < hashesSize; ++i) | 61 for (size_t i = 0; i < hashesSize; ++i) |
| 62 hashes[i] = (hashes[i] + zi[i] * (prime[i] - 1)) % prime[i]; | 62 hashes[i] = (hashes[i] + zi[i] * (prime[i] - 1)) % prime[i]; |
| 63 | 63 |
| 64 String16Builder hash; | 64 String16Builder hash; |
| 65 for (size_t i = 0; i < hashesSize; ++i) appendUnsignedAsHex(hashes[i], &hash); | 65 for (size_t i = 0; i < hashesSize; ++i) appendUnsignedAsHex(hashes[i], &hash); |
| 66 return hash.toString(); | 66 return hash.toString(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, | 69 V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, |
| 70 v8::Local<v8::DebugInterface::Script> script, | 70 v8::Local<v8::debug::Script> script, |
| 71 bool isLiveEdit) { | 71 bool isLiveEdit) { |
| 72 m_isolate = script->GetIsolate(); | 72 m_isolate = script->GetIsolate(); |
| 73 m_id = String16::fromInteger(script->Id()); | 73 m_id = String16::fromInteger(script->Id()); |
| 74 v8::Local<v8::String> tmp; | 74 v8::Local<v8::String> tmp; |
| 75 if (script->Name().ToLocal(&tmp)) m_url = toProtocolString(tmp); | 75 if (script->Name().ToLocal(&tmp)) m_url = toProtocolString(tmp); |
| 76 if (script->SourceURL().ToLocal(&tmp)) { | 76 if (script->SourceURL().ToLocal(&tmp)) { |
| 77 m_sourceURL = toProtocolString(tmp); | 77 m_sourceURL = toProtocolString(tmp); |
| 78 if (m_url.isEmpty()) m_url = toProtocolString(tmp); | 78 if (m_url.isEmpty()) m_url = toProtocolString(tmp); |
| 79 } | 79 } |
| 80 if (script->SourceMappingURL().ToLocal(&tmp)) | 80 if (script->SourceMappingURL().ToLocal(&tmp)) |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void V8DebuggerScript::setSource(v8::Local<v8::String> source) { | 169 void V8DebuggerScript::setSource(v8::Local<v8::String> source) { |
| 170 m_source = String16(); | 170 m_source = String16(); |
| 171 m_sourceObj.Reset(m_isolate, source); | 171 m_sourceObj.Reset(m_isolate, source); |
| 172 m_hash = String16(); | 172 m_hash = String16(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool V8DebuggerScript::getPossibleBreakpoints( | 175 bool V8DebuggerScript::getPossibleBreakpoints( |
| 176 const v8::debug::Location& start, const v8::debug::Location& end, | 176 const v8::debug::Location& start, const v8::debug::Location& end, |
| 177 std::vector<v8::debug::Location>* locations) { | 177 std::vector<v8::debug::Location>* locations) { |
| 178 v8::HandleScope scope(m_isolate); | 178 v8::HandleScope scope(m_isolate); |
| 179 v8::Local<v8::DebugInterface::Script> script = m_script.Get(m_isolate); | 179 v8::Local<v8::debug::Script> script = m_script.Get(m_isolate); |
| 180 return script->GetPossibleBreakpoints(start, end, locations); | 180 return script->GetPossibleBreakpoints(start, end, locations); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace v8_inspector | 183 } // namespace v8_inspector |
| OLD | NEW |