| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DCHECK(!idValue.IsEmpty() && idValue->IsInt32()); | 71 DCHECK(!idValue.IsEmpty() && idValue->IsInt32()); |
| 72 m_id = String16::fromInteger(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_executionContextAuxData = toProtocolStringWithTypeCheck(object->Get(toV8St
ringInternalized(isolate, "executionContextAuxData"))); |
| 82 m_isInternalScript = object->Get(toV8StringInternalized(isolate, "isInternal
Script"))->ToBoolean(isolate)->Value(); | 82 m_isInternalScript = object->Get(toV8StringInternalized(isolate, "isInternal
Script"))->ToBoolean(isolate)->Value(); |
| 83 m_executionContextId = object->Get(toV8StringInternalized(isolate, "executio
nContextId"))->ToInteger(isolate)->Value(); | 83 m_executionContextId = object->Get(toV8StringInternalized(isolate, "executio
nContextId"))->ToInteger(isolate)->Value(); |
| 84 m_isLiveEdit = isLiveEdit; | 84 m_isLiveEdit = isLiveEdit; |
| 85 | 85 |
| 86 v8::Local<v8::Value> sourceValue = object->Get(toV8StringInternalized(isolat
e, "source")); | 86 v8::Local<v8::Value> sourceValue = object->Get(toV8StringInternalized(isolat
e, "source")); |
| 87 if (!sourceValue.IsEmpty() && sourceValue->IsString()) | 87 if (!sourceValue.IsEmpty() && sourceValue->IsString()) |
| 88 setSource(isolate, sourceValue.As<v8::String>()); | 88 setSource(isolate, sourceValue.As<v8::String>()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 V8DebuggerScript::~V8DebuggerScript() | 91 V8DebuggerScript::~V8DebuggerScript() |
| 92 { | 92 { |
| 93 } | 93 } |
| 94 | 94 |
| 95 String16 V8DebuggerScript::sourceURL() const | 95 const String16& V8DebuggerScript::sourceURL() const |
| 96 { | 96 { |
| 97 return m_sourceURL.isEmpty() ? m_url : m_sourceURL; | 97 return m_sourceURL.isEmpty() ? m_url : m_sourceURL; |
| 98 } | 98 } |
| 99 | 99 |
| 100 v8::Local<v8::String> V8DebuggerScript::source(v8::Isolate* isolate) const | 100 v8::Local<v8::String> V8DebuggerScript::source(v8::Isolate* isolate) const |
| 101 { | 101 { |
| 102 return m_source.Get(isolate); | 102 return m_source.Get(isolate); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void V8DebuggerScript::setSourceURL(const String16& sourceURL) | 105 void V8DebuggerScript::setSourceURL(const String16& sourceURL) |
| 106 { | 106 { |
| 107 m_sourceURL = sourceURL; | 107 m_sourceURL = sourceURL; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void V8DebuggerScript::setSourceMappingURL(const String16& sourceMappingURL) | 110 void V8DebuggerScript::setSourceMappingURL(const String16& sourceMappingURL) |
| 111 { | 111 { |
| 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 |