Chromium Code Reviews| Index: components/web_restriction/web_restriction_resource_throttle.h |
| diff --git a/components/web_restriction/web_restriction_resource_throttle.h b/components/web_restriction/web_restriction_resource_throttle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..53d9a06f58f11ec49dea1701a4e935e999cb2ffc |
| --- /dev/null |
| +++ b/components/web_restriction/web_restriction_resource_throttle.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_ |
| +#define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "content/public/browser/resource_throttle.h" |
| +#include "url/gurl.h" |
| + |
| +namespace net { |
| + |
|
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.
|
| +class URLRequest; |
| +} |
| + |
| +namespace web_restriction { |
| + |
| +class WebRestrictionProvider; |
| + |
| +class WebRestrictionResourceThrottle : public content::ResourceThrottle { |
| + public: |
| + WebRestrictionResourceThrottle(WebRestrictionProvider* provider, |
| + const GURL& request_url, |
| + bool is_main_frame); |
| + ~WebRestrictionResourceThrottle() override; |
| + |
| + // content::ResourceThrottle implementation: |
| + void WillStartRequest(bool* defer) override; |
| + void WillRedirectRequest(const net::RedirectInfo& redirect_info, |
| + bool* defer) override; |
| + const char* GetNameForLogging() const override; |
| + |
| + private: |
| + bool ShouldDefer(const GURL& url); |
| + |
| + void OnCheckResult(bool should_proceed); |
| + |
| + WebRestrictionProvider* provider_; // Not owned. |
| + |
| + const GURL request_url_; |
| + bool is_main_frame_; |
| + base::WeakPtrFactory<WebRestrictionResourceThrottle> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebRestrictionResourceThrottle); |
| +}; |
| + |
| +} // namespace web_restriction |
| + |
| +#endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_RESOURCE_THROTTLE_H_ |