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

Side by Side Diff: content/browser/frame_host/navigator_impl.h

Issue 577963002: Add time-to-network histogram considering browser side navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments, added new hisogram, test and fixes. Created 6 years, 2 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/time/time.h"
9 #include "content/browser/frame_host/navigation_controller_impl.h" 10 #include "content/browser/frame_host/navigation_controller_impl.h"
10 #include "content/browser/frame_host/navigator.h" 11 #include "content/browser/frame_host/navigator.h"
11 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "url/gurl.h"
12 14
13 struct FrameMsg_Navigate_Params; 15 struct FrameMsg_Navigate_Params;
14 16
15 namespace content { 17 namespace content {
16 18
17 class NavigationControllerImpl; 19 class NavigationControllerImpl;
18 class NavigatorDelegate; 20 class NavigatorDelegate;
19 struct LoadCommittedDetails; 21 struct LoadCommittedDetails;
20 22
21 // This class is an implementation of Navigator, responsible for managing 23 // This class is an implementation of Navigator, responsible for managing
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const Referrer& referrer, 73 const Referrer& referrer,
72 ui::PageTransition page_transition, 74 ui::PageTransition page_transition,
73 WindowOpenDisposition disposition, 75 WindowOpenDisposition disposition,
74 const GlobalRequestID& transferred_global_request_id, 76 const GlobalRequestID& transferred_global_request_id,
75 bool should_replace_current_entry, 77 bool should_replace_current_entry,
76 bool user_gesture) OVERRIDE; 78 bool user_gesture) OVERRIDE;
77 virtual void CommitNavigation( 79 virtual void CommitNavigation(
78 RenderFrameHostImpl* render_frame_host, 80 RenderFrameHostImpl* render_frame_host,
79 const NavigationBeforeCommitInfo& info) OVERRIDE; 81 const NavigationBeforeCommitInfo& info) OVERRIDE;
80 82
83 virtual void LogResourceRequestTime(
84 base::TimeTicks timestamp, const GURL& url) OVERRIDE;
85
81 private: 86 private:
82 virtual ~NavigatorImpl() {} 87 virtual ~NavigatorImpl() {}
83 88
84 // Navigates to the given entry, which must be the pending entry. Private 89 // Navigates to the given entry, which must be the pending entry. Private
85 // because all callers should use NavigateToPendingEntry. 90 // because all callers should use NavigateToPendingEntry.
86 bool NavigateToEntry( 91 bool NavigateToEntry(
87 RenderFrameHostImpl* render_frame_host, 92 RenderFrameHostImpl* render_frame_host,
88 const NavigationEntryImpl& entry, 93 const NavigationEntryImpl& entry,
89 NavigationController::ReloadType reload_type); 94 NavigationController::ReloadType reload_type);
90 95
91 bool ShouldAssignSiteForURL(const GURL& url); 96 bool ShouldAssignSiteForURL(const GURL& url);
92 97
93 void CheckWebUIRendererDoesNotDisplayNormalURL( 98 void CheckWebUIRendererDoesNotDisplayNormalURL(
94 RenderFrameHostImpl* render_frame_host, 99 RenderFrameHostImpl* render_frame_host,
95 const GURL& url); 100 const GURL& url);
96 101
97 // The NavigationController that will keep track of session history for all 102 // The NavigationController that will keep track of session history for all
98 // RenderFrameHost objects using this NavigatorImpl. 103 // RenderFrameHost objects using this NavigatorImpl.
99 // TODO(nasko): Move ownership of the NavigationController from 104 // TODO(nasko): Move ownership of the NavigationController from
100 // WebContentsImpl to this class. 105 // WebContentsImpl to this class.
101 NavigationControllerImpl* controller_; 106 NavigationControllerImpl* controller_;
102 107
103 // Used to notify the object embedding this Navigator about navigation 108 // Used to notify the object embedding this Navigator about navigation
104 // events. Can be NULL in tests. 109 // events. Can be NULL in tests.
105 NavigatorDelegate* delegate_; 110 NavigatorDelegate* delegate_;
106 111
112 // The time the latest navigation request started, used for a few histograms
113 // under the Navigation group.
114 base::TimeTicks navigation_start_time_;
115 // The URL of the navigation request to allow the later matching with the
nasko 2014/09/24 00:48:07 nit: leave an empty line above the comment
carlosk 2014/09/24 18:35:50 Done.
116 // active when recording histogram data.
clamy 2014/09/23 21:54:07 s/the later matching with the active/later matchin
carlosk 2014/09/24 18:35:50 Done.
117 GURL navigation_start_url_;
nasko 2014/09/24 00:48:07 Why not use a pair of (url, frame_tree_node_id)? T
carlosk 2014/09/24 18:35:50 I guess not because: * I don't think it'll help i
nasko 2014/09/24 23:11:21 I wrote this comment before asking about main fram
carlosk 2014/09/25 17:26:06 This is exactly the point that davidben@ brought u
118
107 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); 119 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl);
108 }; 120 };
109 121
110 } // namespace content 122 } // namespace content
111 123
112 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ 124 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698