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

Side by Side Diff: sky/engine/public/platform/Platform.h

Issue 889823002: Remove TRACE_EVENT indirection through blink::Platform (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/public/BUILD.gn ('k') | sky/engine/public/platform/WebConvertableToTraceFormat.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 namespace mojo { 49 namespace mojo {
50 class NetworkService; 50 class NetworkService;
51 } 51 }
52 52
53 namespace blink { 53 namespace blink {
54 54
55 class WebBlobRegistry; 55 class WebBlobRegistry;
56 class WebClipboard; 56 class WebClipboard;
57 class WebConvertableToTraceFormat;
58 class WebDiscardableMemory; 57 class WebDiscardableMemory;
59 class WebFallbackThemeEngine; 58 class WebFallbackThemeEngine;
60 class WebGraphicsContext3DProvider; 59 class WebGraphicsContext3DProvider;
61 class WebSandboxSupport; 60 class WebSandboxSupport;
62 struct WebFloatPoint; 61 struct WebFloatPoint;
63 class WebURL; 62 class WebURL;
64 class WebURLLoader; 63 class WebURLLoader;
65 class WebUnitTestSupport; 64 class WebUnitTestSupport;
66 struct WebLocalizedString; 65 struct WebLocalizedString;
67 struct WebSize; 66 struct WebSize;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 217
219 218
220 // Testing ------------------------------------------------------------- 219 // Testing -------------------------------------------------------------
221 220
222 // Get a pointer to testing support interfaces. Will not be available in pro duction builds. 221 // Get a pointer to testing support interfaces. Will not be available in pro duction builds.
223 virtual WebUnitTestSupport* unitTestSupport() { return 0; } 222 virtual WebUnitTestSupport* unitTestSupport() { return 0; }
224 223
225 224
226 // Tracing ------------------------------------------------------------- 225 // Tracing -------------------------------------------------------------
227 226
228 // Get a pointer to the enabled state of the given trace category. The
229 // embedder can dynamically change the enabled state as trace event
230 // recording is started and stopped by the application. Only long-lived
231 // literal strings should be given as the category name. The implementation
232 // expects the returned pointer to be held permanently in a local static. If
233 // the unsigned char is non-zero, tracing is enabled. If tracing is enabled,
234 // addTraceEvent is expected to be called by the trace event macros.
235 virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categor yName) { return 0; }
236
237 typedef uint64_t TraceEventHandle;
238
239 // Add a trace event to the platform tracing system. Depending on the actual
240 // enabled state, this event may be recorded or dropped.
241 // - phase specifies the type of event:
242 // - BEGIN ('B'): Marks the beginning of a scoped event.
243 // - END ('E'): Marks the end of a scoped event.
244 // - COMPLETE ('X'): Marks the beginning of a scoped event, but doesn't
245 // need a matching END event. Instead, at the end of the scope,
246 // updateTraceEventDuration() must be called with the TraceEventHandle
247 // returned from addTraceEvent().
248 // - INSTANT ('I'): Standalone, instantaneous event.
249 // - START ('S'): Marks the beginning of an asynchronous event (the end
250 // event can occur in a different scope or thread). The id parameter is
251 // used to match START/FINISH pairs.
252 // - FINISH ('F'): Marks the end of an asynchronous event.
253 // - COUNTER ('C'): Used to trace integer quantities that change over
254 // time. The argument values are expected to be of type int.
255 // - METADATA ('M'): Reserved for internal use.
256 // - categoryEnabled is the pointer returned by getTraceCategoryEnabledFlag.
257 // - name is the name of the event. Also used to match BEGIN/END and
258 // START/FINISH pairs.
259 // - id optionally allows events of the same name to be distinguished from
260 // each other. For example, to trace the consutruction and destruction of
261 // objects, specify the pointer as the id parameter.
262 // - numArgs specifies the number of elements in argNames, argTypes, and
263 // argValues.
264 // - argNames is the array of argument names. Use long-lived literal strings
265 // or specify the COPY flag.
266 // - argTypes is the array of argument types:
267 // - BOOL (1): bool
268 // - UINT (2): unsigned long long
269 // - INT (3): long long
270 // - DOUBLE (4): double
271 // - POINTER (5): void*
272 // - STRING (6): char* (long-lived null-terminated char* string)
273 // - COPY_STRING (7): char* (temporary null-terminated char* string)
274 // - CONVERTABLE (8): WebConvertableToTraceFormat
275 // - argValues is the array of argument values. Each value is the unsigned
276 // long long member of a union of all supported types.
277 // - convertableValues is the array of WebConvertableToTraceFormat classes
278 // that may be converted to trace format by calling asTraceFormat method.
279 // ConvertableToTraceFormat interface.
280 // - thresholdBeginId optionally specifies the value returned by a previous
281 // call to addTraceEvent with a BEGIN phase.
282 // - threshold is used on an END phase event in conjunction with the
283 // thresholdBeginId of a prior BEGIN event. The threshold is the minimum
284 // number of microseconds that must have passed since the BEGIN event. If
285 // less than threshold microseconds has passed, the BEGIN/END pair is
286 // dropped.
287 // - flags can be 0 or one or more of the following, ORed together:
288 // - COPY (0x1): treat all strings (name, argNames and argValues of type
289 // string) as temporary so that they will be copied by addTraceEvent.
290 // - HAS_ID (0x2): use the id argument to uniquely identify the event for
291 // matching with other events of the same name.
292 // - MANGLE_ID (0x4): specify this flag if the id parameter is the value
293 // of a pointer.
294 virtual TraceEventHandle addTraceEvent(
295 char phase,
296 const unsigned char* categoryEnabledFlag,
297 const char* name,
298 unsigned long long id,
299 int numArgs,
300 const char** argNames,
301 const unsigned char* argTypes,
302 const unsigned long long* argValues,
303 const WebConvertableToTraceFormat* convertableValues,
304 unsigned char flags)
305 {
306 return 0;
307 }
308
309 // Set the duration field of a COMPLETE trace event.
310 virtual void updateTraceEventDuration(const unsigned char* categoryEnabledFl ag, const char* name, TraceEventHandle) { }
311
312 // Callbacks for reporting histogram data. 227 // Callbacks for reporting histogram data.
313 // CustomCounts histogram has exponential bucket sizes, so that min=1, max=1 000000, bucketCount=50 would do. 228 // CustomCounts histogram has exponential bucket sizes, so that min=1, max=1 000000, bucketCount=50 would do.
314 virtual void histogramCustomCounts(const char* name, int sample, int min, in t max, int bucketCount) { } 229 virtual void histogramCustomCounts(const char* name, int sample, int min, in t max, int bucketCount) { }
315 // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value. 230 // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value.
316 virtual void histogramEnumeration(const char* name, int sample, int boundary Value) { } 231 virtual void histogramEnumeration(const char* name, int sample, int boundary Value) { }
317 // Unlike enumeration histograms, sparse histograms only allocate memory for non-empty buckets. 232 // Unlike enumeration histograms, sparse histograms only allocate memory for non-empty buckets.
318 virtual void histogramSparse(const char* name, int sample) { } 233 virtual void histogramSparse(const char* name, int sample) { }
319 234
320 235
321 // GPU ---------------------------------------------------------------- 236 // GPU ----------------------------------------------------------------
(...skipping 15 matching lines...) Expand all
337 // This value must be checked again after a context loss event as the platfo rm's capabilities may have changed. 252 // This value must be checked again after a context loss event as the platfo rm's capabilities may have changed.
338 virtual bool canAccelerate2dCanvas() { return false; } 253 virtual bool canAccelerate2dCanvas() { return false; }
339 254
340 protected: 255 protected:
341 virtual ~Platform() { } 256 virtual ~Platform() { }
342 }; 257 };
343 258
344 } // namespace blink 259 } // namespace blink
345 260
346 #endif // SKY_ENGINE_PUBLIC_PLATFORM_PLATFORM_H_ 261 #endif // SKY_ENGINE_PUBLIC_PLATFORM_PLATFORM_H_
OLDNEW
« no previous file with comments | « sky/engine/public/BUILD.gn ('k') | sky/engine/public/platform/WebConvertableToTraceFormat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698