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

Side by Side Diff: content/browser/loader/navigation_resource_throttle.h

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NavigationData final draft before adding tests Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/public/browser/navigation_throttle.h" 10 #include "content/public/browser/navigation_throttle.h"
11 #include "content/public/browser/resource_throttle.h" 11 #include "content/public/browser/resource_throttle.h"
12 12
13 namespace net { 13 namespace net {
14 class URLRequest; 14 class URLRequest;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 class ResourceDispatcherHostImpl;
18 19
19 // This ResourceThrottle is used to convey throttling information to the UI 20 // This ResourceThrottle is used to convey throttling information to the UI
20 // thread during navigations. The UI thread can then use its NavigationThrottle 21 // thread during navigations. The UI thread can then use its NavigationThrottle
21 // mechanism to interact with the navigation. 22 // mechanism to interact with the navigation.
22 class NavigationResourceThrottle : public ResourceThrottle { 23 class NavigationResourceThrottle : public ResourceThrottle {
23 public: 24 public:
24 NavigationResourceThrottle(net::URLRequest* request); 25 NavigationResourceThrottle(net::URLRequest* request,
26 ResourceDispatcherHostImpl* rdh);
nasko 2016/04/26 20:18:40 Use full names for parameters, it isn't that much
RyanSturm 2016/04/27 23:27:47 Done.
25 ~NavigationResourceThrottle() override; 27 ~NavigationResourceThrottle() override;
26 28
27 // ResourceThrottle overrides: 29 // ResourceThrottle overrides:
28 void WillStartRequest(bool* defer) override; 30 void WillStartRequest(bool* defer) override;
29 void WillRedirectRequest(const net::RedirectInfo& redirect_info, 31 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
30 bool* defer) override; 32 bool* defer) override;
31 void WillProcessResponse(bool* defer) override; 33 void WillProcessResponse(bool* defer) override;
32 const char* GetNameForLogging() const override; 34 const char* GetNameForLogging() const override;
33 35
34 private: 36 private:
35 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result); 37 void OnUIChecksPerformed(NavigationThrottle::ThrottleCheckResult result);
36 38
37 net::URLRequest* request_; 39 net::URLRequest* request_;
40 ResourceDispatcherHostImpl* rdh_;
nasko 2016/04/26 20:18:40 Same here, having a longer name makes it a bit eas
RyanSturm 2016/04/27 23:27:47 Done.
38 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_; 41 base::WeakPtrFactory<NavigationResourceThrottle> weak_ptr_factory_;
39 42
40 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle); 43 DISALLOW_COPY_AND_ASSIGN(NavigationResourceThrottle);
41 }; 44 };
42 45
43 } // namespace content 46 } // namespace content
44 47
45 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_ 48 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698