Add trace events for SendProcessMessage and off-screen rendering (issue #991).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1301 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-07-11 17:44:48 +00:00
parent c19d8c11ab
commit 5d5a1eb641
4 changed files with 21 additions and 0 deletions

View File

@ -1270,6 +1270,9 @@ void CefBrowserHostImpl::SendCommand(
// Execute on the UI thread because CefResponseManager is not thread safe. // Execute on the UI thread because CefResponseManager is not thread safe.
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand",
"frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params; Cef_Request_Params params;
params.name = "execute-command"; params.name = "execute-command";
params.frame_id = frame_id; params.frame_id = frame_id;
@ -1307,6 +1310,9 @@ void CefBrowserHostImpl::SendCode(
// Execute on the UI thread because CefResponseManager is not thread safe. // Execute on the UI thread because CefResponseManager is not thread safe.
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand",
"frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params; Cef_Request_Params params;
params.name = "execute-code"; params.name = "execute-code";
params.frame_id = frame_id; params.frame_id = frame_id;

View File

@ -175,6 +175,7 @@ void CefRenderWidgetHostViewOSR::Blur() {
} }
void CefRenderWidgetHostViewOSR::UpdateCursor(const WebCursor& cursor) { void CefRenderWidgetHostViewOSR::UpdateCursor(const WebCursor& cursor) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
if (!browser_impl_.get()) if (!browser_impl_.get())
return; return;
#if defined(OS_WIN) #if defined(OS_WIN)
@ -404,6 +405,7 @@ void CefRenderWidgetHostViewOSR::SetBackground(const SkBitmap& background) {
void CefRenderWidgetHostViewOSR::Invalidate(const gfx::Rect& rect, void CefRenderWidgetHostViewOSR::Invalidate(const gfx::Rect& rect,
CefBrowserHost::PaintElementType type) { CefBrowserHost::PaintElementType type) {
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Invalidate", "type", type);
if (!IsPopupWidget() && type == PET_POPUP) { if (!IsPopupWidget() && type == PET_POPUP) {
if (popup_host_view_) if (popup_host_view_)
popup_host_view_->Invalidate(rect, type); popup_host_view_->Invalidate(rect, type);
@ -416,6 +418,7 @@ void CefRenderWidgetHostViewOSR::Invalidate(const gfx::Rect& rect,
void CefRenderWidgetHostViewOSR::Paint( void CefRenderWidgetHostViewOSR::Paint(
const std::vector<gfx::Rect>& copy_rects) { const std::vector<gfx::Rect>& copy_rects) {
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Paint", "rects", copy_rects.size());
if (about_to_validate_and_paint_ || if (about_to_validate_and_paint_ ||
!browser_impl_.get() || !browser_impl_.get() ||
!render_widget_host_) { !render_widget_host_) {
@ -559,6 +562,7 @@ void CefRenderWidgetHostViewOSR::set_parent_host_view(
void CefRenderWidgetHostViewOSR::SendKeyEvent( void CefRenderWidgetHostViewOSR::SendKeyEvent(
const content::NativeWebKeyboardEvent& event) { const content::NativeWebKeyboardEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
if (!render_widget_host_) if (!render_widget_host_)
return; return;
render_widget_host_->ForwardKeyboardEvent(event); render_widget_host_->ForwardKeyboardEvent(event);
@ -566,6 +570,7 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
void CefRenderWidgetHostViewOSR::SendMouseEvent( void CefRenderWidgetHostViewOSR::SendMouseEvent(
const WebKit::WebMouseEvent& event) { const WebKit::WebMouseEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
if (!IsPopupWidget() && popup_host_view_) { if (!IsPopupWidget() && popup_host_view_) {
if (popup_host_view_->popup_position_.Contains(event.x, event.y)) { if (popup_host_view_->popup_position_.Contains(event.x, event.y)) {
WebKit::WebMouseEvent popup_event(event); WebKit::WebMouseEvent popup_event(event);
@ -585,6 +590,7 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
const WebKit::WebMouseWheelEvent& event) { const WebKit::WebMouseWheelEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
if (!IsPopupWidget() && popup_host_view_) { if (!IsPopupWidget() && popup_host_view_) {
if (popup_host_view_->popup_position_.Contains(event.x, event.y)) { if (popup_host_view_->popup_position_.Contains(event.x, event.y)) {
WebKit::WebMouseWheelEvent popup_event(event); WebKit::WebMouseWheelEvent popup_event(event);
@ -605,6 +611,7 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
} }
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
if (!render_widget_host_) if (!render_widget_host_)
return; return;

View File

@ -19,6 +19,7 @@ int CefResponseManager::GetNextRequestId() {
int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) { int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) {
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());
int request_id = GetNextRequestId(); int request_id = GetNextRequestId();
TRACE_EVENT_ASYNC_BEGIN1("libcef", "CefResponseManager::Handler", request_id, "request_id", request_id);
handlers_.insert(std::make_pair(request_id, handler)); handlers_.insert(std::make_pair(request_id, handler));
return request_id; return request_id;
} }
@ -28,10 +29,13 @@ bool CefResponseManager::RunHandler(const Cef_Response_Params& params) {
DCHECK_GT(params.request_id, 0); DCHECK_GT(params.request_id, 0);
HandlerMap::iterator it = handlers_.find(params.request_id); HandlerMap::iterator it = handlers_.find(params.request_id);
if (it != handlers_.end()) { if (it != handlers_.end()) {
TRACE_EVENT0("libcef", "CefResponseManager::RunHandler");
it->second->OnResponse(params); it->second->OnResponse(params);
handlers_.erase(it); handlers_.erase(it);
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 1);
return true; return true;
} }
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 0);
return false; return false;
} }

View File

@ -586,6 +586,10 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
std::string response; std::string response;
bool expect_response_ack = false; bool expect_response_ack = false;
TRACE_EVENT2("libcef", "CefBrowserImpl::OnRequest",
"request_id", params.request_id,
"expect_response", params.expect_response ? 1 : 0);
if (params.user_initiated) { if (params.user_initiated) {
// Give the user a chance to handle the request. // Give the user a chance to handle the request.
CefRefPtr<CefApp> app = CefContentClient::Get()->application(); CefRefPtr<CefApp> app = CefContentClient::Get()->application();