diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-25 22:18:06 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-25 22:18:06 +0000 |
commit | 700bf620e83311f8a21f60cfb8dc292ec0780a31 (patch) | |
tree | 18351992efd69e8e5077dcb76874a6684fb30431 /chrome/browser/web_contents.cc | |
parent | 65bd67d12cbbf73a0c7842750bd30639ddad2306 (diff) | |
download | chromium_src-700bf620e83311f8a21f60cfb8dc292ec0780a31.zip chromium_src-700bf620e83311f8a21f60cfb8dc292ec0780a31.tar.gz chromium_src-700bf620e83311f8a21f60cfb8dc292ec0780a31.tar.bz2 |
Remove the profiling system. This wasn't being used and complicated some parts of the code (I'm trying to clean up WebContents). We can ressurect this if we have a better plan for doing profiling that needs to live in the browser.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_contents.cc')
-rw-r--r-- | chrome/browser/web_contents.cc | 83 |
1 files changed, 1 insertions, 82 deletions
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 0034846..cb22b7e 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -23,8 +23,6 @@ #include "chrome/browser/load_notification_details.h" #include "chrome/browser/modal_html_dialog_delegate.h" #include "chrome/browser/navigation_entry.h" -#include "chrome/browser/navigation_profiler.h" -#include "chrome/browser/page_load_tracker.h" #include "chrome/browser/password_manager.h" #include "chrome/browser/plugin_installer.h" #include "chrome/browser/plugin_service.h" @@ -198,7 +196,6 @@ WebContents::WebContents(Profile* profile, #pragma warning(suppress: 4355) // Okay to pass "this" here. render_manager_(render_view_factory, this, this), render_view_factory_(render_view_factory), - is_profiling_(false), has_page_title_(false), info_bar_visible_(false), is_starred_(false), @@ -496,42 +493,6 @@ void WebContents::OnSetFocus(HWND window) { } } -NavigationProfiler* WebContents::GetNavigationProfiler() { - return &g_navigation_profiler; -} - -bool WebContents::EnableProfiling() { - NavigationProfiler* profiler = GetNavigationProfiler(); - is_profiling_ = profiler->is_profiling(); - - return is_profiling(); -} - -void WebContents::SaveCurrentProfilingEntry() { - if (is_profiling()) { - NavigationProfiler* profiler = GetNavigationProfiler(); - profiler->MoveActivePageToVisited(process()->host_id(), - render_view_host()->routing_id()); - } - is_profiling_ = false; -} - -void WebContents::CreateNewProfilingEntry(const GURL& url) { - SaveCurrentProfilingEntry(); - - // Check new profiling status. - if (EnableProfiling()) { - NavigationProfiler* profiler = GetNavigationProfiler(); - TimeTicks current_time = TimeTicks::Now(); - - PageLoadTracker *page = new PageLoadTracker( - url, process()->host_id(), render_view_host()->routing_id(), - current_time); - - profiler->AddActivePage(page); - } -} - void WebContents::OnSavePage() { // If we can not save the page, try to download it. if (!SavePackage::IsSavableContents(contents_mime_type())) { @@ -612,8 +573,6 @@ void WebContents::SavePage(const std::wstring& main_file, bool WebContents::Navigate(const NavigationEntry& entry, bool reload) { RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry); - CreateNewProfilingEntry(entry.GetURL()); - // Used for page load time metrics. current_load_start_ = TimeTicks::Now(); @@ -1451,9 +1410,6 @@ void WebContents::DidNavigateAnyFramePreCommit( } } - // Reset timing data and log. - HandleProfilingForDidNavigate(params); - // Notify the password manager of the navigation or form submit. if (params.password_form.origin.is_valid()) GetPasswordManager()->ProvisionallySavePassword(params.password_form); @@ -1512,32 +1468,6 @@ void WebContents::WebAppImagesChanged(WebApp* web_app) { delegate()->NavigationStateChanged(this, TabContents::INVALIDATE_FAVICON); } -void WebContents::HandleProfilingForDidNavigate( - const ViewHostMsg_FrameNavigate_Params& params) { - PageTransition::Type stripped_transition_type = - PageTransition::StripQualifier(params.transition); - if (stripped_transition_type == PageTransition::LINK || - stripped_transition_type == PageTransition::FORM_SUBMIT) { - CreateNewProfilingEntry(params.url); - } - - current_load_start_ = TimeTicks::Now(); - - if (is_profiling()) { - NavigationProfiler* profiler = GetNavigationProfiler(); - - FrameNavigationMetrics* frame = - new FrameNavigationMetrics(PageTransition::FromInt(params.transition), - current_load_start_, - params.url, - params.page_id); - - profiler->AddFrameMetrics(process()->host_id(), - render_view_host()->routing_id(), - frame); - } -} - void WebContents::BroadcastProvisionalLoadCommit( RenderViewHost* render_view_host, const ViewHostMsg_FrameNavigate_Params& params) { @@ -1751,18 +1681,7 @@ void WebContents::DidStartLoading(RenderViewHost* rvh, int32 page_id) { } void WebContents::DidStopLoading(RenderViewHost* rvh, int32 page_id) { - TimeTicks current_time = TimeTicks::Now(); - if (is_profiling()) { - NavigationProfiler* profiler = GetNavigationProfiler(); - - profiler->SetLoadingEndTime(process()->host_id(), - render_view_host()->routing_id(), page_id, - current_time); - SaveCurrentProfilingEntry(); - } - scoped_ptr<LoadNotificationDetails> details; - if (controller()) { NavigationEntry* entry = controller()->GetActiveEntry(); if (entry) { @@ -1770,7 +1689,7 @@ void WebContents::DidStopLoading(RenderViewHost* rvh, int32 page_id) { process_util::ProcessMetrics::CreateProcessMetrics( process()->process())); - TimeDelta elapsed = current_time - current_load_start_; + TimeDelta elapsed = TimeTicks::Now() - current_load_start_; details.reset(new LoadNotificationDetails( entry->GetDisplayURL(), |