Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebTraceLocation_h | 5 #ifndef WebTraceLocation_h |
| 6 #define WebTraceLocation_h | 6 #define WebTraceLocation_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // This class is used to keep track of where posted tasks originate. See base/lo cation.h in Chromium. | 12 // This class is used to keep track of where posted tasks originate. See base/lo cation.h in Chromium. |
| 13 // Currently only store the bits used in Blink, base::Location stores more. | 13 // Currently only store the bits used in Blink, base::Location stores more. |
| 14 class BLINK_PLATFORM_EXPORT WebTraceLocation { | 14 class BLINK_PLATFORM_EXPORT WebTraceLocation { |
| 15 public: | 15 public: |
| 16 // These char*s are not copied and must live for the duration of the program . | 16 // These char*s are not copied and must live for the duration of the program . |
| 17 WebTraceLocation(const char* function, const char* file); | 17 WebTraceLocation(const char* function, const char* file, int lineNumber, con st void* programCounter); |
| 18 WebTraceLocation(); | 18 WebTraceLocation(); |
| 19 static const void* getProgramCounter(); | |
| 19 | 20 |
| 20 const char* functionName() const; | 21 const char* functionName() const; |
| 21 const char* fileName() const; | 22 const char* fileName() const; |
| 23 int lineNumber() const; | |
| 24 const void* programCounter() const; | |
| 22 | 25 |
| 23 private: | 26 private: |
| 24 const char* m_functionName; | 27 const char* m_functionName; |
| 25 const char* m_fileName; | 28 const char* m_fileName; |
| 29 int m_lineNumber; | |
| 30 const void* m_programCounter; | |
| 26 }; | 31 }; |
| 27 | 32 |
| 28 #define BLINK_FROM_HERE ::blink::WebTraceLocation(__FUNCTION__, __FILE__) | 33 #define BLINK_FROM_HERE ::blink::WebTraceLocation(__FUNCTION__, __FILE__, __LINE __, ::blink::WebTraceLocation::getProgramCounter()) |
|
kinuko
2016/07/14 05:51:14
Can't we just call tracked_objects::GetProgramCoun
tzik
2016/07/14 07:51:06
I think I don't understand our latest layering pol
alex clarke (OOO till 29th)
2016/07/14 10:20:48
IMO It seems like it would be a good idea to try a
| |
| 29 | 34 |
| 30 } | 35 } |
| 31 | 36 |
| 32 #endif // WebTraceLocation_h | 37 #endif // WebTraceLocation_h |
| OLD | NEW |