mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@ -1270,6 +1270,9 @@ void CefBrowserHostImpl::SendCommand(
|
||||
|
||||
// Execute on the UI thread because CefResponseManager is not thread safe.
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand",
|
||||
"frame_id", frame_id,
|
||||
"needsResponse", responseHandler.get() ? 1 : 0);
|
||||
Cef_Request_Params params;
|
||||
params.name = "execute-command";
|
||||
params.frame_id = frame_id;
|
||||
@ -1307,6 +1310,9 @@ void CefBrowserHostImpl::SendCode(
|
||||
|
||||
// Execute on the UI thread because CefResponseManager is not thread safe.
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand",
|
||||
"frame_id", frame_id,
|
||||
"needsResponse", responseHandler.get() ? 1 : 0);
|
||||
Cef_Request_Params params;
|
||||
params.name = "execute-code";
|
||||
params.frame_id = frame_id;
|
||||
|
@ -175,6 +175,7 @@ void CefRenderWidgetHostViewOSR::Blur() {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::UpdateCursor(const WebCursor& cursor) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
|
||||
if (!browser_impl_.get())
|
||||
return;
|
||||
#if defined(OS_WIN)
|
||||
@ -404,6 +405,7 @@ void CefRenderWidgetHostViewOSR::SetBackground(const SkBitmap& background) {
|
||||
|
||||
void CefRenderWidgetHostViewOSR::Invalidate(const gfx::Rect& rect,
|
||||
CefBrowserHost::PaintElementType type) {
|
||||
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Invalidate", "type", type);
|
||||
if (!IsPopupWidget() && type == PET_POPUP) {
|
||||
if (popup_host_view_)
|
||||
popup_host_view_->Invalidate(rect, type);
|
||||
@ -416,6 +418,7 @@ void CefRenderWidgetHostViewOSR::Invalidate(const gfx::Rect& rect,
|
||||
|
||||
void CefRenderWidgetHostViewOSR::Paint(
|
||||
const std::vector<gfx::Rect>& copy_rects) {
|
||||
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Paint", "rects", copy_rects.size());
|
||||
if (about_to_validate_and_paint_ ||
|
||||
!browser_impl_.get() ||
|
||||
!render_widget_host_) {
|
||||
@ -559,6 +562,7 @@ void CefRenderWidgetHostViewOSR::set_parent_host_view(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
render_widget_host_->ForwardKeyboardEvent(event);
|
||||
@ -566,6 +570,7 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendMouseEvent(
|
||||
const WebKit::WebMouseEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
|
||||
if (!IsPopupWidget() && popup_host_view_) {
|
||||
if (popup_host_view_->popup_position_.Contains(event.x, event.y)) {
|
||||
WebKit::WebMouseEvent popup_event(event);
|
||||
@ -585,6 +590,7 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
||||
const WebKit::WebMouseWheelEvent& event) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
|
||||
if (!IsPopupWidget() && popup_host_view_) {
|
||||
if (popup_host_view_->popup_position_.Contains(event.x, event.y)) {
|
||||
WebKit::WebMouseWheelEvent popup_event(event);
|
||||
@ -605,6 +611,7 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
|
||||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
|
@ -19,6 +19,7 @@ int CefResponseManager::GetNextRequestId() {
|
||||
int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
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));
|
||||
return request_id;
|
||||
}
|
||||
@ -28,10 +29,13 @@ bool CefResponseManager::RunHandler(const Cef_Response_Params& params) {
|
||||
DCHECK_GT(params.request_id, 0);
|
||||
HandlerMap::iterator it = handlers_.find(params.request_id);
|
||||
if (it != handlers_.end()) {
|
||||
TRACE_EVENT0("libcef", "CefResponseManager::RunHandler");
|
||||
it->second->OnResponse(params);
|
||||
handlers_.erase(it);
|
||||
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 1);
|
||||
return true;
|
||||
}
|
||||
TRACE_EVENT_ASYNC_END1("libcef", "CefResponseManager::Handler", params.request_id, "success", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -586,6 +586,10 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
||||
std::string response;
|
||||
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) {
|
||||
// Give the user a chance to handle the request.
|
||||
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
|
||||
|
Reference in New Issue
Block a user