mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add new CefNowFromSystemTraceTime() method (issue #908).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1147 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -90,6 +90,13 @@ CEF_EXPORT int cef_get_trace_buffer_percent_full_async();
|
|||||||
///
|
///
|
||||||
CEF_EXPORT int cef_end_tracing_async();
|
CEF_EXPORT int cef_end_tracing_async();
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the current system trace time or, if none is defined, the current
|
||||||
|
// high-res time. Can be used by clients to synchronize with the time
|
||||||
|
// information in trace events.
|
||||||
|
///
|
||||||
|
CEF_EXPORT int64 cef_now_from_system_trace_time();
|
||||||
|
|
||||||
///
|
///
|
||||||
// Implement this structure to receive trace notifications. The functions of
|
// Implement this structure to receive trace notifications. The functions of
|
||||||
// this structure will be called on the browser process UI thread.
|
// this structure will be called on the browser process UI thread.
|
||||||
|
@ -121,4 +121,12 @@ bool CefGetTraceBufferPercentFullAsync();
|
|||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
bool CefEndTracingAsync();
|
bool CefEndTracingAsync();
|
||||||
|
|
||||||
|
///
|
||||||
|
// Returns the current system trace time or, if none is defined, the current
|
||||||
|
// high-res time. Can be used by clients to synchronize with the time
|
||||||
|
// information in trace events.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
int64 CefNowFromSystemTraceTime();
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_CEF_TRACE_H_
|
#endif // CEF_INCLUDE_CEF_TRACE_H_
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
|
|
||||||
#include "base/debug/trace_event.h"
|
#include "base/debug/trace_event.h"
|
||||||
|
#include "base/time.h"
|
||||||
|
|
||||||
bool CefBeginTracing(CefRefPtr<CefTraceClient> client,
|
bool CefBeginTracing(CefRefPtr<CefTraceClient> client,
|
||||||
const CefString& categories) {
|
const CefString& categories) {
|
||||||
@ -65,6 +66,9 @@ bool CefEndTracingAsync() {
|
|||||||
return subscriber->EndTracingAsync();
|
return subscriber->EndTracingAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64 CefNowFromSystemTraceTime() {
|
||||||
|
return base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
|
||||||
|
}
|
||||||
|
|
||||||
// The below functions can be called from any process.
|
// The below functions can be called from any process.
|
||||||
|
|
||||||
|
@ -492,6 +492,16 @@ CEF_EXPORT int cef_end_tracing_async() {
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CEF_EXPORT int64 cef_now_from_system_trace_time() {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int64 _retval = CefNowFromSystemTraceTime();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
CEF_EXPORT int cef_parse_url(const cef_string_t* url,
|
||||||
struct _cef_urlparts_t* parts) {
|
struct _cef_urlparts_t* parts) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
@ -475,6 +475,16 @@ CEF_GLOBAL bool CefEndTracingAsync() {
|
|||||||
return _retval?true:false;
|
return _retval?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CEF_GLOBAL int64 CefNowFromSystemTraceTime() {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int64 _retval = cef_now_from_system_trace_time();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) {
|
CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
@ -398,3 +398,9 @@ TRACING_TEST(TraceEventAsyncEnd0, CEF_TRACE_EVENT_ASYNC_END0);
|
|||||||
TRACING_TEST(TraceEventAsyncEnd1, CEF_TRACE_EVENT_ASYNC_END1);
|
TRACING_TEST(TraceEventAsyncEnd1, CEF_TRACE_EVENT_ASYNC_END1);
|
||||||
TRACING_TEST(TraceEventAsyncEnd2, CEF_TRACE_EVENT_ASYNC_END2);
|
TRACING_TEST(TraceEventAsyncEnd2, CEF_TRACE_EVENT_ASYNC_END2);
|
||||||
TRACING_TEST(TraceEventCopyAsyncEnd0, CEF_TRACE_EVENT_COPY_ASYNC_END0);
|
TRACING_TEST(TraceEventCopyAsyncEnd0, CEF_TRACE_EVENT_COPY_ASYNC_END0);
|
||||||
|
|
||||||
|
|
||||||
|
TEST(TracingTest, NowFromSystemTraceTime) {
|
||||||
|
int64 val = CefNowFromSystemTraceTime();
|
||||||
|
EXPECT_NE(val, 0);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user