| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 "platform/v8_inspector/V8DebuggerScript.h" | 5 #include "platform/v8_inspector/V8DebuggerScript.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/Collections.h" | 7 #include "platform/inspector_protocol/Collections.h" |
| 8 #include "platform/inspector_protocol/Platform.h" | 8 #include "platform/inspector_protocol/Platform.h" |
| 9 #include "platform/v8_inspector/V8StringUtil.h" | 9 #include "platform/v8_inspector/V8StringUtil.h" |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 String16Builder hash; | 62 String16Builder hash; |
| 63 for (size_t i = 0; i < hashesSize; ++i) | 63 for (size_t i = 0; i < hashesSize; ++i) |
| 64 appendUnsignedAsHex(hashes[i], &hash); | 64 appendUnsignedAsHex(hashes[i], &hash); |
| 65 return hash.toString(); | 65 return hash.toString(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, v8::Local<v8::Object> o
bject, bool isLiveEdit) | 68 V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, v8::Local<v8::Object> o
bject, bool isLiveEdit) |
| 69 { | 69 { |
| 70 v8::Local<v8::Value> idValue = object->Get(toV8StringInternalized(isolate, "
id")); | 70 v8::Local<v8::Value> idValue = object->Get(toV8StringInternalized(isolate, "
id")); |
| 71 DCHECK(!idValue.IsEmpty() && idValue->IsInt32()); | 71 DCHECK(!idValue.IsEmpty() && idValue->IsInt32()); |
| 72 m_id = String16::number(idValue->Int32Value()); | 72 m_id = String16::fromInteger(idValue->Int32Value()); |
| 73 | 73 |
| 74 m_url = toProtocolStringWithTypeCheck(object->Get(toV8StringInternalized(iso
late, "name"))); | 74 m_url = toProtocolStringWithTypeCheck(object->Get(toV8StringInternalized(iso
late, "name"))); |
| 75 m_sourceURL = toProtocolStringWithTypeCheck(object->Get(toV8StringInternaliz
ed(isolate, "sourceURL"))); | 75 m_sourceURL = toProtocolStringWithTypeCheck(object->Get(toV8StringInternaliz
ed(isolate, "sourceURL"))); |
| 76 m_sourceMappingURL = toProtocolStringWithTypeCheck(object->Get(toV8StringInt
ernalized(isolate, "sourceMappingURL"))); | 76 m_sourceMappingURL = toProtocolStringWithTypeCheck(object->Get(toV8StringInt
ernalized(isolate, "sourceMappingURL"))); |
| 77 m_startLine = object->Get(toV8StringInternalized(isolate, "startLine"))->ToI
nteger(isolate)->Value(); | 77 m_startLine = object->Get(toV8StringInternalized(isolate, "startLine"))->ToI
nteger(isolate)->Value(); |
| 78 m_startColumn = object->Get(toV8StringInternalized(isolate, "startColumn"))-
>ToInteger(isolate)->Value(); | 78 m_startColumn = object->Get(toV8StringInternalized(isolate, "startColumn"))-
>ToInteger(isolate)->Value(); |
| 79 m_endLine = object->Get(toV8StringInternalized(isolate, "endLine"))->ToInteg
er(isolate)->Value(); | 79 m_endLine = object->Get(toV8StringInternalized(isolate, "endLine"))->ToInteg
er(isolate)->Value(); |
| 80 m_endColumn = object->Get(toV8StringInternalized(isolate, "endColumn"))->ToI
nteger(isolate)->Value(); | 80 m_endColumn = object->Get(toV8StringInternalized(isolate, "endColumn"))->ToI
nteger(isolate)->Value(); |
| 81 m_isContentScript = object->Get(toV8StringInternalized(isolate, "isContentSc
ript"))->ToBoolean(isolate)->Value(); | 81 m_isContentScript = object->Get(toV8StringInternalized(isolate, "isContentSc
ript"))->ToBoolean(isolate)->Value(); |
| 82 m_isInternalScript = object->Get(toV8StringInternalized(isolate, "isInternal
Script"))->ToBoolean(isolate)->Value(); | 82 m_isInternalScript = object->Get(toV8StringInternalized(isolate, "isInternal
Script"))->ToBoolean(isolate)->Value(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 112 m_sourceMappingURL = sourceMappingURL; | 112 m_sourceMappingURL = sourceMappingURL; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void V8DebuggerScript::setSource(v8::Isolate* isolate, v8::Local<v8::String> sou
rce) | 115 void V8DebuggerScript::setSource(v8::Isolate* isolate, v8::Local<v8::String> sou
rce) |
| 116 { | 116 { |
| 117 m_source.Reset(isolate, source); | 117 m_source.Reset(isolate, source); |
| 118 m_hash = calculateHash(toProtocolString(source)); | 118 m_hash = calculateHash(toProtocolString(source)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |