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

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: continue review in split cl 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 class URLRequest;
15 }
16
17 namespace web_restriction {
18
19 class WebRestrictionProvider;
20
21 class WebRestrictionResourceThrottle : public content::ResourceThrottle {
22 public:
23 WebRestrictionResourceThrottle(WebRestrictionProvider* provider,
24 const GURL& request_url,
25 bool is_main_frame);
26 ~WebRestrictionResourceThrottle() 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 WebRestrictionProvider* provider_; // Not owned.
40
41 const GURL request_url_;
42 bool is_main_frame_;
43 base::WeakPtrFactory<WebRestrictionResourceThrottle> weak_ptr_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(WebRestrictionResourceThrottle);
46 };
47
48 } // namespace web_restriction
49
50 #endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698