2012-04-03 01:34:16 +00:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework 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 CEF_LIBCEF_BROWSER_URL_REQUEST_CONTEXT_GETTER_PROXY_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_URL_REQUEST_CONTEXT_GETTER_PROXY_H_
|
|
|
|
#pragma once
|
|
|
|
|
2013-09-03 16:43:31 +00:00
|
|
|
#include "include/cef_request_context_handler.h"
|
2015-02-13 23:17:08 +00:00
|
|
|
#include "libcef/browser/url_request_context_getter.h"
|
|
|
|
#include "libcef/browser/url_request_context_getter_impl.h"
|
2013-09-03 16:43:31 +00:00
|
|
|
|
2012-05-18 15:04:56 +00:00
|
|
|
#include "base/memory/scoped_ptr.h"
|
2012-04-03 01:34:16 +00:00
|
|
|
|
2012-06-28 17:21:18 +00:00
|
|
|
class CefURLRequestContextProxy;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
2015-02-13 23:17:08 +00:00
|
|
|
// URLRequestContextGetter implementation for a particular CefRequestContext.
|
|
|
|
// Life span is primarily controlled by CefResourceContext. Only accessed on the
|
|
|
|
// IO thread. See browser_context.h for an object relationship diagram.
|
|
|
|
class CefURLRequestContextGetterProxy : public CefURLRequestContextGetter {
|
2012-04-03 01:34:16 +00:00
|
|
|
public:
|
2015-02-13 23:17:08 +00:00
|
|
|
CefURLRequestContextGetterProxy(
|
|
|
|
CefRefPtr<CefRequestContextHandler> handler,
|
|
|
|
scoped_refptr<CefURLRequestContextGetterImpl> parent);
|
2014-11-12 19:25:15 +00:00
|
|
|
~CefURLRequestContextGetterProxy() override;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
// net::URLRequestContextGetter implementation.
|
2014-11-12 19:25:15 +00:00
|
|
|
net::URLRequestContext* GetURLRequestContext() override;
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner>
|
|
|
|
GetNetworkTaskRunner() const override;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
2015-02-13 23:17:08 +00:00
|
|
|
// CefURLRequestContextGetter implementation.
|
|
|
|
net::HostResolver* GetHostResolver() const override;
|
2013-09-03 16:43:31 +00:00
|
|
|
|
|
|
|
CefRefPtr<CefRequestContextHandler> handler() const { return handler_; }
|
|
|
|
|
2012-04-03 01:34:16 +00:00
|
|
|
private:
|
2013-09-03 16:43:31 +00:00
|
|
|
CefRefPtr<CefRequestContextHandler> handler_;
|
2012-06-28 17:21:18 +00:00
|
|
|
|
2015-02-13 23:17:08 +00:00
|
|
|
// The CefURLRequestContextImpl owned by |parent_| is passed as a raw pointer
|
|
|
|
// to CefURLRequestContextProxy and CefCookieStoreProxy. This reference is
|
|
|
|
// necessary to keep it alive.
|
|
|
|
scoped_refptr<CefURLRequestContextGetterImpl> parent_;
|
|
|
|
|
|
|
|
scoped_ptr<CefURLRequestContextProxy> context_proxy_;
|
2012-04-03 01:34:16 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterProxy);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_URL_REQUEST_CONTEXT_GETTER_PROXY_H_
|