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

Side by Side Diff: src/inspector/v8-debugger-script.cc

Issue 2633803002: [inspector] implemented blackboxing inside v8 (Closed)
Patch Set: one more test Created 3 years, 11 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 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/inspected-context.h" 7 #include "src/inspector/inspected-context.h"
8 #include "src/inspector/string-util.h" 8 #include "src/inspector/string-util.h"
9 9
10 namespace v8_inspector { 10 namespace v8_inspector {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 bool getPossibleBreakpoints( 143 bool getPossibleBreakpoints(
144 const v8::debug::Location& start, const v8::debug::Location& end, 144 const v8::debug::Location& start, const v8::debug::Location& end,
145 std::vector<v8::debug::Location>* locations) override { 145 std::vector<v8::debug::Location>* locations) override {
146 v8::HandleScope scope(m_isolate); 146 v8::HandleScope scope(m_isolate);
147 v8::Local<v8::debug::Script> script = m_script.Get(m_isolate); 147 v8::Local<v8::debug::Script> script = m_script.Get(m_isolate);
148 return script->GetPossibleBreakpoints(start, end, locations); 148 return script->GetPossibleBreakpoints(start, end, locations);
149 } 149 }
150 150
151 void blackboxStateChanged() override {
152 v8::HandleScope scope(m_isolate);
153 v8::Local<v8::debug::Script> script = m_script.Get(m_isolate);
154 script->BlackboxStateChanged();
155 }
156
151 private: 157 private:
152 String16 GetNameOrSourceUrl(v8::Local<v8::debug::Script> script) { 158 String16 GetNameOrSourceUrl(v8::Local<v8::debug::Script> script) {
153 v8::Local<v8::String> name; 159 v8::Local<v8::String> name;
154 if (script->Name().ToLocal(&name) || script->SourceURL().ToLocal(&name)) 160 if (script->Name().ToLocal(&name) || script->SourceURL().ToLocal(&name))
155 return toProtocolString(name); 161 return toProtocolString(name);
156 return String16(); 162 return String16();
157 } 163 }
158 164
159 String16 m_sourceMappingURL; 165 String16 m_sourceMappingURL;
160 v8::Global<v8::String> m_sourceObj; 166 v8::Global<v8::String> m_sourceObj;
(...skipping 29 matching lines...) Expand all
190 196
191 bool getPossibleBreakpoints( 197 bool getPossibleBreakpoints(
192 const v8::debug::Location& start, const v8::debug::Location& end, 198 const v8::debug::Location& start, const v8::debug::Location& end,
193 std::vector<v8::debug::Location>* locations) override { 199 std::vector<v8::debug::Location>* locations) override {
194 // TODO(clemensh): Returning false produces the protocol error "Internal 200 // TODO(clemensh): Returning false produces the protocol error "Internal
195 // error". Implement and fix expected output of 201 // error". Implement and fix expected output of
196 // wasm-get-breakable-locations.js. 202 // wasm-get-breakable-locations.js.
197 return false; 203 return false;
198 } 204 }
199 205
206 void blackboxStateChanged() override {}
207
200 private: 208 private:
201 static const String16& emptyString() { 209 static const String16& emptyString() {
202 static const String16 singleEmptyString; 210 static const String16 singleEmptyString;
203 return singleEmptyString; 211 return singleEmptyString;
204 } 212 }
205 213
206 v8::Global<v8::debug::WasmScript> m_script; 214 v8::Global<v8::debug::WasmScript> m_script;
207 }; 215 };
208 216
209 } // namespace 217 } // namespace
(...skipping 27 matching lines...) Expand all
237 if (m_hash.isEmpty()) m_hash = calculateHash(source(isolate)); 245 if (m_hash.isEmpty()) m_hash = calculateHash(source(isolate));
238 DCHECK(!m_hash.isEmpty()); 246 DCHECK(!m_hash.isEmpty());
239 return m_hash; 247 return m_hash;
240 } 248 }
241 249
242 void V8DebuggerScript::setSourceURL(const String16& sourceURL) { 250 void V8DebuggerScript::setSourceURL(const String16& sourceURL) {
243 m_sourceURL = sourceURL; 251 m_sourceURL = sourceURL;
244 } 252 }
245 253
246 } // namespace v8_inspector 254 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698