Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |