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

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

Issue 2150993004: [DevTools] Remove V8Debugger::consoleMessagesCount. (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 /* 1 /*
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 void V8DebuggerImpl::promiseRejectionRevoked(v8::Local<v8::Context> context, uns igned promiseRejectionId) 1095 void V8DebuggerImpl::promiseRejectionRevoked(v8::Local<v8::Context> context, uns igned promiseRejectionId)
1096 { 1096 {
1097 int contextGroupId = getGroupId(context); 1097 int contextGroupId = getGroupId(context);
1098 if (!contextGroupId) 1098 if (!contextGroupId)
1099 return; 1099 return;
1100 1100
1101 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), "Handler added to rejected promise ", promiseRejectionId); 1101 std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createF orRevokedException(m_client->currentTimeMS(), "Handler added to rejected promise ", promiseRejectionId);
1102 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage)); 1102 ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMes sage));
1103 } 1103 }
1104 1104
1105 void V8DebuggerImpl::consoleMessagesCount(int contextGroupId, unsigned* total, u nsigned* withArguments)
1106 {
1107 *total = 0;
1108 *withArguments = 0;
1109 ConsoleStorageMap::iterator storageIt = m_consoleStorageMap.find(contextGrou pId);
1110 if (storageIt == m_consoleStorageMap.end())
1111 return;
1112 *total = storageIt->second->messages().size();
1113 for (const auto& message : storageIt->second->messages()) {
1114 if (message->argumentCount())
1115 (*withArguments)++;
1116 }
1117 }
1118
1119 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack) 1105 std::unique_ptr<V8StackTrace> V8DebuggerImpl::captureStackTrace(bool fullStack)
1120 { 1106 {
1121 if (!m_isolate->InContext()) 1107 if (!m_isolate->InContext())
1122 return nullptr; 1108 return nullptr;
1123 1109
1124 v8::HandleScope handles(m_isolate); 1110 v8::HandleScope handles(m_isolate);
1125 int contextGroupId = getGroupId(m_isolate->GetCurrentContext()); 1111 int contextGroupId = getGroupId(m_isolate->GetCurrentContext());
1126 if (!contextGroupId) 1112 if (!contextGroupId)
1127 return nullptr; 1113 return nullptr;
1128 1114
(...skipping 29 matching lines...) Expand all
1158 1144
1159 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d) 1145 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI d)
1160 { 1146 {
1161 if (!contextGroupId) 1147 if (!contextGroupId)
1162 return nullptr; 1148 return nullptr;
1163 SessionMap::iterator iter = m_sessions.find(contextGroupId); 1149 SessionMap::iterator iter = m_sessions.find(contextGroupId);
1164 return iter == m_sessions.end() ? nullptr : iter->second; 1150 return iter == m_sessions.end() ? nullptr : iter->second;
1165 } 1151 }
1166 1152
1167 } // namespace blink 1153 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698