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

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

Issue 2282523002: Cleanup by removing thread hop resource throttle code; experiment's over. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stale include reference. Created 4 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_THREAD_HOP_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_THREAD_HOP_RESOURCE_THROTTLE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/public/browser/resource_throttle.h"
11
12 namespace base {
13 class TimeTicks;
14 }
15
16 // A ResourceThrottle which defers request start, redirect, and response
17 // completion on an IO to UI to IO round-trip. This throttle will be added on a
18 // field trial to determine the cost of making some resource-related decisions
19 // on the UI thread. See https://crbug.com/524228.
20 class ThreadHopResourceThrottle : public content::ResourceThrottle {
21 public:
22 ThreadHopResourceThrottle();
23 ~ThreadHopResourceThrottle() override;
24
25 static bool IsEnabled();
26
27 // content::ResourceThrottle:
28 void WillStartRequest(bool* defer) override;
29 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
30 bool* defer) override;
31 void WillProcessResponse(bool* defer) override;
32 const char* GetNameForLogging() const override;
33
34 private:
35 void ResumeAfterThreadHop();
36 void Resume(const base::TimeTicks& time);
37
38 base::WeakPtrFactory<ThreadHopResourceThrottle> weak_factory_;
39
40 DISALLOW_COPY_AND_ASSIGN(ThreadHopResourceThrottle);
41 };
42
43 #endif // CHROME_BROWSER_RENDERER_HOST_THREAD_HOP_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698