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:
Marshall Greenblatt 2013-03-15 19:57:20 +00:00
parent b835143515
commit 25e54b1800
6 changed files with 45 additions and 0 deletions

View File

@ -90,6 +90,13 @@ CEF_EXPORT int cef_get_trace_buffer_percent_full_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
// this structure will be called on the browser process UI thread.

View File

@ -121,4 +121,12 @@ bool CefGetTraceBufferPercentFullAsync();
/*--cef()--*/
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_

View File

@ -9,6 +9,7 @@
#include "libcef/browser/thread_util.h"
#include "base/debug/trace_event.h"
#include "base/time.h"
bool CefBeginTracing(CefRefPtr<CefTraceClient> client,
const CefString& categories) {
@ -65,6 +66,9 @@ bool CefEndTracingAsync() {
return subscriber->EndTracingAsync();
}
int64 CefNowFromSystemTraceTime() {
return base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
}
// The below functions can be called from any process.

View File

@ -492,6 +492,16 @@ CEF_EXPORT int cef_end_tracing_async() {
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,
struct _cef_urlparts_t* parts) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -475,6 +475,16 @@ CEF_GLOBAL bool CefEndTracingAsync() {
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) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

View File

@ -398,3 +398,9 @@ TRACING_TEST(TraceEventAsyncEnd0, CEF_TRACE_EVENT_ASYNC_END0);
TRACING_TEST(TraceEventAsyncEnd1, CEF_TRACE_EVENT_ASYNC_END1);
TRACING_TEST(TraceEventAsyncEnd2, CEF_TRACE_EVENT_ASYNC_END2);
TRACING_TEST(TraceEventCopyAsyncEnd0, CEF_TRACE_EVENT_COPY_ASYNC_END0);
TEST(TracingTest, NowFromSystemTraceTime) {
int64 val = CefNowFromSystemTraceTime();
EXPECT_NE(val, 0);
}