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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerScript.cpp

Issue 2104063002: [DevTools] Store script source in v8::Global. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
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 namespace blink { 7 namespace blink {
8 8
9 V8DebuggerScript::V8DebuggerScript() 9 V8DebuggerScript::V8DebuggerScript()
10 : m_startLine(0) 10 : m_startLine(0)
11 , m_startColumn(0) 11 , m_startColumn(0)
12 , m_endLine(0) 12 , m_endLine(0)
13 , m_endColumn(0) 13 , m_endColumn(0)
14 , m_executionContextId(0) 14 , m_executionContextId(0)
15 , m_isContentScript(false) 15 , m_isContentScript(false)
16 , m_isInternalScript(false) 16 , m_isInternalScript(false)
17 , m_isLiveEdit(false) 17 , m_isLiveEdit(false)
18 { 18 {
19 } 19 }
20 20
21 V8DebuggerScript::~V8DebuggerScript()
22 {
23 }
24
21 String16 V8DebuggerScript::sourceURL() const 25 String16 V8DebuggerScript::sourceURL() const
22 { 26 {
23 return m_sourceURL.isEmpty() ? m_url : m_sourceURL; 27 return m_sourceURL.isEmpty() ? m_url : m_sourceURL;
24 } 28 }
25 29
26 V8DebuggerScript& V8DebuggerScript::setURL(const String16& url) 30 v8::Local<v8::String> V8DebuggerScript::source(v8::Isolate* isolate) const
31 {
32 return m_source.Get(isolate);
33 }
34
35 V8DebuggerScript* V8DebuggerScript::setScriptId(const String16& id)
36 {
37 m_id = id;
38 return this;
39 }
40
41 V8DebuggerScript* V8DebuggerScript::setURL(const String16& url)
27 { 42 {
28 m_url = url; 43 m_url = url;
29 return *this; 44 return this;
30 } 45 }
31 46
32 V8DebuggerScript& V8DebuggerScript::setSourceURL(const String16& sourceURL) 47 V8DebuggerScript* V8DebuggerScript::setSourceURL(const String16& sourceURL)
33 { 48 {
34 m_sourceURL = sourceURL; 49 m_sourceURL = sourceURL;
35 return *this; 50 return this;
36 } 51 }
37 52
38 V8DebuggerScript& V8DebuggerScript::setSourceMappingURL(const String16& sourceMa ppingURL) 53 V8DebuggerScript* V8DebuggerScript::setSourceMappingURL(const String16& sourceMa ppingURL)
39 { 54 {
40 m_sourceMappingURL = sourceMappingURL; 55 m_sourceMappingURL = sourceMappingURL;
41 return *this; 56 return this;
42 } 57 }
43 58
44 V8DebuggerScript& V8DebuggerScript::setSource(const String16& source) 59 V8DebuggerScript* V8DebuggerScript::setSource(v8::Isolate* isolate, v8::Local<v8 ::String> source)
45 { 60 {
46 m_source = source; 61 m_source.Reset(isolate, source);
47 return *this; 62 return this;
48 } 63 }
49 64
50 V8DebuggerScript& V8DebuggerScript::setHash(const String16& hash) 65 V8DebuggerScript* V8DebuggerScript::setHash(const String16& hash)
51 { 66 {
52 m_hash = hash; 67 m_hash = hash;
53 return *this; 68 return this;
54 } 69 }
55 70
56 V8DebuggerScript& V8DebuggerScript::setStartLine(int startLine) 71 V8DebuggerScript* V8DebuggerScript::setStartLine(int startLine)
57 { 72 {
58 m_startLine = startLine; 73 m_startLine = startLine;
59 return *this; 74 return this;
60 } 75 }
61 76
62 V8DebuggerScript& V8DebuggerScript::setStartColumn(int startColumn) 77 V8DebuggerScript* V8DebuggerScript::setStartColumn(int startColumn)
63 { 78 {
64 m_startColumn = startColumn; 79 m_startColumn = startColumn;
65 return *this; 80 return this;
66 } 81 }
67 82
68 V8DebuggerScript& V8DebuggerScript::setEndLine(int endLine) 83 V8DebuggerScript* V8DebuggerScript::setEndLine(int endLine)
69 { 84 {
70 m_endLine = endLine; 85 m_endLine = endLine;
71 return *this; 86 return this;
72 } 87 }
73 88
74 V8DebuggerScript& V8DebuggerScript::setEndColumn(int endColumn) 89 V8DebuggerScript* V8DebuggerScript::setEndColumn(int endColumn)
75 { 90 {
76 m_endColumn = endColumn; 91 m_endColumn = endColumn;
77 return *this; 92 return this;
78 } 93 }
79 94
80 V8DebuggerScript& V8DebuggerScript::setExecutionContextId(int executionContextId ) 95 V8DebuggerScript* V8DebuggerScript::setExecutionContextId(int executionContextId )
81 { 96 {
82 m_executionContextId = executionContextId; 97 m_executionContextId = executionContextId;
83 return *this; 98 return this;
84 } 99 }
85 100
86 V8DebuggerScript& V8DebuggerScript::setIsContentScript(bool isContentScript) 101 V8DebuggerScript* V8DebuggerScript::setIsContentScript(bool isContentScript)
87 { 102 {
88 m_isContentScript = isContentScript; 103 m_isContentScript = isContentScript;
89 return *this; 104 return this;
90 } 105 }
91 106
92 V8DebuggerScript& V8DebuggerScript::setIsInternalScript(bool isInternalScript) 107 V8DebuggerScript* V8DebuggerScript::setIsInternalScript(bool isInternalScript)
93 { 108 {
94 m_isInternalScript = isInternalScript; 109 m_isInternalScript = isInternalScript;
95 return *this; 110 return this;
96 } 111 }
97 112
98 V8DebuggerScript& V8DebuggerScript::setIsLiveEdit(bool isLiveEdit) 113 V8DebuggerScript* V8DebuggerScript::setIsLiveEdit(bool isLiveEdit)
99 { 114 {
100 m_isLiveEdit = isLiveEdit; 115 m_isLiveEdit = isLiveEdit;
101 return *this; 116 return this;
102 } 117 }
103 118
104 } // namespace blink 119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698