mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision cb947c01 (#352221)
- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest object passed to OnBeforeBrowse will no longer have an associated request identifier. - Mac: Remove additional helper apps which are no longer required (see http://crbug.com/520680) - Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see http://crbug.com/517114) - Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and NPAPI plugins are no longer supported (see http://crbug.com/470301#c11) - Add CefFormatUrlForSecurityDisplay function in cef_parser.h - Fix crash when passing `--disable-extensions` command-line flag (issue #1721) - Linux: Fix NSS handler loading (issue #1727)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#define CEF_LIBCEF_COMMON_CRASH_REPORTER_CLIENT_H_
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "components/crash/app/crash_reporter_client.h"
|
||||
#include "components/crash/content/app/crash_reporter_client.h"
|
||||
|
||||
class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
|
||||
public:
|
||||
|
@@ -45,13 +45,13 @@ class CefPermissionMessageProvider : public PermissionMessageProvider {
|
||||
~CefPermissionMessageProvider() override {}
|
||||
|
||||
// PermissionMessageProvider implementation.
|
||||
CoalescedPermissionMessages GetPermissionMessages(
|
||||
PermissionMessages GetPermissionMessages(
|
||||
const PermissionIDSet& permissions) const override {
|
||||
return CoalescedPermissionMessages();
|
||||
return PermissionMessages();
|
||||
}
|
||||
|
||||
bool IsPrivilegeIncrease(const PermissionSet* old_permissions,
|
||||
const PermissionSet* new_permissions,
|
||||
bool IsPrivilegeIncrease(const PermissionSet& old_permissions,
|
||||
const PermissionSet& new_permissions,
|
||||
Manifest::Type extension_type) const override {
|
||||
// Ensure we implement this before shipping.
|
||||
CHECK(false);
|
||||
@@ -59,7 +59,7 @@ class CefPermissionMessageProvider : public PermissionMessageProvider {
|
||||
}
|
||||
|
||||
PermissionIDSet GetAllPermissionIDs(
|
||||
const PermissionSet* permissions,
|
||||
const PermissionSet& permissions,
|
||||
Manifest::Type extension_type) const override {
|
||||
return PermissionIDSet();
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@
|
||||
#if defined(OS_WIN)
|
||||
#include <Objbase.h> // NOLINT(build/include_order)
|
||||
#include "base/win/registry.h"
|
||||
#include "components/crash/app/breakpad_win.h"
|
||||
#include "components/crash/content/app/breakpad_win.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
@@ -62,12 +62,12 @@
|
||||
#include "base/mac/os_crash_dumps.h"
|
||||
#include "base/mac/bundle_locations.h"
|
||||
#include "base/mac/foundation_util.h"
|
||||
#include "components/crash/app/breakpad_mac.h"
|
||||
#include "components/crash/content/app/breakpad_mac.h"
|
||||
#include "content/public/common/content_paths.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
#include "components/crash/app/breakpad_linux.h"
|
||||
#include "components/crash/content/app/breakpad_linux.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
@@ -430,13 +430,6 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||
command_line->AppendSwitchASCII(switches::kContextSafetyImplementation,
|
||||
base::IntToString(settings.context_safety_implementation));
|
||||
}
|
||||
|
||||
if (settings.windowless_rendering_enabled) {
|
||||
#if defined(OS_MACOSX)
|
||||
// The delegated renderer is not yet enabled by default on OS X.
|
||||
command_line->AppendSwitch(switches::kEnableDelegatedRenderer);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (content_client_.application().get()) {
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "base/base64.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "components/url_formatter/elide_url.h"
|
||||
#include "net/base/escape.h"
|
||||
#include "net/base/mime_util.h"
|
||||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
@@ -76,6 +77,12 @@ bool CefCreateURL(const CefURLParts& parts,
|
||||
return false;
|
||||
}
|
||||
|
||||
CefString CefFormatUrlForSecurityDisplay(const CefString& origin_url,
|
||||
const CefString& languages) {
|
||||
return url_formatter::FormatUrlForSecurityDisplay(
|
||||
GURL(origin_url.ToString()), languages);
|
||||
}
|
||||
|
||||
CefString CefGetMimeType(const CefString& extension) {
|
||||
// Requests should not block on the disk! On POSIX this goes to disk.
|
||||
// http://code.google.com/p/chromium/issues/detail?id=59849
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "libcef/common/upload_data.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "components/navigation_interception/navigation_params.h"
|
||||
#include "content/public/browser/resource_request_info.h"
|
||||
#include "content/public/common/resource_type.h"
|
||||
#include "net/base/elements_upload_data_stream.h"
|
||||
@@ -101,12 +102,9 @@ CefRefPtr<CefRequest> CefRequest::Create() {
|
||||
// CefRequestImpl -------------------------------------------------------------
|
||||
|
||||
CefRequestImpl::CefRequestImpl()
|
||||
: method_("GET"),
|
||||
resource_type_(RT_SUB_RESOURCE),
|
||||
transition_type_(TT_EXPLICIT),
|
||||
identifier_(0U),
|
||||
flags_(UR_FLAG_NONE),
|
||||
read_only_(false) {
|
||||
: read_only_(false) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
Reset();
|
||||
}
|
||||
|
||||
bool CefRequestImpl::IsReadOnly() {
|
||||
@@ -209,6 +207,8 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
CHECK_READONLY_RETURN_VOID();
|
||||
|
||||
Reset();
|
||||
|
||||
url_ = request->url().spec();
|
||||
method_ = request->method();
|
||||
first_party_for_cookies_ = request->first_party_for_cookies().spec();
|
||||
@@ -238,8 +238,6 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
||||
if (data) {
|
||||
postdata_ = CefPostData::Create();
|
||||
static_cast<CefPostDataImpl*>(postdata_.get())->Set(*data);
|
||||
} else if (postdata_.get()) {
|
||||
postdata_ = NULL;
|
||||
}
|
||||
|
||||
const content::ResourceRequestInfo* info =
|
||||
@@ -249,9 +247,6 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
||||
static_cast<cef_resource_type_t>(info->GetResourceType());
|
||||
transition_type_ =
|
||||
static_cast<cef_transition_type_t>(info->GetPageTransition());
|
||||
} else {
|
||||
resource_type_ = RT_SUB_RESOURCE;
|
||||
transition_type_ = TT_EXPLICIT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,12 +281,37 @@ void CefRequestImpl::Get(net::URLRequest* request) {
|
||||
}
|
||||
}
|
||||
|
||||
void CefRequestImpl::Set(
|
||||
const navigation_interception::NavigationParams& params,
|
||||
bool is_main_frame) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
CHECK_READONLY_RETURN_VOID();
|
||||
|
||||
Reset();
|
||||
|
||||
url_ = params.url().spec();
|
||||
method_ = params.is_post() ? "POST" : "GET";
|
||||
|
||||
const content::Referrer& sanitized_referrer =
|
||||
content::Referrer::SanitizeForRequest(params.url(), params.referrer());
|
||||
if (!sanitized_referrer.url.is_empty()) {
|
||||
headermap_.insert(std::make_pair(
|
||||
CefString("Referrer"), sanitized_referrer.url.spec()));
|
||||
}
|
||||
|
||||
resource_type_ = is_main_frame ? RT_MAIN_FRAME : RT_SUB_FRAME;
|
||||
transition_type_ =
|
||||
static_cast<cef_transition_type_t>(params.transition_type());
|
||||
}
|
||||
|
||||
void CefRequestImpl::Set(const blink::WebURLRequest& request) {
|
||||
DCHECK(!request.isNull());
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
CHECK_READONLY_RETURN_VOID();
|
||||
|
||||
Reset();
|
||||
|
||||
url_ = request.url().spec().utf16();
|
||||
method_ = request.httpMethod();
|
||||
|
||||
@@ -299,22 +319,16 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
|
||||
if (!body.isNull()) {
|
||||
postdata_ = new CefPostDataImpl();
|
||||
static_cast<CefPostDataImpl*>(postdata_.get())->Set(body);
|
||||
} else if (postdata_.get()) {
|
||||
postdata_ = NULL;
|
||||
}
|
||||
|
||||
headermap_.clear();
|
||||
GetHeaderMap(request, headermap_);
|
||||
|
||||
flags_ = UR_FLAG_NONE;
|
||||
if (request.cachePolicy() == blink::WebURLRequest::ReloadIgnoringCacheData)
|
||||
flags_ |= UR_FLAG_SKIP_CACHE;
|
||||
if (request.allowStoredCredentials())
|
||||
flags_ |= UR_FLAG_ALLOW_CACHED_CREDENTIALS;
|
||||
if (request.reportUploadProgress())
|
||||
flags_ |= UR_FLAG_REPORT_UPLOAD_PROGRESS;
|
||||
if (request.reportRawHeaders())
|
||||
flags_ |= UR_FLAG_REPORT_RAW_HEADERS;
|
||||
|
||||
first_party_for_cookies_ = request.firstPartyForCookies().spec().utf16();
|
||||
}
|
||||
@@ -349,8 +363,6 @@ void CefRequestImpl::Get(blink::WebURLRequest& request) {
|
||||
UR_FLAG_ALLOW_CACHED_CREDENTIALS);
|
||||
SETBOOLFLAG(request, flags_, setReportUploadProgress,
|
||||
UR_FLAG_REPORT_UPLOAD_PROGRESS);
|
||||
SETBOOLFLAG(request, flags_, setReportRawHeaders,
|
||||
UR_FLAG_REPORT_RAW_HEADERS);
|
||||
|
||||
if (!first_party_for_cookies_.empty()) {
|
||||
GURL gurl = GURL(first_party_for_cookies_.ToString());
|
||||
@@ -412,6 +424,21 @@ void CefRequestImpl::SetHeaderMap(const HeaderMap& map,
|
||||
base::string16(it->second));
|
||||
}
|
||||
|
||||
void CefRequestImpl::Reset() {
|
||||
lock_.AssertAcquired();
|
||||
DCHECK(!read_only_);
|
||||
|
||||
url_.clear();
|
||||
method_ = "GET";
|
||||
postdata_ = NULL;
|
||||
headermap_.clear();
|
||||
resource_type_ = RT_SUB_RESOURCE;
|
||||
transition_type_ = TT_EXPLICIT;
|
||||
identifier_ = 0U;
|
||||
flags_ = UR_FLAG_NONE;
|
||||
first_party_for_cookies_.clear();
|
||||
}
|
||||
|
||||
// CefPostData ----------------------------------------------------------------
|
||||
|
||||
// static
|
||||
|
@@ -11,6 +11,10 @@
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "third_party/WebKit/public/platform/WebHTTPBody.h"
|
||||
|
||||
namespace navigation_interception {
|
||||
class NavigationParams;
|
||||
}
|
||||
|
||||
namespace net {
|
||||
class HttpRequestHeaders;
|
||||
class UploadData;
|
||||
@@ -56,6 +60,12 @@ class CefRequestImpl : public CefRequest {
|
||||
// Populate the URLRequest object from this object.
|
||||
void Get(net::URLRequest* request);
|
||||
|
||||
// Populate this object from the NavigationParams object.
|
||||
// TODO(cef): Remove the |is_main_frame| argument once NavigationParams is
|
||||
// reliable in reporting that value.
|
||||
void Set(const navigation_interception::NavigationParams& params,
|
||||
bool is_main_frame);
|
||||
|
||||
// Populate this object from a WebURLRequest object.
|
||||
void Set(const blink::WebURLRequest& request);
|
||||
|
||||
@@ -71,7 +81,9 @@ class CefRequestImpl : public CefRequest {
|
||||
static void SetHeaderMap(const HeaderMap& map,
|
||||
blink::WebURLRequest& request);
|
||||
|
||||
protected:
|
||||
private:
|
||||
void Reset();
|
||||
|
||||
CefString url_;
|
||||
CefString method_;
|
||||
CefRefPtr<CefPostData> postdata_;
|
||||
@@ -113,7 +125,7 @@ class CefPostDataImpl : public CefPostData {
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
||||
protected:
|
||||
private:
|
||||
ElementVector elements_;
|
||||
|
||||
// True if this object is read-only.
|
||||
@@ -150,7 +162,7 @@ class CefPostDataElementImpl : public CefPostDataElement {
|
||||
|
||||
void SetReadOnly(bool read_only);
|
||||
|
||||
protected:
|
||||
private:
|
||||
void Cleanup();
|
||||
|
||||
Type type_;
|
||||
|
Reference in New Issue
Block a user