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

Side by Side Diff: components/web_restrictions/web_restrictions_resource_throttle.h

Issue 1631603002: Web restrictions component only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_
6 #define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_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 #include "url/gurl.h"
12
13 namespace net {
14 class URLRequest;
15 }
16
17 namespace web_restrictions {
18
19 class WebRestrictionsProvider;
20
21 class WebRestrictionsResourceThrottle : public content::ResourceThrottle {
22 public:
23 WebRestrictionsResourceThrottle(WebRestrictionsProvider* provider,
24 const GURL& request_url,
25 bool is_main_frame);
26 ~WebRestrictionsResourceThrottle() override;
27
28 // content::ResourceThrottle implementation:
29 void WillStartRequest(bool* defer) override;
30 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
31 bool* defer) override;
32 const char* GetNameForLogging() const override;
33
34 private:
35 bool ShouldDefer(const GURL& url);
36
37 void OnCheckResult(bool should_proceed);
38
39 WebRestrictionsProvider* provider_; // Not owned.
40
41 const GURL request_url_;
42 bool is_main_frame_;
43 base::WeakPtrFactory<WebRestrictionsResourceThrottle> weak_ptr_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(WebRestrictionsResourceThrottle);
46 };
47
48 } // namespace web_restrictions
49
50 #endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698