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

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 07501267d8287e0f2dfbc7d0ff520239ba6792e0..05f7586e53eed203ad54ce55a4d0cb59bd0a907c 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -8,20 +8,21 @@
#include "content/public/browser/navigation_handle.h"
#include <stddef.h>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/common/content_export.h"
+#include "content/public/browser/navigation_data.h"
#include "content/public/browser/navigation_throttle.h"
#include "url/gurl.h"
struct FrameHostMsg_DidCommitProvisionalLoad_Params;
namespace content {
class NavigatorDelegate;
class ServiceWorkerContextWrapper;
class ServiceWorkerNavigationHandle;
@@ -104,20 +105,21 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
bool is_post,
const Referrer& sanitized_referrer,
bool has_user_gesture,
ui::PageTransition transition,
bool is_external_protocol) override;
NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting(
const GURL& new_url,
bool new_method_is_post,
const GURL& new_referrer_url,
bool new_is_external_protocol) override;
+ NavigationData* GetNavigationData() override;
NavigatorDelegate* GetDelegate() const;
// Returns the response headers for the request or nullptr if there are none.
// This should only be accessed after a redirect was encountered or after the
// navigation is ready to commit. The headers returned should not be modified,
// as modifications will not be reflected in the network stack.
const net::HttpResponseHeaders* GetResponseHeaders();
// Get the unique id from the NavigationEntry associated with this
@@ -204,20 +206,27 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// delegate.
void ReadyToCommitNavigation(RenderFrameHostImpl* render_frame_host);
// Called when the navigation was committed in |render_frame_host|. This will
// update the |state_|.
void DidCommitNavigation(
const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
bool same_page,
RenderFrameHostImpl* render_frame_host);
+ // Called during commit. Takes ownership of the embedder's NavigationData
+ // instance. This NavigationData may have been cloned prior to being added
+ // here.
+ void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
+ navigation_data_ = std::move(navigation_data);
+ }
+
private:
friend class NavigationHandleImplTest;
// Used to track the state the navigation is currently in.
enum State {
INITIAL = 0,
WILL_SEND_REQUEST,
DEFERRING_START,
WILL_REDIRECT_REQUEST,
DEFERRING_REDIRECT,
@@ -287,16 +296,19 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
int pending_nav_entry_id_;
// This callback will be run when all throttle checks have been performed.
ThrottleChecksFinishedCallback complete_callback_;
// PlzNavigate
// Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
// corresponding ServiceWorkerNetworkProvider is created in the renderer.
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
+ // Embedder data tied to this navigation.
+ std::unique_ptr<NavigationData> navigation_data_;
+
DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
};
} // namespace content
#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698