mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-24 07:58:11 +01:00
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:
parent
b2e67e7431
commit
914811e519
@ -926,6 +926,8 @@
|
|||||||
'libcef/common/http_header_utils.h',
|
'libcef/common/http_header_utils.h',
|
||||||
'libcef/common/main_delegate.cc',
|
'libcef/common/main_delegate.cc',
|
||||||
'libcef/common/main_delegate.h',
|
'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.cc',
|
||||||
'libcef/common/process_message_impl.h',
|
'libcef/common/process_message_impl.h',
|
||||||
'libcef/common/request_impl.cc',
|
'libcef/common/request_impl.cc',
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "libcef/browser/browser_message_loop.h"
|
#include "libcef/browser/browser_message_loop.h"
|
||||||
#include "libcef/browser/context.h"
|
#include "libcef/browser/context.h"
|
||||||
#include "libcef/browser/devtools_delegate.h"
|
#include "libcef/browser/devtools_delegate.h"
|
||||||
|
#include "libcef/common/net_resource_provider.h"
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
@ -19,22 +20,12 @@
|
|||||||
#include "content/browser/webui/content_web_ui_controller_factory.h"
|
#include "content/browser/webui/content_web_ui_controller_factory.h"
|
||||||
#include "content/public/browser/gpu_data_manager.h"
|
#include "content/public/browser/gpu_data_manager.h"
|
||||||
#include "content/public/browser/web_ui_controller_factory.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 "content/public/common/content_switches.h"
|
||||||
#include "net/base/net_module.h"
|
#include "net/base/net_module.h"
|
||||||
#include "net/proxy/proxy_resolver_v8.h"
|
#include "net/proxy/proxy_resolver_v8.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
#include "v8/include/v8.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(
|
CefBrowserMainParts::CefBrowserMainParts(
|
||||||
const content::MainFunctionParams& parameters)
|
const content::MainFunctionParams& parameters)
|
||||||
: BrowserMainParts(),
|
: BrowserMainParts(),
|
||||||
@ -62,7 +53,7 @@ void CefBrowserMainParts::PostMainMessageLoopStart() {
|
|||||||
|
|
||||||
int CefBrowserMainParts::PreCreateThreads() {
|
int CefBrowserMainParts::PreCreateThreads() {
|
||||||
PlatformInitialize();
|
PlatformInitialize();
|
||||||
net::NetModule::SetResourceProvider(&ResourceProvider);
|
net::NetModule::SetResourceProvider(&NetResourceProvider);
|
||||||
|
|
||||||
// Initialize the GpuDataManager before IO access restrictions are applied and
|
// Initialize the GpuDataManager before IO access restrictions are applied and
|
||||||
// before the IO thread is started.
|
// before the IO thread is started.
|
||||||
|
11
cef3/libcef/common/net_resource_provider.cc
Normal file
11
cef3/libcef/common/net_resource_provider.cc
Normal 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);
|
||||||
|
}
|
14
cef3/libcef/common/net_resource_provider.h
Normal file
14
cef3/libcef/common/net_resource_provider.h
Normal 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_
|
@ -5,13 +5,16 @@
|
|||||||
|
|
||||||
#include "libcef/renderer/render_process_observer.h"
|
#include "libcef/renderer/render_process_observer.h"
|
||||||
#include "libcef/common/cef_messages.h"
|
#include "libcef/common/cef_messages.h"
|
||||||
|
#include "libcef/common/net_resource_provider.h"
|
||||||
#include "libcef/renderer/content_renderer_client.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/WebString.h"
|
||||||
#include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
|
#include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
|
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
|
||||||
|
|
||||||
CefRenderProcessObserver::CefRenderProcessObserver() {
|
CefRenderProcessObserver::CefRenderProcessObserver() {
|
||||||
|
net::NetModule::SetResourceProvider(NetResourceProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRenderProcessObserver::~CefRenderProcessObserver() {
|
CefRenderProcessObserver::~CefRenderProcessObserver() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user