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

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

Issue 2382913002: [DevTools] fixed console.count with empty stack (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/V8Console.h" 5 #include "platform/v8_inspector/V8Console.h"
6 6
7 #include "platform/v8_inspector/InjectedScript.h" 7 #include "platform/v8_inspector/InjectedScript.h"
8 #include "platform/v8_inspector/InspectedContext.h" 8 #include "platform/v8_inspector/InspectedContext.h"
9 #include "platform/v8_inspector/V8Compat.h" 9 #include "platform/v8_inspector/V8Compat.h"
10 #include "platform/v8_inspector/V8ConsoleMessage.h" 10 #include "platform/v8_inspector/V8ConsoleMessage.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 351
352 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 352 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
353 { 353 {
354 ConsoleHelper helper(info); 354 ConsoleHelper helper(info);
355 355
356 String16 title = helper.firstArgToString(String16()); 356 String16 title = helper.firstArgToString(String16());
357 String16 identifier; 357 String16 identifier;
358 if (title.isEmpty()) { 358 if (title.isEmpty()) {
359 std::unique_ptr<V8StackTraceImpl> stackTrace = V8StackTraceImpl::capture (nullptr, 0, 1); 359 std::unique_ptr<V8StackTraceImpl> stackTrace = V8StackTraceImpl::capture (nullptr, 0, 1);
360 if (stackTrace) 360 if (stackTrace && !stackTrace->isEmpty())
361 identifier = stackTrace->topSourceURL() + ":" + String16::fromIntege r(stackTrace->topLineNumber()); 361 identifier = stackTrace->topSourceURL() + ":" + String16::fromIntege r(stackTrace->topLineNumber());
362 } else { 362 } else {
363 identifier = title + "@"; 363 identifier = title + "@";
364 } 364 }
365 365
366 v8::Local<v8::Map> countMap; 366 v8::Local<v8::Map> countMap;
367 if (!helper.privateMap("V8Console#countMap").ToLocal(&countMap)) 367 if (!helper.privateMap("V8Console#countMap").ToLocal(&countMap))
368 return; 368 return;
369 int64_t count = helper.getIntFromMap(countMap, identifier, 0) + 1; 369 int64_t count = helper.getIntFromMap(countMap, identifier, 0) + 1;
370 helper.setIntOnMap(countMap, identifier, count); 370 helper.setIntOnMap(countMap, identifier, count);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 continue; 821 continue;
822 if (name->IsString()) { 822 if (name->IsString()) {
823 v8::Local<v8::Value> descriptor; 823 v8::Local<v8::Value> descriptor;
824 bool success = m_global->GetOwnPropertyDescriptor(m_context, v8::Loc al<v8::String>::Cast(name)).ToLocal(&descriptor); 824 bool success = m_global->GetOwnPropertyDescriptor(m_context, v8::Loc al<v8::String>::Cast(name)).ToLocal(&descriptor);
825 DCHECK(success); 825 DCHECK(success);
826 } 826 }
827 } 827 }
828 } 828 }
829 829
830 } // namespace v8_inspector 830 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698