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

Side by Side Diff: components/web_restriction/web_restriction_resource_throttle.h

Issue 1423713015: [WIP] WebRestrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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
Bernhard Bauer 2016/01/22 17:32:32 Remove this line (or add one after line 15).
knn 2016/01/25 11:54:24 Done.
15 class URLRequest;
16 }
17
18 namespace web_restriction {
19
20 class WebRestrictionProvider;
21
22 class WebRestrictionResourceThrottle : public content::ResourceThrottle {
23 public:
24 WebRestrictionResourceThrottle(WebRestrictionProvider* provider,
25 const GURL& request_url,
26 bool is_main_frame);
27 ~WebRestrictionResourceThrottle() override;
28
29 // content::ResourceThrottle implementation:
30 void WillStartRequest(bool* defer) override;
31 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
32 bool* defer) override;
33 const char* GetNameForLogging() const override;
34
35 private:
36 bool ShouldDefer(const GURL& url);
37
38 void OnCheckResult(bool should_proceed);
39
40 WebRestrictionProvider* provider_; // Not owned.
41
42 const GURL request_url_;
43 bool is_main_frame_;
44 base::WeakPtrFactory<WebRestrictionResourceThrottle> weak_ptr_factory_;
45
46 DISALLOW_COPY_AND_ASSIGN(WebRestrictionResourceThrottle);
47 };
48
49 } // namespace web_restriction
50
51 #endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698