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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "chrome/browser/external_protocol/external_protocol_handler.h" 15 #include "chrome/browser/external_protocol/external_protocol_handler.h"
16 #include "content/public/browser/resource_dispatcher_host_delegate.h" 16 #include "content/public/browser/resource_dispatcher_host_delegate.h"
17 17
18 class DelayedResourceQueue; 18 class DelayedResourceQueue;
19 class DownloadRequestLimiter; 19 class DownloadRequestLimiter;
20 20
21 namespace extensions { 21 namespace extensions {
22 class UserScriptListener; 22 class UserScriptListener;
23 } 23 }
24 24
25 namespace net {
26 class URLRequest;
27 }
28
25 namespace safe_browsing { 29 namespace safe_browsing {
26 class SafeBrowsingService; 30 class SafeBrowsingService;
27 } 31 }
28 32
33 namespace content {
Lei Zhang 2016/05/10 19:09:31 nit: put this above extensions
RyanSturm 2016/05/10 21:05:32 Done.
34 class NavigationData;
35 }
36
29 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender 37 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender
30 // system to abort requests and add to the load flags when a request begins. 38 // system to abort requests and add to the load flags when a request begins.
31 class ChromeResourceDispatcherHostDelegate 39 class ChromeResourceDispatcherHostDelegate
32 : public content::ResourceDispatcherHostDelegate { 40 : public content::ResourceDispatcherHostDelegate {
33 public: 41 public:
34 ChromeResourceDispatcherHostDelegate(); 42 ChromeResourceDispatcherHostDelegate();
35 ~ChromeResourceDispatcherHostDelegate() override; 43 ~ChromeResourceDispatcherHostDelegate() override;
36 44
37 // ResourceDispatcherHostDelegate implementation. 45 // ResourceDispatcherHostDelegate implementation.
38 bool ShouldBeginRequest(const std::string& method, 46 bool ShouldBeginRequest(const std::string& method,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 content::ResourceResponse* response, 87 content::ResourceResponse* response,
80 IPC::Sender* sender) override; 88 IPC::Sender* sender) override;
81 void OnRequestRedirected(const GURL& redirect_url, 89 void OnRequestRedirected(const GURL& redirect_url,
82 net::URLRequest* request, 90 net::URLRequest* request,
83 content::ResourceContext* resource_context, 91 content::ResourceContext* resource_context,
84 content::ResourceResponse* response) override; 92 content::ResourceResponse* response) override;
85 void RequestComplete(net::URLRequest* url_request) override; 93 void RequestComplete(net::URLRequest* url_request) override;
86 bool ShouldEnableLoFiMode( 94 bool ShouldEnableLoFiMode(
87 const net::URLRequest& url_request, 95 const net::URLRequest& url_request,
88 content::ResourceContext* resource_context) override; 96 content::ResourceContext* resource_context) override;
97 content::NavigationData* GetNavigationData(
98 net::URLRequest* request) const override;
89 99
90 // Called on the UI thread. Allows switching out the 100 // Called on the UI thread. Allows switching out the
91 // ExternalProtocolHandler::Delegate for testing code. 101 // ExternalProtocolHandler::Delegate for testing code.
92 static void SetExternalProtocolHandlerDelegateForTesting( 102 static void SetExternalProtocolHandlerDelegateForTesting(
93 ExternalProtocolHandler::Delegate* delegate); 103 ExternalProtocolHandler::Delegate* delegate);
94 104
95 private: 105 private:
96 #if defined(ENABLE_EXTENSIONS) 106 #if defined(ENABLE_EXTENSIONS)
97 struct StreamTargetInfo { 107 struct StreamTargetInfo {
98 std::string extension_id; 108 std::string extension_id;
(...skipping 11 matching lines...) Expand all
110 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_; 120 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_;
111 #if defined(ENABLE_EXTENSIONS) 121 #if defined(ENABLE_EXTENSIONS)
112 scoped_refptr<extensions::UserScriptListener> user_script_listener_; 122 scoped_refptr<extensions::UserScriptListener> user_script_listener_;
113 std::map<net::URLRequest*, StreamTargetInfo> stream_target_info_; 123 std::map<net::URLRequest*, StreamTargetInfo> stream_target_info_;
114 #endif 124 #endif
115 125
116 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); 126 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate);
117 }; 127 };
118 128
119 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_ 129 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698