Add initial WebUI support (issue #2037)

- Visit chrome://webui-hosts for the list of supported hosts.
This commit is contained in:
Marshall Greenblatt
2016-11-07 14:14:09 -05:00
parent 659e5af870
commit 18763fde50
25 changed files with 962 additions and 262 deletions

View File

@@ -17,6 +17,7 @@
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/browser/resource_context_impl.h"
#include "content/browser/streams/stream_context.h"
#include "content/browser/webui/url_data_manager.h"
#include "content/public/browser/storage_partition.h"
namespace {
@@ -47,6 +48,10 @@ bool ShouldProxyUserData(const void* key) {
if (key == kFontFamilyCacheKey)
return true;
// If this value is not proxied WebUI will fail to load.
if (key == content::URLDataManager::GetUserDataKey())
return true;
return false;
}
@@ -69,6 +74,14 @@ CefBrowserContextProxy::~CefBrowserContextProxy() {
parent_->RemoveProxy(this);
}
void CefBrowserContextProxy::Initialize() {
CefBrowserContext::Initialize();
// This object's CefResourceContext needs to proxy some UserData requests to
// the parent object's CefResourceContext.
resource_context()->set_parent(parent_->resource_context());
}
base::SupportsUserData::Data*
CefBrowserContextProxy::GetUserData(const void* key) const {
if (ShouldProxyUserData(key))