Merge revision 1287 changes:

- Register the net resource provider for render processes (issue #999).

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1453@1288 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-06-24 18:57:58 +00:00
parent b2e67e7431
commit 914811e519
5 changed files with 32 additions and 11 deletions

View File

@ -926,6 +926,8 @@
'libcef/common/http_header_utils.h',
'libcef/common/main_delegate.cc',
'libcef/common/main_delegate.h',
'libcef/common/net_resource_provider.cc',
'libcef/common/net_resource_provider.h',
'libcef/common/process_message_impl.cc',
'libcef/common/process_message_impl.h',
'libcef/common/request_impl.cc',

View File

@ -10,6 +10,7 @@
#include "libcef/browser/browser_message_loop.h"
#include "libcef/browser/context.h"
#include "libcef/browser/devtools_delegate.h"
#include "libcef/common/net_resource_provider.h"
#include "base/bind.h"
#include "base/command_line.h"
@ -19,22 +20,12 @@
#include "content/browser/webui/content_web_ui_controller_factory.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/web_ui_controller_factory.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "net/base/net_module.h"
#include "net/proxy/proxy_resolver_v8.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
namespace {
base::StringPiece ResourceProvider(int resource_id) {
return content::GetContentClient()->GetDataResource(resource_id,
ui::SCALE_FACTOR_NONE);
}
} // namespace
CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts(),
@ -62,7 +53,7 @@ void CefBrowserMainParts::PostMainMessageLoopStart() {
int CefBrowserMainParts::PreCreateThreads() {
PlatformInitialize();
net::NetModule::SetResourceProvider(&ResourceProvider);
net::NetModule::SetResourceProvider(&NetResourceProvider);
// Initialize the GpuDataManager before IO access restrictions are applied and
// before the IO thread is started.

View File

@ -0,0 +1,11 @@
// 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.
#include "libcef/common/net_resource_provider.h"
#include "content/public/common/content_client.h"
base::StringPiece NetResourceProvider(int key) {
return content::GetContentClient()->GetDataResource(key,
ui::SCALE_FACTOR_NONE);
}

View File

@ -0,0 +1,14 @@
// 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_COMMON_NET_RESOURCE_PROVIDER_H_
#define CEF_LIBCEF_COMMON_NET_RESOURCE_PROVIDER_H_
#pragma once
#include "base/string_piece.h"
// This is called indirectly by the network layer to access resources.
base::StringPiece NetResourceProvider(int key);
#endif // CEF_LIBCEF_COMMON_NET_RESOURCE_PROVIDER_H_

View File

@ -5,13 +5,16 @@
#include "libcef/renderer/render_process_observer.h"
#include "libcef/common/cef_messages.h"
#include "libcef/common/net_resource_provider.h"
#include "libcef/renderer/content_renderer_client.h"
#include "net/base/net_module.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
CefRenderProcessObserver::CefRenderProcessObserver() {
net::NetModule::SetResourceProvider(NetResourceProvider);
}
CefRenderProcessObserver::~CefRenderProcessObserver() {