Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/synchronization/lock.h" | |
| 12 #include "content/public/browser/resource_context.h" | |
| 13 | |
| 14 namespace net { | |
| 15 class URLRequestContextGetter; | |
| 16 } | |
| 17 | |
| 18 namespace android_webview { | |
| 19 | |
| 20 class AwResourceContext : public content::ResourceContext { | |
| 21 public: | |
| 22 explicit AwResourceContext(net::URLRequestContextGetter* getter); | |
| 23 virtual ~AwResourceContext(); | |
| 24 | |
| 25 // content::ResourceContext implementation. | |
| 26 virtual net::HostResolver* GetHostResolver() OVERRIDE; | |
| 27 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; | |
| 28 virtual bool AllowMicAccess(const GURL& origin) OVERRIDE; | |
| 29 virtual bool AllowCameraAccess(const GURL& origin) OVERRIDE; | |
| 30 | |
| 31 void SetExtraHeaders(const GURL& url, std::string& headers); | |
|
bulach
2013/12/10 15:16:57
nit: const for headers?
also, I think non-virtual
mnaganov (inactive)
2013/12/10 16:00:37
Changed to const.
There is no explicit style guid
| |
| 32 std::string GetExtraHeaders(const GURL& url); | |
| 33 | |
| 34 private: | |
| 35 net::URLRequestContextGetter* getter_; | |
| 36 base::Lock lock_; | |
|
bulach
2013/12/10 15:16:57
nit: it'd be nice to say what this is protecting..
mnaganov (inactive)
2013/12/10 16:00:37
Renamed to extra_headers_lock_.
| |
| 37 std::map<std::string, std::string> extra_headers_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(AwResourceContext); | |
| 40 }; | |
| 41 | |
| 42 } // namespace android_webview | |
| 43 | |
| 44 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ | |
| OLD | NEW |