Commit 385be456 authored by Marshall Greenblatt's avatar Marshall Greenblatt

Structural improvements for request handling (issue #1044)

- Add new CefRequestContext and CefRequestContextHandler classes.
- Add CefRequestContext argument to CefBrowserHost static factory methods.
- Move GetCookieManager from CefRequestHandler to CefRequestContextHandler.
- Use BrowserContext as the root proxy object for network requests.
- Move accessors for CefBrowserMainParts members from CefContext to CefContentBrowserClient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1424 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
parent 935a35f2
......@@ -261,6 +261,7 @@
'tests/unittests/navigation_unittest.cc',
'tests/unittests/os_rendering_unittest.cc',
'tests/unittests/process_message_unittest.cc',
'tests/unittests/request_context_unittest.cc',
'tests/unittests/request_handler_unittest.cc',
'tests/unittests/request_unittest.cc',
'tests/cefclient/resource_util.h',
......@@ -808,8 +809,11 @@
'<@(includes_common)',
'libcef/browser/backing_store_osr.cc',
'libcef/browser/backing_store_osr.h',
'libcef/browser/browser_context.cc',
'libcef/browser/browser_context.h',
'libcef/browser/browser_context_impl.cc',
'libcef/browser/browser_context_impl.h',
'libcef/browser/browser_context_proxy.cc',
'libcef/browser/browser_context_proxy.h',
'libcef/browser/browser_host_impl.cc',
'libcef/browser/browser_host_impl.h',
'libcef/browser/browser_info.cc',
......@@ -871,6 +875,8 @@
'libcef/browser/resource_dispatcher_host_delegate.h',
'libcef/browser/resource_request_job.cc',
'libcef/browser/resource_request_job.h',
'libcef/browser/request_context_impl.cc',
'libcef/browser/request_context_impl.h',
'libcef/browser/scheme_handler.cc',
'libcef/browser/scheme_handler.h',
'libcef/browser/scheme_impl.cc',
......
......@@ -44,6 +44,8 @@
'include/cef_render_handler.h',
'include/cef_render_process_handler.h',
'include/cef_request.h',
'include/cef_request_context.h',
'include/cef_request_context_handler.h',
'include/cef_request_handler.h',
'include/cef_resource_bundle_handler.h',
'include/cef_resource_handler.h',
......@@ -94,6 +96,8 @@
'include/capi/cef_render_handler_capi.h',
'include/capi/cef_render_process_handler_capi.h',
'include/capi/cef_request_capi.h',
'include/capi/cef_request_context_capi.h',
'include/capi/cef_request_context_handler_capi.h',
'include/capi/cef_request_handler_capi.h',
'include/capi/cef_resource_bundle_handler_capi.h',
'include/capi/cef_resource_handler_capi.h',
......@@ -212,6 +216,10 @@
'libcef_dll/ctocpp/render_process_handler_ctocpp.h',
'libcef_dll/cpptoc/request_cpptoc.cc',
'libcef_dll/cpptoc/request_cpptoc.h',
'libcef_dll/cpptoc/request_context_cpptoc.cc',
'libcef_dll/cpptoc/request_context_cpptoc.h',
'libcef_dll/ctocpp/request_context_handler_ctocpp.cc',
'libcef_dll/ctocpp/request_context_handler_ctocpp.h',
'libcef_dll/ctocpp/request_handler_ctocpp.cc',
'libcef_dll/ctocpp/request_handler_ctocpp.h',
'libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc',
......@@ -370,6 +378,10 @@
'libcef_dll/cpptoc/render_process_handler_cpptoc.h',
'libcef_dll/ctocpp/request_ctocpp.cc',
'libcef_dll/ctocpp/request_ctocpp.h',
'libcef_dll/ctocpp/request_context_ctocpp.cc',
'libcef_dll/ctocpp/request_context_ctocpp.h',
'libcef_dll/cpptoc/request_context_handler_cpptoc.cc',
'libcef_dll/cpptoc/request_context_handler_cpptoc.h',
'libcef_dll/cpptoc/request_handler_cpptoc.cc',
'libcef_dll/cpptoc/request_handler_cpptoc.h',
'libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc',
......
......@@ -264,6 +264,12 @@ typedef struct _cef_browser_host_t {
struct _cef_client_t* (CEF_CALLBACK *get_client)(
struct _cef_browser_host_t* self);
///
// Returns the request context for this browser.
///
struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)(
struct _cef_browser_host_t* self);
///
// Returns the DevTools URL for this browser. If |http_scheme| is true (1) the
// returned URL will use the http scheme instead of the chrome-devtools
......@@ -433,21 +439,24 @@ typedef struct _cef_browser_host_t {
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. All values will be copied internally and the actual window will
// be created on the UI thread. This function can be called on any browser
// process thread and will not block.
// be created on the UI thread. If |request_context| is NULL the global request
// context will be used. This function can be called on any browser process
// thread and will not block.
///
CEF_EXPORT int cef_browser_host_create_browser(
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings);
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
struct _cef_request_context_t* request_context);
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. This function can only be called on the browser process UI
// thread.
// |windowInfo|. If |request_context| is NULL the global request context will be
// used. This function can only be called on the browser process UI thread.
///
CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync(
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
const cef_string_t* url, const struct _cef_browser_settings_t* settings);
const cef_string_t* url, const struct _cef_browser_settings_t* settings,
struct _cef_request_context_t* request_context);
#ifdef __cplusplus
......
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
///
// A request context provides request handling for a set of related browser
// objects. A request context is specified when creating a new browser object
// via the cef_browser_host_t static factory functions. Browser objects with
// different request contexts will never be hosted in the same render process.
// Browser objects with the same request context may or may not be hosted in the
// same render process depending on the process model. Browser objects created
// indirectly via the JavaScript window.open function or targeted links will
// share the same render process and the same request context as the source
// browser. When running in single-process mode there is only a single render
// process (the main process) and so all browsers created in single-process mode
// will share the same request context. This will be the first request context
// passed into a cef_browser_host_t static factory function and all other
// request context objects will be ignored.
///
typedef struct _cef_request_context_t {
///
// Base structure.
///
cef_base_t base;
///
// Returns true (1) if this object is pointing to the same context as |that|
// object.
///
int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self,
struct _cef_request_context_t* other);
///
// Returns true (1) if this object is the global context.
///
int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self);
///
// Returns the handler for this context if any.
///
struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)(
struct _cef_request_context_t* self);
} cef_request_context_t;
///
// Returns the global context object.
///
CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context();
///
// Creates a new context object with the specified handler.
///
CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
struct _cef_request_context_handler_t* handler);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "include/capi/cef_base_capi.h"
///
// Implement this structure to provide handler implementations.
///
typedef struct _cef_request_context_handler_t {
///
// Base structure.
///
cef_base_t base;
///
// Called on the IO thread to retrieve the cookie manager. The global cookie
// manager will be used if this function returns NULL.
///
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
struct _cef_request_context_handler_t* self);
} cef_request_context_handler_t;
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
......@@ -148,16 +148,6 @@ typedef struct _cef_request_handler_t {
struct _cef_browser_t* browser, const cef_string_t* origin_url,
int64 new_size, struct _cef_quota_callback_t* callback);
///
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
// URL of the top-level frame. Cookies managers can be unique per browser or
// shared across multiple browsers. The global cookie manager will be used if
// this function returns NULL.
///
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
struct _cef_request_handler_t* self, struct _cef_browser_t* browser,
const cef_string_t* main_url);
///
// Called on the UI thread to handle requests for URLs with an unknown
// protocol component. Set |allow_os_execution| to true (1) to attempt
......
......@@ -41,6 +41,7 @@
#include "include/cef_base.h"
#include "include/cef_frame.h"
#include "include/cef_process_message.h"
#include "include/cef_request_context.h"
#include <vector>
class CefBrowserHost;
......@@ -224,26 +225,32 @@ class CefBrowserHost : public virtual CefBase {
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. All values will be copied internally and the actual window
// will be created on the UI thread. This method can be called on any browser
// process thread and will not block.
// will be created on the UI thread. If |request_context| is empty the
// global request context will be used. This method can be called on any
// browser process thread and will not block.
///
/*--cef(optional_param=client,optional_param=url)--*/
/*--cef(optional_param=client,optional_param=url,
optional_param=request_context)--*/
static bool CreateBrowser(const CefWindowInfo& windowInfo,
CefRefPtr<CefClient> client,
const CefString& url,
const CefBrowserSettings& settings);
const CefBrowserSettings& settings,
CefRefPtr<CefRequestContext> request_context);
///
// Create a new browser window using the window parameters specified by
// |windowInfo|. This method can only be called on the browser process UI
// |windowInfo|. If |request_context| is empty the global request context
// will be used. This method can only be called on the browser process UI
// thread.
///
/*--cef(optional_param=client,optional_param=url)--*/
/*--cef(optional_param=client,optional_param=url,
optional_param=request_context)--*/
static CefRefPtr<CefBrowser> CreateBrowserSync(
const CefWindowInfo& windowInfo,
CefRefPtr<CefClient> client,
const CefString& url,
const CefBrowserSettings& settings);
const CefBrowserSettings& settings,
CefRefPtr<CefRequestContext> request_context);
///
// Returns the hosted browser object.
......@@ -300,6 +307,12 @@ class CefBrowserHost : public virtual CefBase {
/*--cef()--*/
virtual CefRefPtr<CefClient> GetClient() =0;
///
// Returns the request context for this browser.
///
/*--cef()--*/
virtual CefRefPtr<CefRequestContext> GetRequestContext() =0;
///
// Returns the DevTools URL for this browser. If |http_scheme| is true the
// returned URL will use the http scheme instead of the chrome-devtools
......
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_
#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_
#pragma once
#include "include/cef_request_context_handler.h"
///
// A request context provides request handling for a set of related browser
// objects. A request context is specified when creating a new browser object
// via the CefBrowserHost static factory methods. Browser objects with different
// request contexts will never be hosted in the same render process. Browser
// objects with the same request context may or may not be hosted in the same
// render process depending on the process model. Browser objects created
// indirectly via the JavaScript window.open function or targeted links will
// share the same render process and the same request context as the source
// browser. When running in single-process mode there is only a single render
// process (the main process) and so all browsers created in single-process mode
// will share the same request context. This will be the first request context
// passed into a CefBrowserHost static factory method and all other request
// context objects will be ignored.
///
/*--cef(source=library,no_debugct_check)--*/
class CefRequestContext : public virtual CefBase {
public:
///
// Returns the global context object.
///
/*--cef()--*/
static CefRefPtr<CefRequestContext> GetGlobalContext();
///
// Creates a new context object with the specified handler.
///
/*--cef(optional_param=handler)--*/
static CefRefPtr<CefRequestContext> CreateContext(
CefRefPtr<CefRequestContextHandler> handler);
///
// Returns true if this object is pointing to the same context as |that|
// object.
///
/*--cef()--*/
virtual bool IsSame(CefRefPtr<CefRequestContext> other) =0;
///
// Returns true if this object is the global context.
///
/*--cef()--*/
virtual bool IsGlobal() =0;
///
// Returns the handler for this context if any.
///
/*--cef()--*/
virtual CefRefPtr<CefRequestContextHandler> GetHandler() =0;
};
#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_
#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_
#pragma once
#include "include/cef_base.h"
#include "include/cef_cookie.h"
///
// Implement this interface to provide handler implementations.
///
/*--cef(source=client,no_debugct_check)--*/
class CefRequestContextHandler : public virtual CefBase {
public:
///
// Called on the IO thread to retrieve the cookie manager. The global cookie
// manager will be used if this method returns NULL.
///
/*--cef()--*/
virtual CefRefPtr<CefCookieManager> GetCookieManager() { return NULL; }
};
#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_
......@@ -41,7 +41,6 @@
#include "include/cef_auth_callback.h"
#include "include/cef_base.h"
#include "include/cef_browser.h"
#include "include/cef_cookie.h"
#include "include/cef_frame.h"
#include "include/cef_resource_handler.h"
#include "include/cef_response.h"
......@@ -164,17 +163,6 @@ class CefRequestHandler : public virtual CefBase {
return false;
}
///
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
// URL of the top-level frame. Cookies managers can be unique per browser or
// shared across multiple browsers. The global cookie manager will be used if
// this method returns NULL.
///
/*--cef()--*/
virtual CefRefPtr<CefCookieManager> GetCookieManager(
CefRefPtr<CefBrowser> browser,
const CefString& main_url) { return NULL; }
///
// Called on the UI thread to handle requests for URLs with an unknown
// protocol component. Set |allow_os_execution| to true to attempt execution
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copyright (c) 2013 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_BROWSER_CONTEXT_H_
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_
#pragma once
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "net/url_request/url_request_job_factory.h"
namespace content {
class DownloadManagerDelegate;
class SpeechRecognitionPreferences;
}
class CefDownloadManagerDelegate;
class CefURLRequestContextGetter;
class CefBrowserContext : public content::BrowserContext {
public:
CefBrowserContext();
virtual ~CefBrowserContext();
// BrowserContext methods.
virtual base::FilePath GetPath() const OVERRIDE;
virtual bool IsOffTheRecord() const OVERRIDE;
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
int renderer_child_id) OVERRIDE;
virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE;
virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
int renderer_child_id) OVERRIDE;
virtual net::URLRequestContextGetter*
GetMediaRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory) OVERRIDE;
virtual void RequestMIDISysExPermission(
int render_process_id,
int render_view_id,
const GURL& requesting_frame,
const MIDISysExPermissionCallback& callback) OVERRIDE;
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
virtual content::GeolocationPermissionContext*
GetGeolocationPermissionContext() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers);
net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
virtual net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers) = 0;
virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory,
content::ProtocolHandlerMap* protocol_handlers);
private:
class CefResourceContext;
scoped_ptr<CefResourceContext> resource_context_;
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
scoped_refptr<CefURLRequestContextGetter> url_request_getter_;
scoped_refptr<content::GeolocationPermissionContext>
geolocation_permission_context_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
content::ProtocolHandlerMap* protocol_handlers) = 0;
};
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_context_impl.h"
#include <map>
......@@ -157,7 +157,7 @@ class CefGeolocationPermissionContext
} // namespace