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

Unified Diff: chrome/browser/net/resource_prefetch_predictor_observer.h

Issue 2545943003: Accessing navigation information via webcontents (Closed)
Patch Set: Fixed SummarizeResponse Created 4 years 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: chrome/browser/net/resource_prefetch_predictor_observer.h
diff --git a/chrome/browser/net/resource_prefetch_predictor_observer.h b/chrome/browser/net/resource_prefetch_predictor_observer.h
index 9bd1694b6961bab67e1b01823ff3a9cc58faaa72..6566c5ddc98394e98579f303fd903d293926e2e1 100644
--- a/chrome/browser/net/resource_prefetch_predictor_observer.h
+++ b/chrome/browser/net/resource_prefetch_predictor_observer.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
+#include "content/public/browser/resource_request_info.h"
#include "content/public/common/resource_type.h"
namespace net {
@@ -25,20 +26,50 @@ namespace chrome_browser_net {
// - Needs to be constructed on UI thread. Rest of the functions can only be
// called on the IO thread. Can be destroyed on UI or IO thread.
alexilin 2016/12/05 13:20:00 Probably we should update this comment. I'm not su
class ResourcePrefetchPredictorObserver {
+
ahemery 2016/12/05 09:38:45 Not sure this is okay in a header file, even if in
alexilin 2016/12/05 13:20:00 We generally avoid the use of using declaration in
+ using URLRequestSummary =
ahemery 2016/12/06 14:31:11 Removed and full names used in header file
+ predictors::ResourcePrefetchPredictor::URLRequestSummary;
+
public:
explicit ResourcePrefetchPredictorObserver(
predictors::ResourcePrefetchPredictor* predictor);
~ResourcePrefetchPredictorObserver();
// Parts of the ResourceDispatcherHostDelegate that we want to observe.
- void OnRequestStarted(net::URLRequest* request,
- content::ResourceType resource_type,
- int child_id,
- int frame_id);
- void OnRequestRedirected(const GURL& redirect_url, net::URLRequest* request);
- void OnResponseStarted(net::URLRequest* request);
+ void OnRequestStarted(
+ net::URLRequest* request,
+ content::ResourceType resource_type,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter);
+ void OnRequestRedirected(
+ net::URLRequest* request,
+ const GURL& redirect_url,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter);
+ void OnResponseStarted(
+ net::URLRequest* request,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter);
private:
+ void OnRequestStartedOnUIThread(
+ std::unique_ptr<URLRequestSummary> summary,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter) const;
+ void OnRequestRedirectedOnUIThread(
+ std::unique_ptr<URLRequestSummary> summary,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter) const;
+ void OnResponseStartedOnUIThread(
+ std::unique_ptr<URLRequestSummary> summary,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter) const;
+
+ void RetrieveNavigationID(
+ predictors::NavigationID& navigation_id,
+ const content::ResourceRequestInfo::WebContentsGetter&
+ web_contents_getter) const;
+
// Owned by profile.
base::WeakPtr<predictors::ResourcePrefetchPredictor> predictor_;

Powered by Google App Engine
This is Rietveld 408576698