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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
11 #include "base/synchronization/lock.h"
12 #include "content/public/browser/resource_context.h"
15 class URLRequestContextGetter
;
18 namespace android_webview
{
20 class AwResourceContext
: public content::ResourceContext
{
22 explicit AwResourceContext(net::URLRequestContextGetter
* getter
);
23 virtual ~AwResourceContext();
25 void SetExtraHeaders(const GURL
& url
, const std::string
& headers
);
26 std::string
GetExtraHeaders(const GURL
& url
);
28 // content::ResourceContext implementation.
29 virtual net::HostResolver
* GetHostResolver() OVERRIDE
;
30 virtual net::URLRequestContext
* GetRequestContext() OVERRIDE
;
31 virtual bool AllowMicAccess(const GURL
& origin
) OVERRIDE
;
32 virtual bool AllowCameraAccess(const GURL
& origin
) OVERRIDE
;
35 net::URLRequestContextGetter
* getter_
;
37 base::Lock extra_headers_lock_
;
38 std::map
<std::string
, std::string
> extra_headers_
;
40 DISALLOW_COPY_AND_ASSIGN(AwResourceContext
);
43 } // namespace android_webview
45 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_