Add component build support (issue #1617)

This commit is contained in:
Marshall Greenblatt 2017-07-06 16:39:37 -04:00
parent c080187908
commit b216f427f6
17 changed files with 325 additions and 144 deletions

106
BUILD.gn
View File

@ -145,10 +145,6 @@ if (is_clang) {
assert(!clang_use_chrome_plugins)
}
# CEF does not currently support component builds. See
# https://bitbucket.org/chromiumembedded/cef/issues/1617
assert(!is_component_build)
if (is_mac) {
# Always generate dSYM files. The make_distrib script will fail if
# enable_dsyms=true is not explicitly set when is_official_build=false.
@ -244,6 +240,84 @@ config("libcef_static_config") {
]
}
# Target for building code that accesses Blink internals. Included from the
# //third_party/WebKit/Source/web target.
source_set("webkit_set") {
sources = [
"libcef/renderer/webkit_glue.cc",
"libcef/renderer/webkit_glue.h",
]
configs += [
":libcef_static_config",
"//build/config:precompiled_headers",
# Blink-internal include paths.
"//third_party/WebKit/Source/core:core_include_dirs",
]
include_dirs = [
# Blink code uses paths relative to these directories. We need them because
# we include Blink headers.
"//third_party/WebKit",
"//third_party/WebKit/public/platform",
"//third_party/WebKit/public/web",
"//third_party/WebKit/Source",
"$root_gen_dir/blink",
"$root_gen_dir/third_party/WebKit",
]
defines = [
# Blink-internal defines.
"BLINK_IMPLEMENTATION=1",
"BLINK_WEB_IMPLEMENTATION=1",
"INSIDE_BLINK",
]
deps = [
"//skia",
"//third_party/icu",
"//v8",
]
}
if (is_win) {
# Target for building code that accesses chrome_elf internals. Included from
# the //chrome_elf:crash target. Defined as a static_library instead of a
# source_set because (a) the source files don't export any symbols and (b)
# *_switches.cc duplication otherwise causes linker errors.
static_library("chrome_elf_set") {
sources = [
"libcef/common/crash_reporter_client.cc",
"libcef/common/crash_reporter_client.h",
# Required for crash_keys::GetChromeCrashKeys.
# Otherwise we need to copy this array into CEF, which would be difficult
# to maintain.
"//chrome/common/crash_keys.cc",
"//chrome/common/chrome_switches.cc",
"//components/flags_ui/flags_ui_switches.cc",
"//content/public/common/content_switches.cc",
]
configs += [
":libcef_static_config",
"//build/config:precompiled_headers",
]
if (is_component_build) {
# Avoid linker errors with content_switches.cc in component build by not
# defining CONTENT_EXPORT.
defines = ["COMPILE_CONTENT_STATICALLY"]
}
deps = [
"//components/crash/core/common", # crash_keys
"//gpu/config:crash_keys",
]
}
}
static_library("libcef_static") {
sources = gypi_paths2.includes_common +
gypi_paths.autogen_cpp_includes + [
@ -552,6 +626,8 @@ static_library("libcef_static") {
"libcef/renderer/plugins/plugin_preroller.h",
"libcef/renderer/render_frame_observer.cc",
"libcef/renderer/render_frame_observer.h",
"libcef/renderer/render_frame_util.cc",
"libcef/renderer/render_frame_util.h",
"libcef/renderer/render_message_filter.cc",
"libcef/renderer/render_message_filter.h",
"libcef/renderer/render_thread_observer.cc",
@ -561,8 +637,6 @@ static_library("libcef_static") {
"libcef/renderer/thread_util.h",
"libcef/renderer/v8_impl.cc",
"libcef/renderer/v8_impl.h",
"libcef/renderer/webkit_glue.cc",
"libcef/renderer/webkit_glue.h",
"libcef/utility/content_utility_client.cc",
"libcef/utility/content_utility_client.h",
@ -578,9 +652,6 @@ static_library("libcef_static") {
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
# Blink-internal include paths.
"//third_party/WebKit/Source/core:core_include_dirs",
]
public_configs = [
@ -588,11 +659,6 @@ static_library("libcef_static") {
]
include_dirs = [
# Blink code uses paths relative to these directories. We need them because
# we include Blink headers.
"//third_party/WebKit/public/platform",
"//third_party/WebKit/public/web",
# Crashpad code uses paths relative to this directory.
"//third_party/crashpad/crashpad",
]
@ -651,6 +717,7 @@ static_library("libcef_static") {
"//components/visitedlink/browser",
"//components/visitedlink/common",
"//components/visitedlink/renderer",
"//components/viz/display_compositor",
"//components/web_cache/renderer",
"//content/public/app:both",
"//content/public/browser",
@ -680,6 +747,9 @@ static_library("libcef_static") {
"//pdf",
"//ppapi/features",
"//printing/features",
"//services/service_manager/embedder",
"//services/service_manager/public/interfaces",
"//services/service_manager/runner/common",
"//skia",
"//storage/browser",
"//third_party/brotli:dec",
@ -739,6 +809,14 @@ static_library("libcef_static") {
deps += [
"//chrome_elf",
]
if (is_component_build) {
deps += [ "//content:sandbox_helper_win" ]
}
libs = [
"comctl32.lib",
]
}
if (is_linux) {

View File

@ -11,7 +11,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "content/browser/devtools/grit/devtools_resources_map.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/common/url_constants.h"
namespace scheme {
@ -32,15 +32,9 @@ class Delegate : public InternalHandlerDelegate {
if (path.length() > 0)
path = path.substr(1);
for (size_t i = 0; i < kDevtoolsResourcesSize; ++i) {
if (base::EqualsCaseInsensitiveASCII(kDevtoolsResources[i].name,
path.c_str())) {
action->resource_id = kDevtoolsResources[i].value;
return true;
}
}
return false;
action->string_piece =
content::DevToolsFrontendHost::GetFrontendResource(path);
return !action->string_piece.empty();
}
};

View File

@ -140,20 +140,23 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
if (action.mime_type.empty())
action.mime_type = GetMimeType(url.path());
if (action.resource_id >= 0) {
base::StringPiece piece = CefContentClient::Get()->GetDataResource(
if (action.string_piece.empty() && action.resource_id >= 0) {
action.string_piece = CefContentClient::Get()->GetDataResource(
action.resource_id, ui::SCALE_FACTOR_NONE);
if (!piece.empty()) {
action.stream = CefStreamReader::CreateForData(
const_cast<char*>(piece.data()), piece.size());
action.stream_size = piece.size();
} else {
if (action.string_piece.empty()) {
NOTREACHED() << "Failed to load internal resource for id: "
<< action.resource_id << " URL: " << url.spec().c_str();
return NULL;
}
}
if (!action.string_piece.empty()) {
action.stream = CefStreamReader::CreateForData(
const_cast<char*>(action.string_piece.data()),
action.string_piece.size());
action.stream_size = action.string_piece.size();
}
if (action.stream.get()) {
return new InternalHandler(action.mime_type, action.stream,
action.stream_size);

View File

@ -7,7 +7,10 @@
#pragma once
#include <string>
#include "include/cef_scheme.h"
#include "base/strings/string_piece.h"
#include "url/gurl.h"
namespace scheme {
@ -28,11 +31,13 @@ class InternalHandlerDelegate {
CefRefPtr<CefStreamReader> stream;
int stream_size;
// Option 2: Specify a resource id to load static content. May include an
// optional encoding type.
// Option 2: Provide a base::StringPiece for the resource contents.
base::StringPiece string_piece;
// Option 3: Specify a resource id to load static content.
int resource_id;
// Option 3: Redirect to the specified URL.
// Option 4: Redirect to the specified URL.
GURL redirect_url;
};

View File

@ -15,6 +15,7 @@
#include "libcef/common/response_manager.h"
#include "libcef/renderer/content_renderer_client.h"
#include "libcef/renderer/dom_document_impl.h"
#include "libcef/renderer/render_frame_util.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/webkit_glue.h"
@ -194,7 +195,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
const std::string& searchname = name;
for (WebFrame* cur_frame = web_view->MainFrame(); cur_frame;
cur_frame = cur_frame->TraverseNext()) {
if (webkit_glue::GetUniqueName(cur_frame) == searchname) {
if (render_frame_util::GetUniqueName(cur_frame) == searchname) {
frame = cur_frame;
break;
}
@ -231,7 +232,7 @@ void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
if (render_view()->GetWebView()) {
for (WebFrame* frame = render_view()->GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
identifiers.push_back(webkit_glue::GetIdentifier(frame));
identifiers.push_back(render_frame_util::GetIdentifier(frame));
}
}
}
@ -245,7 +246,7 @@ void CefBrowserImpl::GetFrameNames(std::vector<CefString>& names) {
if (render_view()->GetWebView()) {
for (WebFrame* frame = render_view()->GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
names.push_back(webkit_glue::GetUniqueName(frame));
names.push_back(render_frame_util::GetUniqueName(frame));
}
}
}
@ -314,7 +315,7 @@ bool CefBrowserImpl::SendProcessMessage(CefProcessId target_process,
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
blink::WebFrame* frame) {
DCHECK(frame);
int64_t frame_id = webkit_glue::GetIdentifier(frame);
int64_t frame_id = render_frame_util::GetIdentifier(frame);
// Frames are re-used between page loads. Only add the frame to the map once.
FrameMap::const_iterator it = frames_.find(frame_id);
@ -324,11 +325,12 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
CefRefPtr<CefFrameImpl> framePtr(new CefFrameImpl(this, frame));
frames_.insert(std::make_pair(frame_id, framePtr));
const int64_t parent_id = frame->Parent() == NULL
? webkit_glue::kInvalidFrameId
: webkit_glue::GetIdentifier(frame->Parent());
const int64_t parent_id =
frame->Parent() == NULL
? webkit_glue::kInvalidFrameId
: render_frame_util::GetIdentifier(frame->Parent());
const base::string16& name =
base::UTF8ToUTF16(webkit_glue::GetUniqueName(frame));
base::UTF8ToUTF16(render_frame_util::GetUniqueName(frame));
// Notify the browser that the frame has been identified.
Send(new CefHostMsg_FrameIdentified(routing_id(), frame_id, parent_id, name));
@ -352,7 +354,7 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
// Check if the frame exists but we don't know about it yet.
for (WebFrame* frame = render_view()->GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (webkit_glue::GetIdentifier(frame) == frame_id)
if (render_frame_util::GetIdentifier(frame) == frame_id)
return GetWebFrameImpl(frame);
}
}
@ -411,9 +413,10 @@ void CefBrowserImpl::DidStopLoading() {
void CefBrowserImpl::DidFinishLoad(blink::WebLocalFrame* frame) {
blink::WebDataSource* ds = frame->DataSource();
Send(new CefHostMsg_DidFinishLoad(
routing_id(), webkit_glue::GetIdentifier(frame), ds->GetRequest().Url(),
!frame->Parent(), ds->GetResponse().HttpStatusCode()));
Send(new CefHostMsg_DidFinishLoad(routing_id(),
render_frame_util::GetIdentifier(frame),
ds->GetRequest().Url(), !frame->Parent(),
ds->GetResponse().HttpStatusCode()));
OnLoadEnd(frame);
}
@ -433,7 +436,7 @@ void CefBrowserImpl::DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
}
void CefBrowserImpl::FrameDetached(WebFrame* frame) {
int64_t frame_id = webkit_glue::GetIdentifier(frame);
int64_t frame_id = render_frame_util::GetIdentifier(frame);
if (!frames_.empty()) {
// Remove the frame from the map.

View File

@ -17,6 +17,7 @@
#include "libcef/common/request_impl.h"
#include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/dom_document_impl.h"
#include "libcef/renderer/render_frame_util.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/v8_impl.h"
#include "libcef/renderer/webkit_glue.h"
@ -37,7 +38,7 @@ using blink::WebString;
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame)
: browser_(browser),
frame_(frame),
frame_id_(webkit_glue::GetIdentifier(frame)) {}
frame_id_(render_frame_util::GetIdentifier(frame)) {}
CefFrameImpl::~CefFrameImpl() {}
@ -189,7 +190,7 @@ CefString CefFrameImpl::GetName() {
CEF_REQUIRE_RT_RETURN(name);
if (frame_)
name = webkit_glue::GetUniqueName(frame_);
name = render_frame_util::GetUniqueName(frame_);
return name;
}

View File

@ -4,10 +4,6 @@
#include "base/compiler_specific.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "platform/ScriptForbiddenScope.h"
MSVC_POP_WARNING();
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN)
#pragma warning(push)
@ -20,6 +16,7 @@ MSVC_POP_WARNING();
#include "libcef/common/content_client.h"
#include "libcef/renderer/content_renderer_client.h"
#include "libcef/renderer/v8_impl.h"
#include "libcef/renderer/webkit_glue.h"
#include "content/public/renderer/render_frame.h"
#include "third_party/WebKit/public/web/WebKit.h"
@ -125,7 +122,7 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
// The released context should not be used for script execution.
// Depending on how the context is released this may or may not already
// be set.
blink::ScriptForbiddenScope forbidScript;
webkit_glue::CefScriptForbiddenScope forbidScript;
CefRefPtr<CefV8Context> contextPtr(
new CefV8ContextImpl(isolate, context));

View File

@ -0,0 +1,35 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2011 The Chromium 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/renderer/render_frame_util.h"
#include "libcef/renderer/webkit_glue.h"
#include "base/logging.h"
#include "content/renderer/render_frame_impl.h"
namespace render_frame_util {
int64_t GetIdentifier(blink::WebFrame* frame) {
// Each WebFrame will have an associated RenderFrame. The RenderFrame
// routing IDs are unique within a given renderer process.
content::RenderFrame* render_frame =
content::RenderFrame::FromWebFrame(frame);
DCHECK(render_frame);
if (render_frame)
return render_frame->GetRoutingID();
return webkit_glue::kInvalidFrameId;
}
std::string GetUniqueName(blink::WebFrame* frame) {
content::RenderFrameImpl* render_frame =
content::RenderFrameImpl::FromWebFrame(frame);
DCHECK(render_frame);
if (render_frame)
return render_frame->unique_name();
return std::string();
}
} // render_frame_util

View File

@ -0,0 +1,24 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2011 The Chromium 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_RENDERER_RENDER_FRAME_UTIL_H_
#define CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_
#include <stdint.h>
#include <string>
namespace blink {
class WebFrame;
}
namespace render_frame_util {
int64_t GetIdentifier(blink::WebFrame* frame);
std::string GetUniqueName(blink::WebFrame* frame);
} // render_frame_util
#endif // CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_

View File

@ -25,6 +25,7 @@
#include "libcef/common/task_runner_impl.h"
#include "libcef/common/tracker.h"
#include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/render_frame_util.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/webkit_glue.h"
@ -897,7 +898,7 @@ CefRefPtr<CefFrame> CefV8ContextImpl::GetFrame() {
if (webframe) {
CefRefPtr<CefBrowserImpl> browser =
CefBrowserImpl::GetBrowserForMainFrame(webframe->Top());
frame = browser->GetFrame(webkit_glue::GetIdentifier(webframe));
frame = browser->GetFrame(render_frame_util::GetIdentifier(webframe));
}
return frame;

View File

@ -3,16 +3,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// MSVC++ requires this to be set before any other includes to get M_PI.
// Otherwise there will be compile errors in wtf/MathExtras.h.
#define _USE_MATH_DEFINES
// Defines required to access Blink internals (unwrap WebNode).
#undef BLINK_IMPLEMENTATION
#define BLINK_IMPLEMENTATION 1
#undef INSIDE_BLINK
#define INSIDE_BLINK 1
#include "libcef/renderer/webkit_glue.h"
#include "base/compiler_specific.h"
@ -32,6 +22,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h"
#include "third_party/WebKit/Source/core/frame/LocalFrame.h"
#include "third_party/WebKit/Source/core/frame/Settings.h"
#include "third_party/WebKit/Source/platform/ScriptForbiddenScope.h"
#include "third_party/WebKit/Source/platform/bindings/V8Binding.h"
#include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h"
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
@ -40,7 +31,6 @@ MSVC_POP_WARNING();
#undef LOG
#include "base/logging.h"
#include "content/renderer/render_frame_impl.h"
namespace webkit_glue {
@ -128,26 +118,6 @@ bool SetNodeValue(blink::WebNode& node, const blink::WebString& value) {
return true;
}
int64_t GetIdentifier(blink::WebFrame* frame) {
// Each WebFrame will have an associated RenderFrame. The RenderFrame
// routing IDs are unique within a given renderer process.
content::RenderFrame* render_frame =
content::RenderFrame::FromWebFrame(frame);
DCHECK(render_frame);
if (render_frame)
return render_frame->GetRoutingID();
return kInvalidFrameId;
}
std::string GetUniqueName(blink::WebFrame* frame) {
content::RenderFrameImpl* render_frame =
content::RenderFrameImpl::FromWebFrame(frame);
DCHECK(render_frame);
if (render_frame)
return render_frame->unique_name();
return std::string();
}
v8::MaybeLocal<v8::Value> CallV8Function(v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
@ -235,4 +205,12 @@ void RegisterURLSchemeAsCORSEnabled(const blink::WebString& scheme) {
blink::SchemeRegistry::RegisterURLSchemeAsCORSEnabled(scheme);
}
struct CefScriptForbiddenScope::Impl {
blink::ScriptForbiddenScope scope_;
};
CefScriptForbiddenScope::CefScriptForbiddenScope() : impl_(new Impl()) {}
CefScriptForbiddenScope::~CefScriptForbiddenScope() {}
} // webkit_glue

View File

@ -8,10 +8,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include "include/internal/cef_types.h"
#include "third_party/WebKit/Source/platform/loader/fetch/AccessControlStatus.h"
#include "third_party/WebKit/public/platform/WebCommon.h"
#include "v8/include/v8.h"
namespace blink {
@ -24,35 +27,34 @@ class WebView;
namespace webkit_glue {
extern const int64_t kInvalidFrameId;
BLINK_EXPORT extern const int64_t kInvalidFrameId;
bool CanGoBack(blink::WebView* view);
bool CanGoForward(blink::WebView* view);
void GoBack(blink::WebView* view);
void GoForward(blink::WebView* view);
BLINK_EXPORT bool CanGoBack(blink::WebView* view);
BLINK_EXPORT bool CanGoForward(blink::WebView* view);
BLINK_EXPORT void GoBack(blink::WebView* view);
BLINK_EXPORT void GoForward(blink::WebView* view);
// Returns the text of the document element.
std::string DumpDocumentText(blink::WebFrame* frame);
BLINK_EXPORT std::string DumpDocumentText(blink::WebFrame* frame);
// Expose additional actions on WebNode.
cef_dom_node_type_t GetNodeType(const blink::WebNode& node);
blink::WebString GetNodeName(const blink::WebNode& node);
blink::WebString CreateNodeMarkup(const blink::WebNode& node);
bool SetNodeValue(blink::WebNode& node, const blink::WebString& value);
BLINK_EXPORT cef_dom_node_type_t GetNodeType(const blink::WebNode& node);
BLINK_EXPORT blink::WebString GetNodeName(const blink::WebNode& node);
BLINK_EXPORT blink::WebString CreateNodeMarkup(const blink::WebNode& node);
BLINK_EXPORT bool SetNodeValue(blink::WebNode& node,
const blink::WebString& value);
int64_t GetIdentifier(blink::WebFrame* frame);
std::string GetUniqueName(blink::WebFrame* frame);
BLINK_EXPORT bool IsTextControlElement(const blink::WebElement& element);
bool IsTextControlElement(const blink::WebElement& element);
BLINK_EXPORT v8::MaybeLocal<v8::Value> CallV8Function(
v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
int argc,
v8::Local<v8::Value> args[],
v8::Isolate* isolate);
v8::MaybeLocal<v8::Value> CallV8Function(v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
int argc,
v8::Local<v8::Value> args[],
v8::Isolate* isolate);
v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
BLINK_EXPORT v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::WebString& source,
const blink::WebString& source_url,
int start_line,
@ -61,11 +63,25 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
v8::TryCatch& tryCatch,
blink::AccessControlStatus accessControlStatus);
bool IsScriptForbidden();
BLINK_EXPORT bool IsScriptForbidden();
void RegisterURLSchemeAsLocal(const blink::WebString& scheme);
void RegisterURLSchemeAsSecure(const blink::WebString& scheme);
void RegisterURLSchemeAsCORSEnabled(const blink::WebString& scheme);
BLINK_EXPORT void RegisterURLSchemeAsLocal(const blink::WebString& scheme);
BLINK_EXPORT void RegisterURLSchemeAsSecure(const blink::WebString& scheme);
BLINK_EXPORT void RegisterURLSchemeAsCORSEnabled(
const blink::WebString& scheme);
// Wrapper for blink::ScriptForbiddenScope.
class BLINK_EXPORT CefScriptForbiddenScope final {
public:
CefScriptForbiddenScope();
~CefScriptForbiddenScope();
private:
struct Impl;
std::unique_ptr<Impl> impl_;
DISALLOW_COPY_AND_ASSIGN(CefScriptForbiddenScope);
};
} // webkit_glue

View File

@ -33,6 +33,11 @@ patches = [
# https://bugs.chromium.org/p/chromium/issues/detail?id=634788
'name': 'gn_config',
},
{
# Support component builds (GN is_component_build=true).
# https://bitbucket.org/chromiumembedded/cef/issues/1617
'name': 'component_build_1617',
},
{
# Support loading of password protected zip archives.
# https://bitbucket.org/chromiumembedded/cef/issues/496

View File

@ -0,0 +1,47 @@
diff --git content/app/content_service_manager_main_delegate.h content/app/content_service_manager_main_delegate.h
index c0fd31d..9e95dbb 100644
--- content/app/content_service_manager_main_delegate.h
+++ content/app/content_service_manager_main_delegate.h
@@ -16,7 +16,8 @@ namespace content {
class ContentMainRunner;
-class ContentServiceManagerMainDelegate : public service_manager::MainDelegate {
+class CONTENT_EXPORT ContentServiceManagerMainDelegate :
+ public service_manager::MainDelegate {
public:
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
~ContentServiceManagerMainDelegate() override;
diff --git content/browser/frame_host/debug_urls.h content/browser/frame_host/debug_urls.h
index 413cd0f..bab8a6d 100644
--- content/browser/frame_host/debug_urls.h
+++ content/browser/frame_host/debug_urls.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_BROWSER_FRAME_HOST_DEBUG_URLS_H_
#define CONTENT_BROWSER_FRAME_HOST_DEBUG_URLS_H_
+#include "content/common/content_export.h"
#include "ui/base/page_transition_types.h"
class GURL;
@@ -19,7 +20,7 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition);
// renderer process, such as one that crashes or hangs the renderer, or a
// javascript: URL that operates on the current page in the renderer. Such URLs
// do not represent actual navigations and can be loaded in any SiteInstance.
-bool IsRendererDebugURL(const GURL& url);
+CONTENT_EXPORT bool IsRendererDebugURL(const GURL& url);
} // namespace content
diff --git third_party/WebKit/Source/web/BUILD.gn third_party/WebKit/Source/web/BUILD.gn
index 4424844..f72486f 100644
--- third_party/WebKit/Source/web/BUILD.gn
+++ third_party/WebKit/Source/web/BUILD.gn
@@ -15,6 +15,7 @@ component("web") {
output_name = "blink_web"
deps = [
+ "//cef:webkit_set",
"//skia",
"//third_party/WebKit/Source/core",
"//third_party/WebKit/Source/modules",

View File

@ -113,7 +113,7 @@ index 93fb0b0..3e543d2 100644
// on the given |command_line|.
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index c8197e9..21ad726 100644
index c8197e9..06adc24 100644
--- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@ -124,7 +124,7 @@ index c8197e9..21ad726 100644
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
@@ -137,16 +138,40 @@ static_library("blacklist") {
@@ -137,16 +138,15 @@ static_library("blacklist") {
static_library("crash") {
sources = [
@ -134,31 +134,6 @@ index c8197e9..21ad726 100644
"crash/crash_helper.cc",
"crash/crash_helper.h",
]
+
+ if (enable_cef) {
+ sources += [
+ "//cef/libcef/common/crash_reporter_client.cc",
+ "//cef/libcef/common/crash_reporter_client.h",
+
+ # Required for crash_keys::GetChromeCrashKeys.
+ # Otherwise we need to copy this array into CEF, which would be difficult
+ # to maintain.
+ "//chrome/common/crash_keys.cc",
+ "//chrome/common/chrome_switches.cc",
+ "//components/flags_ui/flags_ui_switches.cc",
+ "//content/public/common/content_switches.cc",
+ "//gpu/config/gpu_crash_keys.cc",
+ ]
+ include_dirs = [
+ "//cef",
+ ]
+ } else {
+ sources += [
+ "//chrome/app/chrome_crash_reporter_client_win.cc",
+ "//chrome/app/chrome_crash_reporter_client_win.h",
+ "//chrome/common/chrome_result_codes.h",
+ ]
+ }
+
deps = [
":hook_util",
@ -168,6 +143,24 @@ index c8197e9..21ad726 100644
"//chrome/install_static:install_static_util",
"//components/crash/content/app:app",
"//components/crash/core/common", # crash_keys
@@ -154,6 +154,17 @@ static_library("crash") {
"//content/public/common:result_codes",
"//third_party/crashpad/crashpad/client:client", # DumpWithoutCrash
]
+
+ if (enable_cef) {
+ deps += [ "//cef:chrome_elf_set" ]
+ include_dirs = [ "//cef" ]
+ } else {
+ sources += [
+ "//chrome/app/chrome_crash_reporter_client_win.cc",
+ "//chrome/app/chrome_crash_reporter_client_win.h",
+ "//chrome/common/chrome_result_codes.h",
+ ]
+ }
}
static_library("hook_util") {
diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc
index c658fa9..8c4a145 100644
--- chrome_elf/crash/crash_helper.cc

View File

@ -62,14 +62,14 @@ index 141a083..b16b4d6 100644
ResourceContext* resource_context = browser_context->GetResourceContext();
diff --git content/browser/resource_context_impl.h content/browser/resource_context_impl.h
index 903cc54..56ee4ea 100644
index 903cc54..5bd30ae 100644
--- content/browser/resource_context_impl.h
+++ content/browser/resource_context_impl.h
@@ -28,6 +28,8 @@ CONTENT_EXPORT StreamContext* GetStreamContextForResourceContext(
URLDataManagerBackend* GetURLDataManagerForResourceContext(
ResourceContext* context);
+const void* GetURLDataManagerBackendUserDataKey();
+CONTENT_EXPORT const void* GetURLDataManagerBackendUserDataKey();
+
// Initialize the above data on the ResourceContext from a given BrowserContext.
CONTENT_EXPORT void InitializeResourceContext(BrowserContext* browser_context);

View File

@ -197,6 +197,11 @@ def GetRecommendedDefaultArgs():
result = {
# Enable NaCL. Default is true. False is recommended for faster builds.
'enable_nacl': False,
# Disable component builds. Default depends on the platform. True results
# in faster local builds but False is required to create a CEF binary
# distribution.
'is_component_build': False,
}
if platform == 'linux':
@ -236,10 +241,6 @@ def GetRequiredArgs():
# Enable support for Widevine CDM.
'enable_widevine': True,
# CEF does not currently support component builds. See
# https://bitbucket.org/chromiumembedded/cef/issues/1617
'is_component_build': False,
}
if platform == 'linux' or platform == 'macosx':