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

Side by Side Diff: Source/platform/PlatformInstrumentation.h

Issue 342513003: Don't allow direct const char* trace value (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 private: 82 private:
83 static const char CategoryName[]; 83 static const char CategoryName[];
84 84
85 static PlatformInstrumentationClient* m_client; 85 static PlatformInstrumentationClient* m_client;
86 }; 86 };
87 87
88 #define FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD() if (!m_client || !isMainTh read()) return; 88 #define FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD() if (!m_client || !isMainTh read()) return;
89 89
90 inline void PlatformInstrumentation::willDecodeImage(const String& imageType) 90 inline void PlatformInstrumentation::willDecodeImage(const String& imageType)
91 { 91 {
92 TRACE_EVENT_BEGIN1(CategoryName, ImageDecodeEvent, ImageTypeArgument, TRACE_ STR_COPY(imageType.ascii().data())); 92 TRACE_EVENT_BEGIN1(CategoryName, ImageDecodeEvent, ImageTypeArgument, imageT ype.ascii());
93 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD(); 93 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD();
94 m_client->willDecodeImage(imageType); 94 m_client->willDecodeImage(imageType);
95 } 95 }
96 96
97 inline void PlatformInstrumentation::didDecodeImage() 97 inline void PlatformInstrumentation::didDecodeImage()
98 { 98 {
99 TRACE_EVENT_END0(CategoryName, ImageDecodeEvent); 99 TRACE_EVENT_END0(CategoryName, ImageDecodeEvent);
100 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD(); 100 FAST_RETURN_IF_NO_CLIENT_OR_NOT_MAIN_THREAD();
101 m_client->didDecodeImage(); 101 m_client->didDecodeImage();
102 } 102 }
(...skipping 23 matching lines...) Expand all
126 } 126 }
127 127
128 inline void PlatformInstrumentation::didDecodeLazyPixelRef() 128 inline void PlatformInstrumentation::didDecodeLazyPixelRef()
129 { 129 {
130 TRACE_EVENT_END0(CategoryName, DecodeLazyPixelRefEvent); 130 TRACE_EVENT_END0(CategoryName, DecodeLazyPixelRefEvent);
131 } 131 }
132 132
133 } // namespace WebCore 133 } // namespace WebCore
134 134
135 #endif // PlatformInstrumentation_h 135 #endif // PlatformInstrumentation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698