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

Side by Side Diff: Source/core/inspector/InspectorTimelineAgent.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/parser/HTMLTreeBuilder.cpp ('k') | Source/core/page/Page.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 String type; 156 String type;
157 bool skipWhenUnbalanced; 157 bool skipWhenUnbalanced;
158 }; 158 };
159 159
160 class TimelineRecordStack { 160 class TimelineRecordStack {
161 private: 161 private:
162 struct Entry { 162 struct Entry {
163 Entry(PassRefPtr<TimelineEvent> record, const String& type) 163 Entry(PassRefPtr<TimelineEvent> record, const String& type)
164 : record(record) 164 : record(record)
165 , children(TypeBuilder::Array<TimelineEvent>::create()) 165 , children(TypeBuilder::Array<TimelineEvent>::create())
166 #ifndef NDEBUG 166 #if ENABLE(ASSERT)
167 , type(type) 167 , type(type)
168 #endif 168 #endif
169 { 169 {
170 } 170 }
171 171
172 RefPtr<TimelineEvent> record; 172 RefPtr<TimelineEvent> record;
173 RefPtr<TypeBuilder::Array<TimelineEvent> > children; 173 RefPtr<TypeBuilder::Array<TimelineEvent> > children;
174 #ifndef NDEBUG 174 #if ENABLE(ASSERT)
175 String type; 175 String type;
176 #endif 176 #endif
177 }; 177 };
178 178
179 public: 179 public:
180 TimelineRecordStack() : m_timelineAgent(0) { } 180 TimelineRecordStack() : m_timelineAgent(0) { }
181 TimelineRecordStack(InspectorTimelineAgent*); 181 TimelineRecordStack(InspectorTimelineAgent*);
182 182
183 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); 183 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type);
184 void closeScopedRecord(double endTime); 184 void closeScopedRecord(double endTime);
185 void addInstantRecord(PassRefPtr<TimelineEvent> record); 185 void addInstantRecord(PassRefPtr<TimelineEvent> record);
186 186
187 #ifndef NDEBUG 187 #if ENABLE(ASSERT)
188 bool isOpenRecordOfType(const String& type); 188 bool isOpenRecordOfType(const String& type);
189 #endif 189 #endif
190 190
191 private: 191 private:
192 void send(PassRefPtr<JSONObject>); 192 void send(PassRefPtr<JSONObject>);
193 193
194 InspectorTimelineAgent* m_timelineAgent; 194 InspectorTimelineAgent* m_timelineAgent;
195 Vector<Entry> m_stack; 195 Vector<Entry> m_stack;
196 }; 196 };
197 197
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 } 1297 }
1298 1298
1299 void TimelineRecordStack::addInstantRecord(PassRefPtr<TimelineEvent> record) 1299 void TimelineRecordStack::addInstantRecord(PassRefPtr<TimelineEvent> record)
1300 { 1300 {
1301 if (m_stack.isEmpty()) 1301 if (m_stack.isEmpty())
1302 m_timelineAgent->sendEvent(record); 1302 m_timelineAgent->sendEvent(record);
1303 else 1303 else
1304 m_stack.last().children->addItem(record); 1304 m_stack.last().children->addItem(record);
1305 } 1305 }
1306 1306
1307 #ifndef NDEBUG 1307 #if ENABLE(ASSERT)
1308 bool TimelineRecordStack::isOpenRecordOfType(const String& type) 1308 bool TimelineRecordStack::isOpenRecordOfType(const String& type)
1309 { 1309 {
1310 return !m_stack.isEmpty() && m_stack.last().type == type; 1310 return !m_stack.isEmpty() && m_stack.last().type == type;
1311 } 1311 }
1312 #endif 1312 #endif
1313 1313
1314 } // namespace WebCore 1314 } // namespace WebCore
1315 1315
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLTreeBuilder.cpp ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698