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

@ -10,11 +10,13 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_piece.h"
#include "chrome/browser/net/pref_proxy_config_tracker.h"
#include "content/public/browser/browser_main_parts.h"
#include "net/proxy/proxy_config_service.h"
#include "net/url_request/url_request_context_getter.h"
namespace base {
class MessageLoop;
@ -44,18 +46,30 @@ class CefBrowserMainParts : public content::BrowserMainParts {
virtual void PostMainMessageLoopRun() OVERRIDE;
virtual void PostDestroyThreads() OVERRIDE;
CefBrowserContext* browser_context() const { return browser_context_.get(); }
CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_.get(); }
CefBrowserContext* browser_context() const {
return global_browser_context_.get();
}
scoped_refptr<net::URLRequestContextGetter> request_context() const {
return global_request_context_;
}
CefDevToolsDelegate* devtools_delegate() const {
return devtools_delegate_.get();
}
PrefService* pref_service() const { return pref_service_.get(); }
scoped_ptr<net::ProxyConfigService> proxy_config_service() {
return proxy_config_service_.Pass();
}
void AddBrowserContext(CefBrowserContext* context);
void RemoveBrowserContext(CefBrowserContext* context);
private:
void PlatformInitialize();
void PlatformCleanup();
scoped_ptr<CefBrowserContext> browser_context_;
scoped_ptr<CefBrowserContext> global_browser_context_;
scoped_refptr<net::URLRequestContextGetter> global_request_context_;
ScopedVector<CefBrowserContext> browser_contexts_;
scoped_ptr<CefDevToolsDelegate> devtools_delegate_;
scoped_ptr<base::MessageLoop> message_loop_;
scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;