aw_resource_context.h 1007 B

12345678910111213141516171819202122232425262728293031323334353637
  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.
  4. #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
  6. #include <map>
  7. #include <string>
  8. #include "base/synchronization/lock.h"
  9. #include "content/public/browser/resource_context.h"
  10. class GURL;
  11. namespace android_webview {
  12. class AwResourceContext : public content::ResourceContext {
  13. public:
  14. AwResourceContext();
  15. AwResourceContext(const AwResourceContext&) = delete;
  16. AwResourceContext& operator=(const AwResourceContext&) = delete;
  17. ~AwResourceContext() override;
  18. void SetExtraHeaders(const GURL& url, const std::string& headers);
  19. std::string GetExtraHeaders(const GURL& url);
  20. private:
  21. base::Lock extra_headers_lock_;
  22. std::map<std::string, std::string> extra_headers_;
  23. };
  24. } // namespace android_webview
  25. #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_