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

Side by Side Diff: third_party/WebKit/Source/platform/heap/GCTaskRunner.h

Issue 2619493003: Replace ASSERTs in platform/heap/ with DCHECKs
Patch Set: temp 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 class GCTaskObserver final : public WebThread::TaskObserver { 68 class GCTaskObserver final : public WebThread::TaskObserver {
69 USING_FAST_MALLOC(GCTaskObserver); 69 USING_FAST_MALLOC(GCTaskObserver);
70 70
71 public: 71 public:
72 GCTaskObserver() : m_nesting(0) {} 72 GCTaskObserver() : m_nesting(0) {}
73 73
74 ~GCTaskObserver() { 74 ~GCTaskObserver() {
75 // m_nesting can be 1 if this was unregistered in a task and 75 // m_nesting can be 1 if this was unregistered in a task and
76 // didProcessTask was not called. 76 // didProcessTask was not called.
77 ASSERT(!m_nesting || m_nesting == 1); 77 DCHECK(!m_nesting || m_nesting == 1);
78 } 78 }
79 79
80 virtual void willProcessTask() { m_nesting++; } 80 virtual void willProcessTask() { m_nesting++; }
81 81
82 virtual void didProcessTask() { 82 virtual void didProcessTask() {
83 // In the production code WebKit::initialize is called from inside the 83 // In the production code WebKit::initialize is called from inside the
84 // message loop so we can get didProcessTask() without corresponding 84 // message loop so we can get didProcessTask() without corresponding
85 // willProcessTask once. This is benign. 85 // willProcessTask once. This is benign.
86 if (m_nesting) 86 if (m_nesting)
87 m_nesting--; 87 m_nesting--;
(...skipping 22 matching lines...) Expand all
110 ~GCTaskRunner() { m_thread->removeTaskObserver(m_gcTaskObserver.get()); } 110 ~GCTaskRunner() { m_thread->removeTaskObserver(m_gcTaskObserver.get()); }
111 111
112 private: 112 private:
113 std::unique_ptr<GCTaskObserver> m_gcTaskObserver; 113 std::unique_ptr<GCTaskObserver> m_gcTaskObserver;
114 WebThread* m_thread; 114 WebThread* m_thread;
115 }; 115 };
116 116
117 } // namespace blink 117 } // namespace blink
118 118
119 #endif 119 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698