OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "bindings/core/v8/ScriptSourceCode.h" | 5 #include "bindings/core/v8/ScriptSourceCode.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 ScriptSourceCode::ScriptSourceCode() | 9 ScriptSourceCode::ScriptSourceCode() |
10 : m_startPosition(TextPosition::minimumPosition()) {} | 10 : m_startPosition(TextPosition::minimumPosition()) {} |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const ResourceResponse& response = m_resource->response(); | 56 const ResourceResponse& response = m_resource->response(); |
57 String sourceMapUrl = response.httpHeaderField(HTTPNames::SourceMap); | 57 String sourceMapUrl = response.httpHeaderField(HTTPNames::SourceMap); |
58 if (sourceMapUrl.isEmpty()) { | 58 if (sourceMapUrl.isEmpty()) { |
59 // Try to get deprecated header. | 59 // Try to get deprecated header. |
60 sourceMapUrl = response.httpHeaderField(HTTPNames::X_SourceMap); | 60 sourceMapUrl = response.httpHeaderField(HTTPNames::X_SourceMap); |
61 } | 61 } |
62 return sourceMapUrl; | 62 return sourceMapUrl; |
63 } | 63 } |
64 | 64 |
65 void ScriptSourceCode::treatNullSourceAsEmpty() { | 65 void ScriptSourceCode::treatNullSourceAsEmpty() { |
66 // ScriptSourceCode allows for the representation of the null/not-there-really
ScriptSourceCode value. | 66 // ScriptSourceCode allows for the representation of the null/not-there-really |
67 // Encoded by way of a m_source.isNull() being true, with the nullary construc
tor to be used to | 67 // ScriptSourceCode value. Encoded by way of a m_source.isNull() being true, |
68 // construct such a value. | 68 // with the nullary constructor to be used to construct such a value. |
69 // | 69 // |
70 // Should the other constructors be passed a null string, that is interpreted
as representing | 70 // Should the other constructors be passed a null string, that is interpreted |
71 // the empty script. Consequently, we need to disambiguate between such null s
tring occurrences. | 71 // as representing the empty script. Consequently, we need to disambiguate |
72 // Do that by converting the latter case's null strings into empty ones. | 72 // between such null string occurrences. Do that by converting the latter |
| 73 // case's null strings into empty ones. |
73 if (m_source.isNull()) | 74 if (m_source.isNull()) |
74 m_source = ""; | 75 m_source = ""; |
75 } | 76 } |
76 | 77 |
77 } // namespace blink | 78 } // namespace blink |
OLD | NEW |