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 #include "base/location.h" |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 // This class is used to keep track of where posted tasks originate. See base/lo
cation.h in Chromium. | 13 // 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. | 14 // Currently only store the bits used in Blink, base::Location stores more. |
14 class BLINK_PLATFORM_EXPORT WebTraceLocation { | 15 class BLINK_PLATFORM_EXPORT WebTraceLocation { |
15 public: | 16 public: |
16 // These char*s are not copied and must live for the duration of the program
. | 17 // These char*s are not copied and must live for the duration of the program
. |
17 WebTraceLocation(const char* function, const char* file); | 18 WebTraceLocation(const char* function, const char* file); |
18 WebTraceLocation(); | 19 WebTraceLocation(); |
19 | 20 |
20 const char* functionName() const; | 21 const char* functionName() const; |
21 const char* fileName() const; | 22 const char* fileName() const; |
22 | 23 |
23 private: | 24 private: |
24 const char* m_functionName; | 25 const char* m_functionName; |
25 const char* m_fileName; | 26 const char* m_fileName; |
26 }; | 27 }; |
27 | 28 |
28 #if INSIDE_BLINK | 29 #if INSIDE_BLINK |
| 30 #undef FROM_HERE // The one from base/location.h we do not want right now. |
29 #define FROM_HERE ::blink::WebTraceLocation(__FUNCTION__, __FILE__) | 31 #define FROM_HERE ::blink::WebTraceLocation(__FUNCTION__, __FILE__) |
30 #endif // INSIDE_BLINK | 32 #endif // INSIDE_BLINK |
31 | 33 |
32 } | 34 } |
33 | 35 |
34 #endif // WebTraceLocation_h | 36 #endif // WebTraceLocation_h |
OLD | NEW |