cef/libcef/browser/url_request_context_getter_proxy.cc
Marshall Greenblatt c3bbaac18f - Fix a crash caused by CefBrowserHostImpl being deleted before CefCookieStoreProxy (issue #810).
- Add documentation explaining the relationship between network request processing classes.
- Remove stale code in url_request_context_getter_proxy.cc.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@935 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-12-04 01:12:11 +00:00

40 lines
1.2 KiB
C++

// 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.
#include "libcef/browser/url_request_context_getter_proxy.h"
#include "libcef/browser/thread_util.h"
#include "libcef/browser/url_request_context_getter.h"
#include "libcef/browser/url_request_context_proxy.h"
CefURLRequestContextGetterProxy::CefURLRequestContextGetterProxy(
CefBrowserHostImpl* browser,
CefURLRequestContextGetter* parent)
: browser_(browser),
parent_(parent),
context_proxy_(NULL) {
DCHECK(browser);
DCHECK(parent);
}
CefURLRequestContextGetterProxy::~CefURLRequestContextGetterProxy() {
CEF_REQUIRE_IOT();
if (context_proxy_)
parent_->ReleaseURLRequestContextProxy(context_proxy_);
}
net::URLRequestContext*
CefURLRequestContextGetterProxy::GetURLRequestContext() {
CEF_REQUIRE_IOT();
if (!context_proxy_) {
context_proxy_ = parent_->CreateURLRequestContextProxy();
context_proxy_->Initialize(browser_);
}
return context_proxy_;
}
scoped_refptr<base::SingleThreadTaskRunner>
CefURLRequestContextGetterProxy::GetNetworkTaskRunner() const {
return parent_->GetNetworkTaskRunner();
}