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
This commit is contained in:
Marshall Greenblatt
2013-09-03 16:43:31 +00:00
parent 935a35f21c
commit 385be456c3
57 changed files with 2288 additions and 440 deletions

View File

@@ -9,6 +9,7 @@
#include <vector>
#include "libcef/browser/browser_context.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/context.h"
#include "libcef/browser/thread_util.h"
#include "libcef/browser/url_request_context_getter.h"
@@ -113,7 +114,7 @@ void CefCookieManagerImpl::SetSupportedSchemes(
// Global changes are handled by the request context.
scoped_refptr<CefURLRequestContextGetter> getter =
static_cast<CefURLRequestContextGetter*>(
_Context->request_context().get());
CefContentBrowserClient::Get()->request_context().get());
std::vector<std::string> scheme_vec;
std::vector<CefString>::const_iterator it = schemes.begin();
@@ -267,7 +268,7 @@ bool CefCookieManagerImpl::SetStoragePath(
// Global path changes are handled by the request context.
scoped_refptr<CefURLRequestContextGetter> getter =
static_cast<CefURLRequestContextGetter*>(
_Context->request_context().get());
CefContentBrowserClient::Get()->request_context().get());
getter->SetCookieStoragePath(new_path, persist_session_cookies);
cookie_monster_ = getter->GetURLRequestContext()->cookie_store()->
GetCookieMonster();
@@ -348,9 +349,9 @@ bool CefCookieManagerImpl::FlushStore(CefRefPtr<CefCompletionHandler> handler) {
void CefCookieManagerImpl::SetGlobal() {
if (CEF_CURRENTLY_ON_IOT()) {
if (_Context->browser_context()) {
cookie_monster_ = _Context->request_context()->GetURLRequestContext()->
cookie_store()->GetCookieMonster();
if (CefContentBrowserClient::Get()->request_context()) {
cookie_monster_ = CefContentBrowserClient::Get()->request_context()->
GetURLRequestContext()->cookie_store()->GetCookieMonster();
DCHECK(cookie_monster_);
}
} else {