mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 0bfd25d4 (#381305)
- Delete include/cef_runnable.h (issue #1336). - Build the cef_unittests target using all Chromium headers. Add a USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests target to support this. This change avoids compile errors due to the divergence of CEF and Chromium base/ header implementations. The libcef_dll_wrapper sources must now compile successfully with both CEF and Chromium base/ headers (issue #1632). - The onbeforeunload message specified via JavaScript is no longer passed to the client (see http://crbug.com/587940).
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "third_party/WebKit/public/web/WebDataSource.h"
|
||||
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
|
||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebNode.h"
|
||||
#include "third_party/WebKit/public/web/WebScriptSource.h"
|
||||
@ -595,8 +596,11 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
||||
DCHECK(!command.empty());
|
||||
|
||||
if (base::LowerCaseEqualsASCII(command, "getsource")) {
|
||||
response = web_frame->contentAsMarkup().utf8();
|
||||
success = true;
|
||||
if (web_frame->isWebLocalFrame()) {
|
||||
response = blink::WebFrameContentDumper::dumpAsMarkup(
|
||||
web_frame->toWebLocalFrame()).utf8();
|
||||
success = true;
|
||||
}
|
||||
} else if (base::LowerCaseEqualsASCII(command, "gettext")) {
|
||||
response = webkit_glue::DumpDocumentText(web_frame);
|
||||
success = true;
|
||||
|
@ -7,6 +7,14 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(push)
|
||||
#pragma warning(default:4996)
|
||||
#endif
|
||||
|
||||
#include "libcef/browser/context.h"
|
||||
#include "libcef/common/cef_messages.h"
|
||||
#include "libcef/common/cef_switches.h"
|
||||
@ -497,7 +505,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
|
||||
|
||||
GURL url(params.url);
|
||||
CefViewHostMsg_GetPluginInfo_Output output;
|
||||
blink::WebString top_origin = frame->top()->securityOrigin().toString();
|
||||
blink::WebString top_origin = frame->top()->getSecurityOrigin().toString();
|
||||
render_frame->Send(new CefViewHostMsg_GetPluginInfo(
|
||||
render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin),
|
||||
orig_mime_type, &output));
|
||||
@ -888,3 +896,9 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
|
||||
if (!CefContext::Get()->settings().multi_threaded_message_loop)
|
||||
delete host;
|
||||
}
|
||||
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@ -82,7 +82,8 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
|
||||
// in an extension process (other than the Chrome Web Store), we want to
|
||||
// keep it in process to allow the opener to script it.
|
||||
blink::WebDocument opener_document = opener_frame->document();
|
||||
blink::WebSecurityOrigin opener_origin = opener_document.securityOrigin();
|
||||
blink::WebSecurityOrigin opener_origin =
|
||||
opener_document.getSecurityOrigin();
|
||||
bool opener_is_extension_url = !opener_origin.isUnique() &&
|
||||
extension_registry->GetExtensionOrAppByURL(
|
||||
opener_document.url()) != nullptr;
|
||||
|
@ -4,6 +4,14 @@
|
||||
|
||||
#include "libcef/renderer/frame_impl.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(push)
|
||||
#pragma warning(default:4996)
|
||||
#endif
|
||||
|
||||
#include "libcef/common/cef_messages.h"
|
||||
#include "libcef/common/net/http_header_utils.h"
|
||||
#include "libcef/common/request_impl.h"
|
||||
@ -18,6 +26,7 @@
|
||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
|
||||
#include "third_party/WebKit/public/web/WebKit.h"
|
||||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
#include "third_party/WebKit/public/web/WebScriptSource.h"
|
||||
@ -88,9 +97,10 @@ void CefFrameImpl::ViewSource() {
|
||||
|
||||
void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
|
||||
if (frame_) {
|
||||
CefString content = std::string(frame_->contentAsMarkup().utf8());
|
||||
if (frame_ && frame_->isWebLocalFrame()) {
|
||||
const CefString& content =
|
||||
std::string(blink::WebFrameContentDumper::dumpAsMarkup(
|
||||
frame_->toWebLocalFrame()).utf8());
|
||||
visitor->Visit(content);
|
||||
}
|
||||
}
|
||||
@ -99,7 +109,7 @@ void CefFrameImpl::GetText(CefRefPtr<CefStringVisitor> visitor) {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
|
||||
if (frame_) {
|
||||
CefString content = webkit_glue::DumpDocumentText(frame_);
|
||||
const CefString& content = webkit_glue::DumpDocumentText(frame_);
|
||||
visitor->Visit(content);
|
||||
}
|
||||
}
|
||||
@ -270,3 +280,9 @@ void CefFrameImpl::Detach() {
|
||||
browser_ = NULL;
|
||||
frame_ = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ static void AddPepperBasedWidevine(
|
||||
}
|
||||
|
||||
cdm::AddWidevineWithCodecs(
|
||||
cdm::WIDEVINE, supported_codecs,
|
||||
supported_codecs,
|
||||
media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
|
||||
media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
|
||||
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "chrome/renderer/custom_menu_commands.h"
|
||||
#include "components/content_settings/content/common/content_settings_messages.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/context_menu_params.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
@ -178,7 +179,8 @@ void CefPluginPlaceholder::PluginListChanged() {
|
||||
|
||||
CefViewHostMsg_GetPluginInfo_Output output;
|
||||
std::string mime_type(GetPluginParams().mimeType.utf8());
|
||||
blink::WebString top_origin = GetFrame()->top()->securityOrigin().toString();
|
||||
blink::WebString top_origin =
|
||||
GetFrame()->top()->getSecurityOrigin().toString();
|
||||
render_frame()->Send(
|
||||
new CefViewHostMsg_GetPluginInfo(routing_id(),
|
||||
GURL(GetPluginParams().url),
|
||||
|
@ -7,10 +7,14 @@
|
||||
|
||||
#include "config.h"
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "bindings/core/v8/V8RecursionScope.h"
|
||||
#include "platform/ScriptForbiddenScope.h"
|
||||
MSVC_POP_WARNING();
|
||||
#undef FROM_HERE
|
||||
#undef LOG
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(push)
|
||||
#pragma warning(default:4996)
|
||||
#endif
|
||||
|
||||
#include "libcef/renderer/render_frame_observer.h"
|
||||
|
||||
@ -53,7 +57,8 @@ void CefRenderFrameObserver::DidCreateScriptContext(
|
||||
v8::Isolate* isolate = blink::mainThreadIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Context::Scope scope(context);
|
||||
blink::V8RecursionScope recursion_scope(isolate);
|
||||
v8::MicrotasksScope microtasks_scope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
|
||||
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context));
|
||||
|
||||
@ -94,3 +99,9 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
|
||||
|
||||
CefV8ReleaseContext(context);
|
||||
}
|
||||
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@ -20,8 +20,6 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "bindings/core/v8/ScriptController.h"
|
||||
#include "bindings/core/v8/V8Binding.h"
|
||||
MSVC_POP_WARNING();
|
||||
#undef FROM_HERE
|
||||
#undef LOG
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
#if defined(OS_WIN)
|
||||
@ -945,11 +943,8 @@ bool CefV8Context::InContext() {
|
||||
|
||||
CefV8ContextImpl::CefV8ContextImpl(v8::Isolate* isolate,
|
||||
v8::Local<v8::Context> context)
|
||||
: handle_(new Handle(isolate, context, context))
|
||||
#ifndef NDEBUG
|
||||
, enter_count_(0)
|
||||
#endif
|
||||
{ // NOLINT(whitespace/braces)
|
||||
: handle_(new Handle(isolate, context, context)),
|
||||
enter_count_(0) {
|
||||
}
|
||||
|
||||
CefV8ContextImpl::~CefV8ContextImpl() {
|
||||
@ -1019,11 +1014,15 @@ bool CefV8ContextImpl::Enter() {
|
||||
v8::Isolate* isolate = handle_->isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
|
||||
blink::V8PerIsolateData::from(isolate)->incrementRecursionLevel();
|
||||
handle_->GetNewV8Handle()->Enter();
|
||||
#ifndef NDEBUG
|
||||
if (!microtasks_scope_) {
|
||||
// Increment the MicrotasksScope recursion level.
|
||||
microtasks_scope_.reset(
|
||||
new v8::MicrotasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks));
|
||||
}
|
||||
|
||||
++enter_count_;
|
||||
#endif
|
||||
handle_->GetNewV8Handle()->Enter();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1033,15 +1032,21 @@ bool CefV8ContextImpl::Exit() {
|
||||
if (blink::ScriptForbiddenScope::isScriptForbidden())
|
||||
return false;
|
||||
|
||||
v8::Isolate* isolate = handle_->isolate();
|
||||
if (enter_count_ <= 0) {
|
||||
LOG(ERROR) << "Call to CefV8Context::Exit() without matching call to "
|
||||
"CefV8Context::Enter()";
|
||||
return false;
|
||||
}
|
||||
|
||||
v8::HandleScope handle_scope(handle_->isolate());
|
||||
|
||||
DLOG_ASSERT(enter_count_ > 0);
|
||||
handle_->GetNewV8Handle()->Exit();
|
||||
blink::V8PerIsolateData::from(isolate)->decrementRecursionLevel();
|
||||
#ifndef NDEBUG
|
||||
--enter_count_;
|
||||
#endif
|
||||
|
||||
if (--enter_count_ == 0) {
|
||||
// Decrement the MicrotasksScope recursion level.
|
||||
microtasks_scope_.reset(nullptr);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -188,14 +188,12 @@ class CefV8ContextImpl : public CefV8Context {
|
||||
v8::Local<v8::Context> GetV8Context();
|
||||
blink::WebFrame* GetWebFrame();
|
||||
|
||||
protected:
|
||||
private:
|
||||
typedef CefV8Handle<v8::Context> Handle;
|
||||
scoped_refptr<Handle> handle_;
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Used in debug builds to catch missing Exits in destructor.
|
||||
int enter_count_;
|
||||
#endif
|
||||
scoped_ptr<v8::MicrotasksScope> microtasks_scope_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefV8ContextImpl);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefV8ContextImpl);
|
||||
@ -279,7 +277,7 @@ class CefV8ValueImpl : public CefV8Value {
|
||||
CefRefPtr<CefV8Value> object,
|
||||
const CefV8ValueList& arguments) override;
|
||||
|
||||
protected:
|
||||
private:
|
||||
// Test for and record any exception.
|
||||
bool HasCaught(v8::Local<v8::Context> context, v8::TryCatch& try_catch);
|
||||
|
||||
@ -299,7 +297,7 @@ class CefV8ValueImpl : public CefV8Value {
|
||||
|
||||
void SetWeakIfNecessary();
|
||||
|
||||
protected:
|
||||
private:
|
||||
~Handle() override;
|
||||
|
||||
private:
|
||||
@ -366,7 +364,7 @@ class CefV8StackTraceImpl : public CefV8StackTrace {
|
||||
int GetFrameCount() override;
|
||||
CefRefPtr<CefV8StackFrame> GetFrame(int index) override;
|
||||
|
||||
protected:
|
||||
private:
|
||||
std::vector<CefRefPtr<CefV8StackFrame> > frames_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl);
|
||||
@ -388,7 +386,7 @@ class CefV8StackFrameImpl : public CefV8StackFrame {
|
||||
bool IsEval() override;
|
||||
bool IsConstructor() override;
|
||||
|
||||
protected:
|
||||
private:
|
||||
CefString script_name_;
|
||||
CefString script_name_or_source_url_;
|
||||
CefString function_name_;
|
||||
|
@ -83,7 +83,7 @@ std::string DumpDocumentText(blink::WebFrame* frame) {
|
||||
|
||||
cef_dom_node_type_t GetNodeType(const blink::WebNode& node) {
|
||||
const blink::Node* web_node = node.constUnwrap<blink::Node>();
|
||||
switch (web_node->nodeType()) {
|
||||
switch (web_node->getNodeType()) {
|
||||
case blink::Node::ELEMENT_NODE:
|
||||
return DOM_NODE_TYPE_ELEMENT;
|
||||
case blink::Node::ATTRIBUTE_NODE:
|
||||
|
Reference in New Issue
Block a user