| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "content/public/browser/resource_context.h" | 12 #include "content/public/browser/resource_context.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace android_webview { | 18 namespace android_webview { |
| 19 | 19 |
| 20 class AwResourceContext : public content::ResourceContext { | 20 class AwResourceContext : public content::ResourceContext { |
| 21 public: | 21 public: |
| 22 explicit AwResourceContext(net::URLRequestContextGetter* getter); | 22 explicit AwResourceContext(net::URLRequestContextGetter* getter); |
| 23 virtual ~AwResourceContext(); | 23 virtual ~AwResourceContext(); |
| 24 | 24 |
| 25 void SetExtraHeaders(const GURL& url, const std::string& headers); | 25 void SetExtraHeaders(const GURL& url, const std::string& headers); |
| 26 std::string GetExtraHeaders(const GURL& url); | 26 std::string GetExtraHeaders(const GURL& url); |
| 27 | 27 |
| 28 // content::ResourceContext implementation. | 28 // content::ResourceContext implementation. |
| 29 virtual net::HostResolver* GetHostResolver() OVERRIDE; | 29 virtual net::HostResolver* GetHostResolver() override; |
| 30 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; | 30 virtual net::URLRequestContext* GetRequestContext() override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 net::URLRequestContextGetter* getter_; | 33 net::URLRequestContextGetter* getter_; |
| 34 | 34 |
| 35 base::Lock extra_headers_lock_; | 35 base::Lock extra_headers_lock_; |
| 36 std::map<std::string, std::string> extra_headers_; | 36 std::map<std::string, std::string> extra_headers_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(AwResourceContext); | 38 DISALLOW_COPY_AND_ASSIGN(AwResourceContext); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace android_webview | 41 } // namespace android_webview |
| 42 | 42 |
| 43 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | 43 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ |
| OLD | NEW |