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

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

Issue 2633803002: [inspector] implemented blackboxing inside v8 (Closed)
Patch Set: addressed comments 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
« no previous file with comments | « src/inspector/v8-debugger-script.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 resetBlackboxedStateCache() override {
152 v8::HandleScope scope(m_isolate);
153 v8::debug::ResetBlackboxedStateCache(m_isolate, m_script.Get(m_isolate));
154 }
155
151 private: 156 private:
152 String16 GetNameOrSourceUrl(v8::Local<v8::debug::Script> script) { 157 String16 GetNameOrSourceUrl(v8::Local<v8::debug::Script> script) {
153 v8::Local<v8::String> name; 158 v8::Local<v8::String> name;
154 if (script->Name().ToLocal(&name) || script->SourceURL().ToLocal(&name)) 159 if (script->Name().ToLocal(&name) || script->SourceURL().ToLocal(&name))
155 return toProtocolString(name); 160 return toProtocolString(name);
156 return String16(); 161 return String16();
157 } 162 }
158 163
159 String16 m_sourceMappingURL; 164 String16 m_sourceMappingURL;
160 v8::Global<v8::String> m_sourceObj; 165 v8::Global<v8::String> m_sourceObj;
(...skipping 29 matching lines...) Expand all
190 195
191 bool getPossibleBreakpoints( 196 bool getPossibleBreakpoints(
192 const v8::debug::Location& start, const v8::debug::Location& end, 197 const v8::debug::Location& start, const v8::debug::Location& end,
193 std::vector<v8::debug::Location>* locations) override { 198 std::vector<v8::debug::Location>* locations) override {
194 // TODO(clemensh): Returning false produces the protocol error "Internal 199 // TODO(clemensh): Returning false produces the protocol error "Internal
195 // error". Implement and fix expected output of 200 // error". Implement and fix expected output of
196 // wasm-get-breakable-locations.js. 201 // wasm-get-breakable-locations.js.
197 return false; 202 return false;
198 } 203 }
199 204
205 void resetBlackboxedStateCache() override {}
206
200 private: 207 private:
201 static const String16& emptyString() { 208 static const String16& emptyString() {
202 static const String16 singleEmptyString; 209 static const String16 singleEmptyString;
203 return singleEmptyString; 210 return singleEmptyString;
204 } 211 }
205 212
206 v8::Global<v8::debug::WasmScript> m_script; 213 v8::Global<v8::debug::WasmScript> m_script;
207 }; 214 };
208 215
209 } // namespace 216 } // namespace
(...skipping 27 matching lines...) Expand all
237 if (m_hash.isEmpty()) m_hash = calculateHash(source(isolate)); 244 if (m_hash.isEmpty()) m_hash = calculateHash(source(isolate));
238 DCHECK(!m_hash.isEmpty()); 245 DCHECK(!m_hash.isEmpty());
239 return m_hash; 246 return m_hash;
240 } 247 }
241 248
242 void V8DebuggerScript::setSourceURL(const String16& sourceURL) { 249 void V8DebuggerScript::setSourceURL(const String16& sourceURL) {
243 m_sourceURL = sourceURL; 250 m_sourceURL = sourceURL;
244 } 251 }
245 252
246 } // namespace v8_inspector 253 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/v8-debugger-script.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698