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

Side by Side Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 2034203002: [DevTools] Improve MainThreadDebugger::memoryInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a test Created 4 years, 6 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 /* 1 /*
2 * Copyright (c) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return; 222 return;
223 LocalDOMWindow* localDomWindow = toLocalDOMWindow(window); 223 LocalDOMWindow* localDomWindow = toLocalDOMWindow(window);
224 if (!localDomWindow) 224 if (!localDomWindow)
225 return; 225 return;
226 LocalFrame* frame = localDomWindow->frame(); 226 LocalFrame* frame = localDomWindow->frame();
227 if (!frame) 227 if (!frame)
228 return; 228 return;
229 frame->console().addMessage(consoleMessage); 229 frame->console().addMessage(consoleMessage);
230 } 230 }
231 231
232 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v 8::Local<v8::Context> context, v8::Local<v8::Object> creationContext) 232 v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v 8::Local<v8::Context> context)
233 { 233 {
234 ExecutionContext* executionContext = toExecutionContext(context); 234 ExecutionContext* executionContext = toExecutionContext(context);
235 ASSERT_UNUSED(executionContext, executionContext); 235 ASSERT_UNUSED(executionContext, executionContext);
236 ASSERT(executionContext->isDocument()); 236 ASSERT(executionContext->isDocument());
237 return toV8(MemoryInfo::create(), creationContext, isolate); 237 return toV8(MemoryInfo::create(), context->Global(), isolate);
238 } 238 }
239 239
240 bool MainThreadDebugger::isCommandLineAPIMethod(const String& name) 240 bool MainThreadDebugger::isCommandLineAPIMethod(const String& name)
241 { 241 {
242 DEFINE_STATIC_LOCAL(HashSet<String>, methods, ()); 242 DEFINE_STATIC_LOCAL(HashSet<String>, methods, ());
243 if (methods.size() == 0) { 243 if (methods.size() == 0) {
244 const char* members[] = { "$", "$$", "$x" }; 244 const char* members[] = { "$", "$$", "$x" };
245 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i) 245 for (size_t i = 0; i < WTF_ARRAY_LENGTH(members); ++i)
246 methods.add(members[i]); 246 methods.add(members[i]);
247 } 247 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 return; 345 return;
346 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) 346 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false))
347 return; 347 return;
348 } 348 }
349 info.GetReturnValue().Set(nodes); 349 info.GetReturnValue().Set(nodes);
350 } 350 }
351 exceptionState.throwIfNeeded(); 351 exceptionState.throwIfNeeded();
352 } 352 }
353 353
354 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698