Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/renderer/render_view.cc

Issue 330030: Log the PLT to the log file. This is a convenience for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 void RenderView::DumpLoadHistograms() const { 3413 void RenderView::DumpLoadHistograms() const {
3414 WebFrame* main_frame = webview()->mainFrame(); 3414 WebFrame* main_frame = webview()->mainFrame();
3415 NavigationState* navigation_state = 3415 NavigationState* navigation_state =
3416 NavigationState::FromDataSource(main_frame->dataSource()); 3416 NavigationState::FromDataSource(main_frame->dataSource());
3417 Time finish = navigation_state->finish_load_time(); 3417 Time finish = navigation_state->finish_load_time();
3418 3418
3419 // If we've already dumped or we haven't finished loading, do nothing. 3419 // If we've already dumped or we haven't finished loading, do nothing.
3420 if (navigation_state->load_histograms_recorded() || finish.is_null()) 3420 if (navigation_state->load_histograms_recorded() || finish.is_null())
3421 return; 3421 return;
3422 3422
3423 LogNavigationState(navigation_state, main_frame->dataSource());
3424
3423 Time request = navigation_state->request_time(); 3425 Time request = navigation_state->request_time();
3424 Time start = navigation_state->start_load_time(); 3426 Time start = navigation_state->start_load_time();
3425 Time commit = navigation_state->commit_load_time(); 3427 Time commit = navigation_state->commit_load_time();
3426 Time finish_doc = navigation_state->finish_document_load_time(); 3428 Time finish_doc = navigation_state->finish_document_load_time();
3427 Time first_paint = navigation_state->first_paint_time(); 3429 Time first_paint = navigation_state->first_paint_time();
3428 Time first_paint_after_load = 3430 Time first_paint_after_load =
3429 navigation_state->first_paint_after_load_time(); 3431 navigation_state->first_paint_after_load_time();
3430 3432
3431 Time begin; 3433 Time begin;
3432 // Client side redirects will have no request time. 3434 // Client side redirects will have no request time.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
3561 "Renderer4.CommitToFirstPaintAfterLoad", 3563 "Renderer4.CommitToFirstPaintAfterLoad",
3562 first_paint_after_load - commit); 3564 first_paint_after_load - commit);
3563 UMA_HISTOGRAM_MEDIUM_TIMES( 3565 UMA_HISTOGRAM_MEDIUM_TIMES(
3564 "Renderer4.FinishToFirstPaintAfterLoad", 3566 "Renderer4.FinishToFirstPaintAfterLoad",
3565 first_paint_after_load - finish); 3567 first_paint_after_load - finish);
3566 } 3568 }
3567 3569
3568 navigation_state->set_load_histograms_recorded(true); 3570 navigation_state->set_load_histograms_recorded(true);
3569 } 3571 }
3570 3572
3573 void RenderView::LogNavigationState(const NavigationState* state,
3574 const WebDataSource* ds) const {
3575 // Because this function gets called on every page load,
3576 // take extra care to optimize it away if logging is turned off.
3577 if (logging::LOG_INFO < logging::GetMinLogLevel())
3578 return;
3579
3580 DCHECK(state);
3581 DCHECK(ds);
3582 GURL url(ds->request().url());
3583 Time start = state->start_load_time();
3584 Time finish = state->finish_load_time();
3585 // TODO(mbelshe): should we log more stats?
3586 LOG(INFO) << "PLT: "
3587 << (finish - start).InMilliseconds()
3588 << "ms "
3589 << url.spec();
3590 }
3591
3571 void RenderView::focusAccessibilityObject( 3592 void RenderView::focusAccessibilityObject(
3572 const WebAccessibilityObject& acc_obj) { 3593 const WebAccessibilityObject& acc_obj) {
3573 #if defined(OS_WIN) 3594 #if defined(OS_WIN)
3574 if (!web_accessibility_manager_.get()) { 3595 if (!web_accessibility_manager_.get()) {
3575 web_accessibility_manager_.reset( 3596 web_accessibility_manager_.reset(
3576 webkit_glue::WebAccessibilityManager::Create()); 3597 webkit_glue::WebAccessibilityManager::Create());
3577 } 3598 }
3578 3599
3579 // Retrieve the accessibility object id of the AccessibilityObject. 3600 // Retrieve the accessibility object id of the AccessibilityObject.
3580 int acc_obj_id = web_accessibility_manager_->FocusAccObj(acc_obj); 3601 int acc_obj_id = web_accessibility_manager_->FocusAccObj(acc_obj);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
3682 new PluginMsg_SignalModalDialogEvent(host_window_)); 3703 new PluginMsg_SignalModalDialogEvent(host_window_));
3683 3704
3684 message->EnableMessagePumping(); // Runs a nested message loop. 3705 message->EnableMessagePumping(); // Runs a nested message loop.
3685 bool rv = Send(message); 3706 bool rv = Send(message);
3686 3707
3687 PluginChannelHost::Broadcast( 3708 PluginChannelHost::Broadcast(
3688 new PluginMsg_ResetModalDialogEvent(host_window_)); 3709 new PluginMsg_ResetModalDialogEvent(host_window_));
3689 3710
3690 return rv; 3711 return rv;
3691 } 3712 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698