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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ProfilingCanvas.cpp

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: fix typo Created 3 years, 8 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 26 matching lines...) Expand all
37 CanvasInterceptor<ProfilingCanvas>::CanvasInterceptor( 37 CanvasInterceptor<ProfilingCanvas>::CanvasInterceptor(
38 InterceptingCanvasBase* canvas) 38 InterceptingCanvasBase* canvas)
39 : CanvasInterceptorBase(canvas), 39 : CanvasInterceptorBase(canvas),
40 start_time_(WTF::MonotonicallyIncreasingTime()) {} 40 start_time_(WTF::MonotonicallyIncreasingTime()) {}
41 41
42 CanvasInterceptor<ProfilingCanvas>::~CanvasInterceptor() { 42 CanvasInterceptor<ProfilingCanvas>::~CanvasInterceptor() {
43 if (!TopLevelCall()) 43 if (!TopLevelCall())
44 return; 44 return;
45 double delta = WTF::MonotonicallyIncreasingTime() - start_time_; 45 double delta = WTF::MonotonicallyIncreasingTime() - start_time_;
46 if (auto timings = Canvas()->timings_) { 46 if (auto timings = Canvas()->timings_) {
47 ASSERT(timings->size() == Canvas()->CallCount()); 47 DCHECK_EQ(timings->size(), Canvas()->CallCount());
48 timings->push_back(delta); 48 timings->push_back(delta);
49 } 49 }
50 } 50 }
51 51
52 ProfilingCanvas::ProfilingCanvas(SkBitmap bitmap) 52 ProfilingCanvas::ProfilingCanvas(SkBitmap bitmap)
53 : InterceptingCanvas(bitmap), timings_(nullptr) {} 53 : InterceptingCanvas(bitmap), timings_(nullptr) {}
54 54
55 void ProfilingCanvas::SetTimings(Vector<double>* timings) { 55 void ProfilingCanvas::SetTimings(Vector<double>* timings) {
56 timings_ = timings; 56 timings_ = timings;
57 } 57 }
58 58
59 } // namespace blink 59 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698