Update to Chromium revision ff259bab (#488528)
This commit is contained in:
parent
6da2bbf229
commit
f229796a39
7
BUILD.gn
7
BUILD.gn
|
@ -277,6 +277,7 @@ source_set("webkit_set") {
|
|||
deps = [
|
||||
"//skia",
|
||||
"//third_party/icu",
|
||||
"//third_party/boringssl",
|
||||
"//v8",
|
||||
]
|
||||
}
|
||||
|
@ -704,6 +705,7 @@ static_library("libcef_static") {
|
|||
"//components/keyed_service/content:content",
|
||||
"//components/keyed_service/core:core",
|
||||
"//components/navigation_interception",
|
||||
"//components/network_session_configurator/common",
|
||||
"//components/pdf/browser",
|
||||
"//components/pdf/renderer",
|
||||
"//components/plugins/renderer",
|
||||
|
@ -723,7 +725,7 @@ static_library("libcef_static") {
|
|||
"//components/visitedlink/browser",
|
||||
"//components/visitedlink/common",
|
||||
"//components/visitedlink/renderer",
|
||||
"//components/viz/display_compositor",
|
||||
"//components/viz/service",
|
||||
"//components/web_cache/renderer",
|
||||
"//content/public/app:both",
|
||||
"//content/public/browser",
|
||||
|
@ -842,7 +844,7 @@ static_library("libcef_static") {
|
|||
|
||||
deps += [
|
||||
"//build/config/freetype",
|
||||
"//build/linux:fontconfig",
|
||||
"//third_party/fontconfig",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -957,6 +959,7 @@ static_library("libcef_static") {
|
|||
"//ui/events",
|
||||
"//ui/strings",
|
||||
"//ui/wm",
|
||||
"//ui/wm/public",
|
||||
]
|
||||
|
||||
if (toolkit_views) {
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'd483fb7716e28b377c70c26c1bf1e3695aa1d8c9',
|
||||
'chromium_checkout': 'ff259bab28b35d242e10186cd63af7ed404fae0d',
|
||||
}
|
||||
|
|
|
@ -39,14 +39,49 @@
|
|||
#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BASE_ATOMIC_REF_COUNT_H_)
|
||||
// Do nothing if the Chromium header has already been included.
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/atomic_ref_count.h"
|
||||
|
||||
// Used when declaring a base::AtomicRefCount value. This is an object type with
|
||||
// Chromium headers.
|
||||
#define ATOMIC_DECLARATION (0)
|
||||
|
||||
// Maintaining compatibility with AtompicRefCount* functions that were removed
|
||||
// from Chromium in http://crrev.com/ee96d561.
|
||||
namespace base {
|
||||
|
||||
// Increment a reference count by 1.
|
||||
inline void AtomicRefCountInc(volatile AtomicRefCount* ptr) {
|
||||
const_cast<AtomicRefCount*>(ptr)->Increment();
|
||||
}
|
||||
|
||||
// Decrement a reference count by 1 and return whether the result is non-zero.
|
||||
// Insert barriers to ensure that state written before the reference count
|
||||
// became zero will be visible to a thread that has just made the count zero.
|
||||
inline bool AtomicRefCountDec(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->Decrement();
|
||||
}
|
||||
|
||||
// Return whether the reference count is one. If the reference count is used
|
||||
// in the conventional way, a refrerence count of 1 implies that the current
|
||||
// thread owns the reference and no other thread shares it. This call performs
|
||||
// the test for a reference count of one, and performs the memory barrier
|
||||
// needed for the owning thread to act on the object, knowing that it has
|
||||
// exclusive access to the object.
|
||||
inline bool AtomicRefCountIsOne(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->IsOne();
|
||||
}
|
||||
|
||||
// Return whether the reference count is zero. With conventional object
|
||||
// referencing counting, the object will be destroyed, so the reference count
|
||||
// should never be zero. Hence this is generally used for a debug check.
|
||||
inline bool AtomicRefCountIsZero(volatile AtomicRefCount* ptr) {
|
||||
return const_cast<AtomicRefCount*>(ptr)->IsZero();
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
|
@ -58,6 +93,10 @@
|
|||
#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */
|
||||
#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */
|
||||
|
||||
// Used when declaring a base::AtomicRefCount value. This is an integer/ptr type
|
||||
// with CEF headers.
|
||||
#define ATOMIC_DECLARATION = 0
|
||||
|
||||
namespace base {
|
||||
|
||||
typedef subtle::Atomic32 AtomicRefCount;
|
||||
|
|
|
@ -1916,12 +1916,7 @@ typedef struct _cef_popup_features_t {
|
|||
int menuBarVisible;
|
||||
int statusBarVisible;
|
||||
int toolBarVisible;
|
||||
int locationBarVisible;
|
||||
int scrollbarsVisible;
|
||||
int resizable;
|
||||
|
||||
int fullscreen;
|
||||
int dialog;
|
||||
} cef_popup_features_t;
|
||||
|
||||
///
|
||||
|
@ -2463,42 +2458,61 @@ typedef enum {
|
|||
// Policy for how the Referrer HTTP header value will be sent during navigation.
|
||||
// If the `--no-referrers` command-line flag is specified then the policy value
|
||||
// will be ignored and the Referrer value will never be sent.
|
||||
// Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium.
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
// Always send the complete Referrer value.
|
||||
// Clear the referrer header if the header value is HTTPS but the request
|
||||
// destination is HTTP. This is the default behavior.
|
||||
///
|
||||
REFERRER_POLICY_ALWAYS,
|
||||
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
|
||||
REFERRER_POLICY_DEFAULT =
|
||||
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
|
||||
|
||||
///
|
||||
// Use the default policy. This is REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN
|
||||
// when the `--reduced-referrer-granularity` command-line flag is specified
|
||||
// and REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE otherwise.
|
||||
//
|
||||
// A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
// If the request destination is HTTP, an HTTPS referrer will be cleared. If
|
||||
// the request's destination is cross-origin with the referrer (but does not
|
||||
// downgrade), the referrer's granularity will be stripped down to an origin
|
||||
// rather than a full URL. Same-origin requests will send the full referrer.
|
||||
///
|
||||
REFERRER_POLICY_DEFAULT,
|
||||
REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN,
|
||||
|
||||
///
|
||||
// When navigating from HTTPS to HTTP do not send the Referrer value.
|
||||
// Otherwise, send the complete Referrer value.
|
||||
// Strip the referrer down to an origin when the origin of the referrer is
|
||||
// different from the destination's origin.
|
||||
///
|
||||
REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
|
||||
REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN,
|
||||
|
||||
///
|
||||
// Never send the Referrer value.
|
||||
// Never change the referrer.
|
||||
///
|
||||
REFERRER_POLICY_NEVER,
|
||||
REFERRER_POLICY_NEVER_CLEAR_REFERRER,
|
||||
|
||||
///
|
||||
// Only send the origin component of the Referrer value.
|
||||
// Strip the referrer down to the origin regardless of the redirect location.
|
||||
///
|
||||
REFERRER_POLICY_ORIGIN,
|
||||
|
||||
///
|
||||
// When navigating cross-origin only send the origin component of the Referrer
|
||||
// value. Otherwise, send the complete Referrer value.
|
||||
// Clear the referrer when the request's referrer is cross-origin with the
|
||||
// request's destination.
|
||||
///
|
||||
REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN,
|
||||
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN,
|
||||
|
||||
///
|
||||
// Strip the referrer down to the origin, but clear it entirely if the
|
||||
// referrer value is HTTPS and the destination is HTTP.
|
||||
///
|
||||
REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
|
||||
|
||||
///
|
||||
// Always clear the referrer regardless of the request destination.
|
||||
///
|
||||
REFERRER_POLICY_NO_REFERRER,
|
||||
|
||||
// Always the last value in this enumeration.
|
||||
REFERRER_POLICY_LAST_VALUE,
|
||||
} cef_referrer_policy_t;
|
||||
|
||||
///
|
||||
|
|
|
@ -488,9 +488,7 @@ struct CefPopupFeaturesTraits {
|
|||
s->menuBarVisible = true;
|
||||
s->statusBarVisible = true;
|
||||
s->toolBarVisible = true;
|
||||
s->locationBarVisible = true;
|
||||
s->scrollbarsVisible = true;
|
||||
s->resizable = true;
|
||||
}
|
||||
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
@ -509,11 +507,7 @@ struct CefPopupFeaturesTraits {
|
|||
target->menuBarVisible = src->menuBarVisible;
|
||||
target->statusBarVisible = src->statusBarVisible;
|
||||
target->toolBarVisible = src->toolBarVisible;
|
||||
target->locationBarVisible = src->locationBarVisible;
|
||||
target->scrollbarsVisible = src->scrollbarsVisible;
|
||||
target->resizable = src->resizable;
|
||||
target->fullscreen = src->fullscreen;
|
||||
target->dialog = src->dialog;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -427,6 +427,11 @@ CefBrowserContextImpl::GetBackgroundSyncController() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
content::BrowsingDataRemoverDelegate*
|
||||
CefBrowserContextImpl::GetBrowsingDataRemoverDelegate() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) {
|
||||
|
@ -453,7 +458,6 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
|
|||
url_request_getter_ = new CefURLRequestContextGetterImpl(
|
||||
settings_, GetPrefs(),
|
||||
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
|
||||
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
|
||||
protocol_handlers, std::move(proxy_config_service),
|
||||
std::move(request_interceptors));
|
||||
resource_context()->set_url_request_context_getter(url_request_getter_.get());
|
||||
|
|
|
@ -69,6 +69,8 @@ class CefBrowserContextImpl : public CefBrowserContext,
|
|||
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
||||
content::PermissionManager* GetPermissionManager() override;
|
||||
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
||||
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
||||
override;
|
||||
net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) override;
|
||||
|
|
|
@ -161,6 +161,11 @@ CefBrowserContextProxy::GetBackgroundSyncController() {
|
|||
return parent_->GetBackgroundSyncController();
|
||||
}
|
||||
|
||||
content::BrowsingDataRemoverDelegate*
|
||||
CefBrowserContextProxy::GetBrowsingDataRemoverDelegate() {
|
||||
return parent_->GetBrowsingDataRemoverDelegate();
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) {
|
||||
|
|
|
@ -44,6 +44,8 @@ class CefBrowserContextProxy : public CefBrowserContext {
|
|||
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
||||
content::PermissionManager* GetPermissionManager() override;
|
||||
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
||||
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
||||
override;
|
||||
net::URLRequestContextGetter* CreateRequestContext(
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors) override;
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/resource_request_info.h"
|
||||
#include "content/public/common/favicon_url.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "third_party/WebKit/public/web/WebFindOptions.h"
|
||||
#include "ui/events/base_event_utils.h"
|
||||
|
@ -700,7 +701,7 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
|
|||
|
||||
std::unique_ptr<content::DownloadUrlParameters> params(
|
||||
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
|
||||
web_contents(), gurl));
|
||||
web_contents(), gurl, NO_TRAFFIC_ANNOTATION_YET));
|
||||
manager->DownloadUrl(std::move(params));
|
||||
}
|
||||
|
||||
|
@ -1526,7 +1527,9 @@ void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) {
|
|||
|
||||
request.method = params.method;
|
||||
request.referrer = params.referrer.url;
|
||||
request.referrer_policy = params.referrer.policy;
|
||||
request.referrer_policy =
|
||||
CefRequestImpl::BlinkReferrerPolicyToNetReferrerPolicy(
|
||||
params.referrer.policy);
|
||||
request.frame_id = params.frame_id;
|
||||
request.first_party_for_cookies = params.first_party_for_cookies;
|
||||
request.headers = params.headers;
|
||||
|
@ -2305,8 +2308,7 @@ void CefBrowserHostImpl::WebContentsCreated(
|
|||
int opener_render_frame_id,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents,
|
||||
const base::Optional<content::WebContents::CreateParams>& create_params) {
|
||||
content::WebContents* new_contents) {
|
||||
CefBrowserSettings settings;
|
||||
CefRefPtr<CefClient> client;
|
||||
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
|
||||
|
@ -2673,7 +2675,7 @@ void CefBrowserHostImpl::DidUpdateFaviconURL(
|
|||
std::vector<CefString> icon_urls;
|
||||
std::vector<content::FaviconURL>::const_iterator it = candidates.begin();
|
||||
for (; it != candidates.end(); ++it) {
|
||||
if (it->icon_type == content::FaviconURL::FAVICON)
|
||||
if (it->icon_type == content::FaviconURL::IconType::kFavicon)
|
||||
icon_urls.push_back(it->icon_url.spec());
|
||||
}
|
||||
if (!icon_urls.empty())
|
||||
|
@ -2736,7 +2738,8 @@ void CefBrowserHostImpl::AccessibilityLocationChangesReceived(
|
|||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnWebContentsFocused() {
|
||||
void CefBrowserHostImpl::OnWebContentsFocused(
|
||||
content::RenderWidgetHost* render_widget_host) {
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
|
||||
if (handler.get())
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
namespace content {
|
||||
struct DragEventSourceInfo;
|
||||
class RenderWidgetHostImpl;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace net {
|
||||
class URLRequest;
|
||||
|
@ -412,15 +412,12 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||
int opener_render_frame_id,
|
||||
content::WebContentsView** view,
|
||||
content::RenderViewHostDelegateView** delegate_view) override;
|
||||
void WebContentsCreated(
|
||||
content::WebContents* source_contents,
|
||||
void WebContentsCreated(content::WebContents* source_contents,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
content::WebContents* new_contents,
|
||||
const base::Optional<content::WebContents::CreateParams>& create_params)
|
||||
override;
|
||||
content::WebContents* new_contents) override;
|
||||
void DidNavigateMainFramePostCommit(
|
||||
content::WebContents* web_contents) override;
|
||||
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
||||
|
@ -484,7 +481,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||
const std::vector<content::AXLocationChangeNotificationDetails>& locData)
|
||||
override;
|
||||
|
||||
void OnWebContentsFocused() override;
|
||||
void OnWebContentsFocused(
|
||||
content::RenderWidgetHost* render_widget_host) override;
|
||||
// Override to provide a thread safe implementation.
|
||||
bool Send(IPC::Message* message) override;
|
||||
|
||||
|
|
|
@ -37,12 +37,7 @@ void TranslatePopupFeatures(const blink::mojom::WindowFeatures& webKitFeatures,
|
|||
features.menuBarVisible = webKitFeatures.menu_bar_visible;
|
||||
features.statusBarVisible = webKitFeatures.status_bar_visible;
|
||||
features.toolBarVisible = webKitFeatures.tool_bar_visible;
|
||||
features.locationBarVisible = webKitFeatures.location_bar_visible;
|
||||
features.scrollbarsVisible = webKitFeatures.scrollbars_visible;
|
||||
features.resizable = webKitFeatures.resizable;
|
||||
|
||||
features.fullscreen = webKitFeatures.fullscreen;
|
||||
features.dialog = webKitFeatures.dialog;
|
||||
}
|
||||
|
||||
CefBrowserInfoManager* g_info_manager = nullptr;
|
||||
|
@ -112,11 +107,11 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
|
|||
PendingNewBrowserInfoList::iterator it =
|
||||
pending_new_browser_info_list_.begin();
|
||||
for (; it != pending_new_browser_info_list_.end(); ++it) {
|
||||
PendingNewBrowserInfo* info = *it;
|
||||
PendingNewBrowserInfo* info = it->get();
|
||||
if (info->render_process_id == render_process_id &&
|
||||
info->render_view_routing_id == render_view_routing_id &&
|
||||
info->render_frame_routing_id == render_frame_routing_id) {
|
||||
SendNewBrowserInfoResponse(render_process_id, browser_info.get(), false,
|
||||
SendNewBrowserInfoResponse(render_process_id, browser_info, false,
|
||||
info->reply_msg);
|
||||
|
||||
pending_new_browser_info_list_.erase(it);
|
||||
|
@ -304,8 +299,8 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(int render_process_id,
|
|||
|
||||
if (browser_info.get()) {
|
||||
// Send the response immediately.
|
||||
SendNewBrowserInfoResponse(render_process_id, browser_info.get(),
|
||||
is_guest_view, reply_msg);
|
||||
SendNewBrowserInfoResponse(render_process_id, browser_info, is_guest_view,
|
||||
reply_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -315,7 +310,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(int render_process_id,
|
|||
PendingNewBrowserInfoList::const_iterator it =
|
||||
pending_new_browser_info_list_.begin();
|
||||
for (; it != pending_new_browser_info_list_.end(); ++it) {
|
||||
PendingNewBrowserInfo* info = *it;
|
||||
PendingNewBrowserInfo* info = it->get();
|
||||
if (info->render_process_id == render_process_id &&
|
||||
info->render_view_routing_id == render_view_routing_id &&
|
||||
info->render_frame_routing_id == render_frame_routing_id) {
|
||||
|
@ -416,7 +411,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
|||
PendingNewBrowserInfoList::iterator it =
|
||||
pending_new_browser_info_list_.begin();
|
||||
while (it != pending_new_browser_info_list_.end()) {
|
||||
PendingNewBrowserInfo* info = *it;
|
||||
PendingNewBrowserInfo* info = it->get();
|
||||
if (info->render_process_id == render_process_id)
|
||||
it = pending_new_browser_info_list_.erase(it);
|
||||
else
|
||||
|
@ -428,7 +423,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
|
|||
{
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
while (it != pending_popup_list_.end()) {
|
||||
PendingPopup* popup = *it;
|
||||
PendingPopup* popup = it->get();
|
||||
if (popup->opener_process_id == render_process_id) {
|
||||
it = pending_popup_list_.erase(it);
|
||||
} else {
|
||||
|
@ -455,11 +450,13 @@ CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step step,
|
|||
|
||||
PendingPopupList::iterator it = pending_popup_list_.begin();
|
||||
for (; it != pending_popup_list_.end(); ++it) {
|
||||
PendingPopup* popup = *it;
|
||||
PendingPopup* popup = it->get();
|
||||
if (popup->step == step && popup->opener_process_id == opener_process_id &&
|
||||
popup->opener_frame_id == opener_frame_id &&
|
||||
popup->target_url == target_url) {
|
||||
pending_popup_list_.weak_erase(it);
|
||||
// Transfer ownership of the pointer.
|
||||
it->release();
|
||||
pending_popup_list_.erase(it);
|
||||
return base::WrapUnique(popup);
|
||||
}
|
||||
}
|
||||
|
@ -525,7 +522,7 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
|
|||
// static
|
||||
void CefBrowserInfoManager::SendNewBrowserInfoResponse(
|
||||
int render_process_id,
|
||||
CefBrowserInfo* browser_info,
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
bool is_guest_view,
|
||||
IPC::Message* reply_msg) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
|
|
|
@ -9,10 +9,11 @@
|
|||
#include "include/cef_client.h"
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "libcef/browser/browser_info.h"
|
||||
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "content/public/browser/render_process_host_observer.h"
|
||||
#include "third_party/WebKit/public/web/window_features.mojom.h"
|
||||
|
@ -29,7 +30,7 @@ class RenderFrameHost;
|
|||
class RenderViewHostDelegateView;
|
||||
class WebContents;
|
||||
class WebContentsView;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace IPC {
|
||||
class Message;
|
||||
|
@ -184,8 +185,9 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
|||
bool* is_guest_view);
|
||||
|
||||
// Send the response for a pending OnGetNewBrowserInfo request.
|
||||
static void SendNewBrowserInfoResponse(int render_process_id,
|
||||
CefBrowserInfo* browser_info,
|
||||
static void SendNewBrowserInfoResponse(
|
||||
int render_process_id,
|
||||
scoped_refptr<CefBrowserInfo> browser_info,
|
||||
bool is_guest_view,
|
||||
IPC::Message* reply_msg);
|
||||
|
||||
|
@ -204,11 +206,12 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
|
|||
BrowserInfoList browser_info_list_;
|
||||
int next_browser_id_;
|
||||
|
||||
typedef ScopedVector<PendingNewBrowserInfo> PendingNewBrowserInfoList;
|
||||
using PendingNewBrowserInfoList =
|
||||
std::vector<std::unique_ptr<PendingNewBrowserInfo>>;
|
||||
PendingNewBrowserInfoList pending_new_browser_info_list_;
|
||||
|
||||
// Only accessed on the UI thread.
|
||||
typedef ScopedVector<PendingPopup> PendingPopupList;
|
||||
using PendingPopupList = std::vector<std::unique_ptr<PendingPopup>>;
|
||||
PendingPopupList pending_popup_list_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoManager);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "libcef/browser/request_context_impl.h"
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
|
@ -20,7 +19,7 @@
|
|||
namespace base {
|
||||
class MessageLoop;
|
||||
class Thread;
|
||||
}
|
||||
} // namespace base
|
||||
|
||||
namespace content {
|
||||
struct MainFunctionParams;
|
||||
|
@ -29,7 +28,7 @@ struct MainFunctionParams;
|
|||
namespace extensions {
|
||||
class ExtensionsBrowserClient;
|
||||
class ExtensionsClient;
|
||||
}
|
||||
} // namespace extensions
|
||||
|
||||
#if defined(USE_AURA)
|
||||
namespace wm {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "libcef/browser/browser_main.h"
|
||||
|
||||
#include "cef/grit/cef_strings.h"
|
||||
#include "chrome/common/chrome_utility_messages.h"
|
||||
#include "content/public/browser/utility_process_host.h"
|
||||
#include "content/public/browser/utility_process_host_client.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
|
|
@ -37,12 +37,13 @@ void ChromeBrowserProcessStub::Initialize(
|
|||
DCHECK(!context_initialized_);
|
||||
DCHECK(!shutdown_);
|
||||
|
||||
base::FilePath net_log_path;
|
||||
if (command_line.HasSwitch(switches::kLogNetLog))
|
||||
net_log_path = command_line.GetSwitchValuePath(switches::kLogNetLog);
|
||||
net_log_.reset(new net_log::ChromeNetLog(
|
||||
net_log_path, GetNetCaptureModeFromCommandLine(command_line),
|
||||
command_line.GetCommandLineString(), std::string()));
|
||||
net_log_ = base::MakeUnique<net_log::ChromeNetLog>();
|
||||
if (command_line.HasSwitch(switches::kLogNetLog)) {
|
||||
net_log_->StartWritingToFile(
|
||||
command_line.GetSwitchValuePath(switches::kLogNetLog),
|
||||
GetNetCaptureModeFromCommandLine(command_line),
|
||||
command_line.GetCommandLineString(), std::string());
|
||||
}
|
||||
|
||||
initialized_ = true;
|
||||
}
|
||||
|
@ -349,7 +350,7 @@ ChromeBrowserProcessStub::CachedDefaultWebClientState() {
|
|||
return shell_integration::UNKNOWN_DEFAULT;
|
||||
}
|
||||
|
||||
memory::TabManager* ChromeBrowserProcessStub::GetTabManager() {
|
||||
resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -360,6 +361,12 @@ ChromeBrowserProcessStub::GetPhysicalWebDataSource() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
prefs::InProcessPrefServiceFactory*
|
||||
ChromeBrowserProcessStub::pref_service_factory() const {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content::BrowserContext*
|
||||
ChromeBrowserProcessStub::GetBrowserContextRedirectedInIncognito(
|
||||
content::BrowserContext* context) {
|
||||
|
|
|
@ -106,8 +106,9 @@ class ChromeBrowserProcessStub : public BrowserProcess,
|
|||
gcm::GCMDriver* gcm_driver() override;
|
||||
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
|
||||
override;
|
||||
memory::TabManager* GetTabManager() override;
|
||||
resource_coordinator::TabManager* GetTabManager() override;
|
||||
physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() override;
|
||||
prefs::InProcessPrefServiceFactory* pref_service_factory() const override;
|
||||
|
||||
// BrowserContextIncognitoHelper implementation.
|
||||
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "base/path_service.h"
|
||||
#include "cef/grit/cef_resources.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_message_filter.h"
|
||||
#include "chrome/browser/spellchecker/spell_check_host_impl.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/grit/browser_resources.h"
|
||||
#include "components/navigation_interception/intercept_navigation_throttle.h"
|
||||
|
@ -246,14 +246,32 @@ class CefSelectClientCertificateCallbackImpl
|
|||
CefRefPtr<CefX509Certificate> cert) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
scoped_refptr<net::X509Certificate> x509cert = NULL;
|
||||
if (cert) {
|
||||
CefX509CertificateImpl* certImpl =
|
||||
static_cast<CefX509CertificateImpl*>(cert.get());
|
||||
x509cert = certImpl->GetInternalCertObject();
|
||||
certImpl->AcquirePrivateKey(
|
||||
base::Bind(&CefSelectClientCertificateCallbackImpl::RunWithPrivateKey,
|
||||
base::Passed(std::move(delegate)), cert));
|
||||
return;
|
||||
}
|
||||
|
||||
delegate->ContinueWithCertificate(x509cert.get());
|
||||
delegate->ContinueWithCertificate(nullptr, nullptr);
|
||||
}
|
||||
|
||||
static void RunWithPrivateKey(
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate,
|
||||
CefRefPtr<CefX509Certificate> cert,
|
||||
scoped_refptr<net::SSLPrivateKey> key) {
|
||||
CEF_REQUIRE_UIT();
|
||||
DCHECK(cert);
|
||||
|
||||
if (key) {
|
||||
CefX509CertificateImpl* certImpl =
|
||||
static_cast<CefX509CertificateImpl*>(cert.get());
|
||||
delegate->ContinueWithCertificate(certImpl->GetInternalCertObject(), key);
|
||||
} else {
|
||||
delegate->ContinueWithCertificate(nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate_;
|
||||
|
@ -449,20 +467,19 @@ content::BrowserMainParts* CefContentBrowserClient::CreateBrowserMainParts(
|
|||
|
||||
void CefContentBrowserClient::RenderProcessWillLaunch(
|
||||
content::RenderProcessHost* host) {
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
const int id = host->GetID();
|
||||
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
|
||||
|
||||
host->AddFilter(new CefBrowserMessageFilter(id));
|
||||
host->AddFilter(new printing::CefPrintingMessageFilter(id, profile));
|
||||
|
||||
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
|
||||
host->AddFilter(new SpellCheckMessageFilter(id));
|
||||
#if defined(OS_MACOSX)
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
|
||||
host->AddFilter(new SpellCheckMessageFilterPlatform(id));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
host->AddFilter(new CefPluginInfoMessageFilter(
|
||||
id, static_cast<CefBrowserContext*>(profile)));
|
||||
|
@ -578,8 +595,9 @@ void CefContentBrowserClient::SiteInstanceDeleting(
|
|||
|
||||
void CefContentBrowserClient::RegisterOutOfProcessServices(
|
||||
OutOfProcessServiceMap* services) {
|
||||
services->emplace(printing::mojom::kServiceName,
|
||||
base::ASCIIToUTF16("PDF Compositor Service"));
|
||||
(*services)[printing::mojom::kServiceName] = {
|
||||
base::ASCIIToUTF16("PDF Compositor Service"),
|
||||
content::SANDBOX_TYPE_UTILITY};
|
||||
}
|
||||
|
||||
std::unique_ptr<base::Value> CefContentBrowserClient::GetServiceManifestOverlay(
|
||||
|
@ -712,12 +730,9 @@ CefContentBrowserClient::CreateQuotaPermissionContext() {
|
|||
void CefContentBrowserClient::GetQuotaSettings(
|
||||
content::BrowserContext* context,
|
||||
content::StoragePartition* partition,
|
||||
const storage::OptionalQuotaSettingsCallback& callback) {
|
||||
content::BrowserThread::PostTaskAndReplyWithResult(
|
||||
content::BrowserThread::FILE, FROM_HERE,
|
||||
base::Bind(&storage::CalculateNominalDynamicSettings,
|
||||
partition->GetPath(), context->IsOffTheRecord()),
|
||||
callback);
|
||||
storage::OptionalQuotaSettingsCallback callback) {
|
||||
storage::GetNominalDynamicSettings(
|
||||
partition->GetPath(), context->IsOffTheRecord(), std::move(callback));
|
||||
}
|
||||
|
||||
content::MediaObserver* CefContentBrowserClient::GetMediaObserver() {
|
||||
|
@ -783,7 +798,7 @@ void CefContentBrowserClient::AllowCertificateError(
|
|||
void CefContentBrowserClient::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::CertificateList client_certs,
|
||||
net::ClientCertIdentityList client_certs,
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
|
@ -797,15 +812,14 @@ void CefContentBrowserClient::SelectClientCertificate(
|
|||
}
|
||||
|
||||
if (!handler.get()) {
|
||||
delegate->ContinueWithCertificate(NULL);
|
||||
delegate->ContinueWithCertificate(nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
CefRequestHandler::X509CertificateList certs;
|
||||
for (std::vector<scoped_refptr<net::X509Certificate>>::iterator iter =
|
||||
client_certs.begin();
|
||||
for (net::ClientCertIdentityList::iterator iter = client_certs.begin();
|
||||
iter != client_certs.end(); iter++) {
|
||||
certs.push_back(new CefX509CertificateImpl(*iter));
|
||||
certs.push_back(new CefX509CertificateImpl(std::move(*iter)));
|
||||
}
|
||||
|
||||
CefRefPtr<CefSelectClientCertificateCallbackImpl> callbackImpl(
|
||||
|
@ -921,10 +935,8 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
|
|||
|
||||
std::unique_ptr<content::NavigationThrottle> throttle =
|
||||
base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
|
||||
navigation_handle,
|
||||
base::Bind(&NavigationOnUIThread, is_main_frame, frame_id,
|
||||
parent_frame_id),
|
||||
true);
|
||||
navigation_handle, base::Bind(&NavigationOnUIThread, is_main_frame,
|
||||
frame_id, parent_frame_id));
|
||||
throttles.push_back(std::move(throttle));
|
||||
|
||||
return throttles;
|
||||
|
@ -964,6 +976,22 @@ bool CefContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy) {
|
|||
}
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
void CefContentBrowserClient::ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
content::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* render_process_host) {
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner =
|
||||
content::BrowserThread::GetTaskRunnerForThread(
|
||||
content::BrowserThread::UI);
|
||||
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
|
||||
registry->AddInterface(
|
||||
base::Bind(&SpellCheckHostImpl::Create, render_process_host->GetID()),
|
||||
ui_task_runner);
|
||||
}
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {
|
||||
// Register as a Web-safe scheme so that requests for the scheme from a
|
||||
// render process will be allowed in resource_dispatcher_host_impl.cc
|
||||
|
|
|
@ -26,7 +26,7 @@ class CefResourceDispatcherHostDelegate;
|
|||
namespace content {
|
||||
class PluginServiceFilter;
|
||||
class SiteInstance;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace extensions {
|
||||
class Extension;
|
||||
|
@ -59,7 +59,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||
void GetQuotaSettings(
|
||||
content::BrowserContext* context,
|
||||
content::StoragePartition* partition,
|
||||
const storage::OptionalQuotaSettingsCallback& callback) override;
|
||||
storage::OptionalQuotaSettingsCallback callback) override;
|
||||
content::MediaObserver* GetMediaObserver() override;
|
||||
content::SpeechRecognitionManagerDelegate*
|
||||
CreateSpeechRecognitionManagerDelegate() override;
|
||||
|
@ -77,7 +77,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||
void SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
net::CertificateList client_certs,
|
||||
net::ClientCertIdentityList client_certs,
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
bool CanCreateWindow(content::RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
|
@ -115,6 +115,11 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||
bool PreSpawnRenderer(sandbox::TargetPolicy* policy) override;
|
||||
#endif
|
||||
|
||||
void ExposeInterfacesToRenderer(
|
||||
service_manager::BinderRegistry* registry,
|
||||
content::AssociatedInterfaceRegistry* associated_registry,
|
||||
content::RenderProcessHost* render_process_host) override;
|
||||
|
||||
// Perform browser process registration for the custom scheme.
|
||||
void RegisterCustomScheme(const std::string& scheme);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "base/debug/debugger.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "components/network_session_configurator/common/network_switches.h"
|
||||
#include "content/app/content_service_manager_main_delegate.h"
|
||||
#include "content/public/browser/notification_service.h"
|
||||
#include "content/public/browser/notification_types.h"
|
||||
|
|
|
@ -94,7 +94,7 @@ void RunAsyncCompletionOnIOThread(CefRefPtr<CefCompletionCallback> callback) {
|
|||
|
||||
// Always execute the callback asynchronously.
|
||||
void DeleteCookiesCallbackImpl(CefRefPtr<CefDeleteCookiesCallback> callback,
|
||||
int num_deleted) {
|
||||
uint32_t num_deleted) {
|
||||
if (!callback.get())
|
||||
return;
|
||||
CEF_POST_TASK(CEF_IOT, base::Bind(&CefDeleteCookiesCallback::OnComplete,
|
||||
|
|
|
@ -6,14 +6,18 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "libcef/browser/browser_context.h"
|
||||
#include "libcef/browser/devtools_manager_delegate.h"
|
||||
#include "libcef/browser/net/devtools_scheme_handler.h"
|
||||
|
||||
#include "base/guid.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/json/string_escape.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
|
@ -22,6 +26,7 @@
|
|||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
|
@ -189,14 +194,24 @@ CefDevToolsFrontend::~CefDevToolsFrontend() {
|
|||
delete pair.first;
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::RenderViewCreated(
|
||||
content::RenderViewHost* render_view_host) {
|
||||
if (!frontend_host_) {
|
||||
void CefDevToolsFrontend::ReadyToCommitNavigation(
|
||||
content::NavigationHandle* navigation_handle) {
|
||||
content::RenderFrameHost* frame = navigation_handle->GetRenderFrameHost();
|
||||
if (navigation_handle->IsInMainFrame()) {
|
||||
frontend_host_.reset(content::DevToolsFrontendHost::Create(
|
||||
web_contents()->GetMainFrame(),
|
||||
frame,
|
||||
base::Bind(&CefDevToolsFrontend::HandleMessageFromDevToolsFrontend,
|
||||
base::Unretained(this))));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string origin = navigation_handle->GetURL().GetOrigin().spec();
|
||||
auto it = extensions_api_.find(origin);
|
||||
if (it == extensions_api_.end())
|
||||
return;
|
||||
std::string script = base::StringPrintf("%s(\"%s\")", it->second.c_str(),
|
||||
base::GenerateGUID().c_str());
|
||||
content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
|
||||
|
@ -296,7 +311,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
|||
destination: OTHER
|
||||
}
|
||||
policy {
|
||||
cookies_allowed: true
|
||||
cookies_allowed: YES
|
||||
cookies_store: "user"
|
||||
setting:
|
||||
"It's not possible to disable this feature from settings."
|
||||
|
@ -346,6 +361,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
|||
} else if (method == "reattach") {
|
||||
agent_host_->DetachClient(this);
|
||||
agent_host_->AttachClient(this);
|
||||
} else if (method == "registerExtensionsAPI") {
|
||||
std::string origin;
|
||||
std::string script;
|
||||
if (!params->GetString(0, &origin) || !params->GetString(1, &script))
|
||||
return;
|
||||
extensions_api_[origin + "/"] = script;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -386,16 +407,16 @@ void CefDevToolsFrontend::OnURLFetchComplete(const net::URLFetcher* source) {
|
|||
DCHECK(it != pending_requests_.end());
|
||||
|
||||
base::DictionaryValue response;
|
||||
base::DictionaryValue* headers = new base::DictionaryValue();
|
||||
auto headers = base::MakeUnique<base::DictionaryValue>();
|
||||
net::HttpResponseHeaders* rh = source->GetResponseHeaders();
|
||||
response.SetInteger("statusCode", rh ? rh->response_code() : 200);
|
||||
response.Set("headers", headers);
|
||||
|
||||
size_t iterator = 0;
|
||||
std::string name;
|
||||
std::string value;
|
||||
while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
|
||||
headers->SetString(name, value);
|
||||
response.Set("headers", std::move(headers));
|
||||
|
||||
SendMessageAck(it->second, &response);
|
||||
pending_requests_.erase(it);
|
||||
|
|
|
@ -24,9 +24,10 @@ class Value;
|
|||
}
|
||||
|
||||
namespace content {
|
||||
class NavigationHandle;
|
||||
class RenderViewHost;
|
||||
class WebContents;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
class PrefService;
|
||||
|
||||
|
@ -73,7 +74,8 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
|||
|
||||
private:
|
||||
// WebContentsObserver overrides
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void ReadyToCommitNavigation(
|
||||
content::NavigationHandle* navigation_handle) override;
|
||||
void DocumentAvailableInMainFrame() override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
|
@ -91,6 +93,8 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
|||
std::unique_ptr<content::DevToolsFrontendHost> frontend_host_;
|
||||
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
|
||||
PendingRequestsMap pending_requests_;
|
||||
using ExtensionsAPIs = std::map<std::string, std::string>;
|
||||
ExtensionsAPIs extensions_api_;
|
||||
base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
|
||||
|
|
|
@ -245,6 +245,11 @@ KioskDelegate* CefExtensionsBrowserClient::GetKioskDelegate() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool CefExtensionsBrowserClient::IsLockScreenContext(
|
||||
content::BrowserContext* context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefExtensionsBrowserClient::SetAPIClientForTest(
|
||||
ExtensionsAPIClient* api_client) {
|
||||
api_client_.reset(api_client);
|
||||
|
|
|
@ -80,6 +80,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
|
|||
ExtensionWebContentsObserver* GetExtensionWebContentsObserver(
|
||||
content::WebContents* web_contents) override;
|
||||
KioskDelegate* GetKioskDelegate() override;
|
||||
bool IsLockScreenContext(content::BrowserContext* context) override;
|
||||
|
||||
// Sets the API client.
|
||||
void SetAPIClientForTest(ExtensionsAPIClient* api_client);
|
||||
|
|
|
@ -62,13 +62,7 @@ bool PNGMethod(bool with_transparency,
|
|||
bool JPEGMethod(int quality,
|
||||
const SkBitmap& bitmap,
|
||||
std::vector<unsigned char>* compressed) {
|
||||
return gfx::JPEGCodec::Encode(
|
||||
reinterpret_cast<unsigned char*>(bitmap.getPixels()),
|
||||
bitmap.colorType() == kBGRA_8888_SkColorType
|
||||
? gfx::JPEGCodec::FORMAT_BGRA
|
||||
: gfx::JPEGCodec::FORMAT_RGBA,
|
||||
bitmap.width(), bitmap.height(), static_cast<int>(bitmap.rowBytes()),
|
||||
quality, compressed);
|
||||
return gfx::JPEGCodec::Encode(bitmap, quality, compressed);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -112,9 +112,7 @@ void CefMenuManager::Destroy() {
|
|||
bool CefMenuManager::IsShowingContextMenu() {
|
||||
if (!web_contents())
|
||||
return false;
|
||||
content::RenderWidgetHostView* view =
|
||||
web_contents()->GetRenderWidgetHostView();
|
||||
return (view && view->IsShowingContextMenu());
|
||||
return web_contents()->IsShowingContextMenu();
|
||||
}
|
||||
|
||||
bool CefMenuManager::CreateContextMenu(
|
||||
|
@ -241,10 +239,7 @@ void CefMenuManager::MenuWillShow(CefRefPtr<CefMenuModelImpl> source) {
|
|||
return;
|
||||
|
||||
// Notify the host before showing the context menu.
|
||||
content::RenderWidgetHostView* view =
|
||||
web_contents()->GetRenderWidgetHostView();
|
||||
if (view)
|
||||
view->SetShowingContextMenu(true);
|
||||
web_contents()->SetShowingContextMenu(true);
|
||||
}
|
||||
|
||||
void CefMenuManager::MenuClosed(CefRefPtr<CefMenuModelImpl> source) {
|
||||
|
@ -267,10 +262,7 @@ void CefMenuManager::MenuClosed(CefRefPtr<CefMenuModelImpl> source) {
|
|||
}
|
||||
|
||||
// Notify the host after closing the context menu.
|
||||
content::RenderWidgetHostView* view =
|
||||
web_contents()->GetRenderWidgetHostView();
|
||||
if (view)
|
||||
view->SetShowingContextMenu(false);
|
||||
web_contents()->SetShowingContextMenu(false);
|
||||
web_contents()->NotifyContextMenuClosed(params_.custom_context);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "ui/views/controls/menu/menu_config.h"
|
||||
#include "ui/views/controls/menu/menu_insertion_delegate_win.h"
|
||||
#include "ui/views/controls/menu/menu_listener.h"
|
||||
#include "ui/views/layout/layout_constants.h"
|
||||
|
||||
using ui::NativeTheme;
|
||||
|
||||
|
@ -50,6 +49,10 @@ static const int kItemLeftMargin = 4;
|
|||
// The width for displaying the sub-menu arrow.
|
||||
static const int kArrowWidth = 10;
|
||||
|
||||
// Horizontal spacing between the end of an item (i.e. an icon or a checkbox)
|
||||
// and the start of its corresponding text.
|
||||
constexpr int kItemLabelSpacing = 10;
|
||||
|
||||
namespace {
|
||||
|
||||
// Draws the top layer of the canvas into the specified HDC. Only works
|
||||
|
@ -195,7 +198,7 @@ class CefNativeMenuWin::MenuHostWindow {
|
|||
gfx::FontList font_list;
|
||||
measure_item_struct->itemWidth =
|
||||
gfx::GetStringWidth(data->label, font_list) + kIconWidth +
|
||||
kItemLeftMargin + views::kItemLabelSpacing -
|
||||
kItemLeftMargin + kItemLabelSpacing -
|
||||
GetSystemMetrics(SM_CXMENUCHECK);
|
||||
if (data->submenu.get())
|
||||
measure_item_struct->itemWidth += kArrowWidth;
|
||||
|
@ -241,7 +244,7 @@ class CefNativeMenuWin::MenuHostWindow {
|
|||
rect.top += kItemTopMargin;
|
||||
// Should we add kIconWidth only when icon.width() != 0 ?
|
||||
rect.left += kItemLeftMargin + kIconWidth;
|
||||
rect.right -= views::kItemLabelSpacing;
|
||||
rect.right -= kItemLabelSpacing;
|
||||
UINT format = DT_TOP | DT_SINGLELINE;
|
||||
// Check whether the mnemonics should be underlined.
|
||||
BOOL underline_mnemonics;
|
||||
|
|
|
@ -54,7 +54,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
|
|||
}
|
||||
|
||||
void CefWindowDelegateView::InitContent() {
|
||||
set_background(views::Background::CreateSolidBackground(background_color_));
|
||||
SetBackground(views::CreateSolidBackground(background_color_));
|
||||
SetLayoutManager(new views::FillLayout());
|
||||
AddChildView(web_view_);
|
||||
}
|
||||
|
|
|
@ -27,10 +27,6 @@ const char kNetWMPing[] = "_NET_WM_PING";
|
|||
const char kNetWMState[] = "_NET_WM_STATE";
|
||||
const char kXdndProxy[] = "XdndProxy";
|
||||
|
||||
const char* kAtomsToCache[] = {
|
||||
kAtom, kWMDeleteWindow, kWMProtocols, kNetWMPid,
|
||||
kNetWMPing, kNetWMState, kXdndProxy, NULL};
|
||||
|
||||
::Window FindEventTarget(const base::NativeEvent& xev) {
|
||||
::Window target = xev->xany.window;
|
||||
if (xev->type == GenericEvent)
|
||||
|
@ -75,6 +71,7 @@ const char* kAtomsToCache[] = {
|
|||
}
|
||||
return top_level_window;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CEF_EXPORT XDisplay* cef_get_xdisplay() {
|
||||
|
@ -93,7 +90,6 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
|||
window_mapped_(false),
|
||||
bounds_(bounds),
|
||||
focus_pending_(false),
|
||||
atom_cache_(xdisplay_, kAtomsToCache),
|
||||
weak_ptr_factory_(this) {
|
||||
if (parent_xwindow_ == None)
|
||||
parent_xwindow_ = DefaultRootWindow(xdisplay_);
|
||||
|
@ -121,8 +117,8 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
|||
// should listen for activation events and anything else that GTK+ listens
|
||||
// for, and do something useful.
|
||||
::Atom protocols[2];
|
||||
protocols[0] = atom_cache_.GetAtom(kWMDeleteWindow);
|
||||
protocols[1] = atom_cache_.GetAtom(kNetWMPing);
|
||||
protocols[0] = gfx::GetAtom(kWMDeleteWindow);
|
||||
protocols[1] = gfx::GetAtom(kNetWMPing);
|
||||
XSetWMProtocols(xdisplay_, xwindow_, protocols, 2);
|
||||
|
||||
// We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with
|
||||
|
@ -135,12 +131,8 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
|||
static_assert(sizeof(long) >= sizeof(pid_t),
|
||||
"pid_t should not be larger than long");
|
||||
long pid = getpid();
|
||||
XChangeProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kNetWMPid),
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
reinterpret_cast<unsigned char*>(&pid), 1);
|
||||
|
||||
// Allow subclasses to create and cache additional atoms.
|
||||
atom_cache_.allow_uncached_atoms();
|
||||
XChangeProperty(xdisplay_, xwindow_, gfx::GetAtom(kNetWMPid), XA_CARDINAL, 32,
|
||||
PropModeReplace, reinterpret_cast<unsigned char*>(&pid), 1);
|
||||
}
|
||||
|
||||
CefWindowX11::~CefWindowX11() {
|
||||
|
@ -153,9 +145,9 @@ void CefWindowX11::Close() {
|
|||
XEvent ev = {0};
|
||||
ev.xclient.type = ClientMessage;
|
||||
ev.xclient.window = xwindow_;
|
||||
ev.xclient.message_type = atom_cache_.GetAtom(kWMProtocols);
|
||||
ev.xclient.message_type = gfx::GetAtom(kWMProtocols);
|
||||
ev.xclient.format = 32;
|
||||
ev.xclient.data.l[0] = atom_cache_.GetAtom(kWMDeleteWindow);
|
||||
ev.xclient.data.l[0] = gfx::GetAtom(kWMDeleteWindow);
|
||||
ev.xclient.data.l[1] = CurrentTime;
|
||||
XSendEvent(xdisplay_, xwindow_, False, NoEventMask, &ev);
|
||||
}
|
||||
|
@ -200,13 +192,12 @@ void CefWindowX11::Show() {
|
|||
|
||||
if (proxy_target != child) {
|
||||
// Set the proxy target for the top-most window.
|
||||
XChangeProperty(xdisplay_, toplevel_window,
|
||||
atom_cache_.GetAtom(kXdndProxy), XA_WINDOW, 32,
|
||||
PropModeReplace,
|
||||
XChangeProperty(xdisplay_, toplevel_window, gfx::GetAtom(kXdndProxy),
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
reinterpret_cast<unsigned char*>(&child), 1);
|
||||
// Do the same for the proxy target per the spec.
|
||||
XChangeProperty(xdisplay_, child, atom_cache_.GetAtom(kXdndProxy),
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
XChangeProperty(xdisplay_, child, gfx::GetAtom(kXdndProxy), XA_WINDOW,
|
||||
32, PropModeReplace,
|
||||
reinterpret_cast<unsigned char*>(&child), 1);
|
||||
}
|
||||
}
|
||||
|
@ -316,15 +307,15 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
|||
}
|
||||
case ClientMessage: {
|
||||
Atom message_type = xev->xclient.message_type;
|
||||
if (message_type == atom_cache_.GetAtom(kWMProtocols)) {
|
||||
if (message_type == gfx::GetAtom(kWMProtocols)) {
|
||||
Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]);
|
||||
if (protocol == atom_cache_.GetAtom(kWMDeleteWindow)) {
|
||||
if (protocol == gfx::GetAtom(kWMDeleteWindow)) {
|
||||
// We have received a close message from the window manager.
|
||||
if (!browser_ || browser_->TryCloseBrowser()) {
|
||||
// Allow the close.
|
||||
XDestroyWindow(xdisplay_, xwindow_);
|
||||
}
|
||||
} else if (protocol == atom_cache_.GetAtom(kNetWMPing)) {
|
||||
} else if (protocol == gfx::GetAtom(kNetWMPing)) {
|
||||
XEvent reply_event = *xev;
|
||||
reply_event.xclient.window = parent_xwindow_;
|
||||
|
||||
|
@ -370,7 +361,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
|||
break;
|
||||
case PropertyNotify: {
|
||||
::Atom changed_atom = xev->xproperty.atom;
|
||||
if (changed_atom == atom_cache_.GetAtom(kNetWMState)) {
|
||||
if (changed_atom == gfx::GetAtom(kNetWMState)) {
|
||||
// State change event like minimize/maximize.
|
||||
if (browser_.get()) {
|
||||
::Window child = FindChild(xdisplay_, xwindow_);
|
||||
|
@ -386,8 +377,8 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
|||
// Set an empty list of property values to pass the check in
|
||||
// DesktopWindowTreeHostX11::OnWMStateUpdated().
|
||||
XChangeProperty(xdisplay_, child,
|
||||
atom_cache_.GetAtom(kNetWMState), // name
|
||||
atom_cache_.GetAtom(kAtom), // type
|
||||
gfx::GetAtom(kNetWMState), // name
|
||||
gfx::GetAtom(kAtom), // type
|
||||
32, // size in bits of items in 'value'
|
||||
PropModeReplace, NULL,
|
||||
0); // num items
|
||||
|
|
|
@ -70,8 +70,6 @@ class CefWindowX11 : public ui::PlatformEventDispatcher {
|
|||
|
||||
bool focus_pending_;
|
||||
|
||||
ui::X11AtomCache atom_cache_;
|
||||
|
||||
// Must always be the last member.
|
||||
base::WeakPtrFactory<CefWindowX11> weak_ptr_factory_;
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ void CefCookieStoreProxy::SetCookieWithOptionsAsync(
|
|||
const GURL& url,
|
||||
const std::string& cookie_line,
|
||||
const net::CookieOptions& options,
|
||||
const SetCookiesCallback& callback) {
|
||||
SetCookiesCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store) {
|
||||
cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options,
|
||||
callback);
|
||||
std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,64 +49,78 @@ void CefCookieStoreProxy::SetCookieWithDetailsAsync(
|
|||
bool http_only,
|
||||
net::CookieSameSite same_site,
|
||||
net::CookiePriority priority,
|
||||
const SetCookiesCallback& callback) {
|
||||
SetCookiesCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store) {
|
||||
cookie_store->SetCookieWithDetailsAsync(
|
||||
url, name, value, domain, path, creation_time, expiration_time,
|
||||
last_access_time, secure, http_only, same_site, priority, callback);
|
||||
last_access_time, secure, http_only, same_site, priority,
|
||||
std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::SetCanonicalCookieAsync(
|
||||
std::unique_ptr<net::CanonicalCookie> cookie,
|
||||
bool secure_source,
|
||||
bool modify_http_only,
|
||||
SetCookiesCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store) {
|
||||
cookie_store->SetCanonicalCookieAsync(std::move(cookie), secure_source,
|
||||
modify_http_only,
|
||||
std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::GetCookiesWithOptionsAsync(
|
||||
const GURL& url,
|
||||
const net::CookieOptions& options,
|
||||
const GetCookiesCallback& callback) {
|
||||
GetCookiesCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->GetCookiesWithOptionsAsync(url, options, callback);
|
||||
cookie_store->GetCookiesWithOptionsAsync(url, options, std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::GetCookieListWithOptionsAsync(
|
||||
const GURL& url,
|
||||
const net::CookieOptions& options,
|
||||
const GetCookieListCallback& callback) {
|
||||
GetCookieListCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->GetCookieListWithOptionsAsync(url, options, callback);
|
||||
cookie_store->GetCookieListWithOptionsAsync(url, options,
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::GetAllCookiesAsync(
|
||||
const GetCookieListCallback& callback) {
|
||||
void CefCookieStoreProxy::GetAllCookiesAsync(GetCookieListCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->GetAllCookiesAsync(callback);
|
||||
cookie_store->GetAllCookiesAsync(std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::DeleteCookieAsync(const GURL& url,
|
||||
const std::string& cookie_name,
|
||||
const base::Closure& callback) {
|
||||
base::OnceClosure callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->DeleteCookieAsync(url, cookie_name, callback);
|
||||
cookie_store->DeleteCookieAsync(url, cookie_name, std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::DeleteCanonicalCookieAsync(
|
||||
const net::CanonicalCookie& cookie,
|
||||
const DeleteCallback& callback) {
|
||||
DeleteCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->DeleteCanonicalCookieAsync(cookie, callback);
|
||||
cookie_store->DeleteCanonicalCookieAsync(cookie, std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::DeleteAllCreatedBetweenAsync(
|
||||
const base::Time& delete_begin,
|
||||
const base::Time& delete_end,
|
||||
const DeleteCallback& callback) {
|
||||
DeleteCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store) {
|
||||
cookie_store->DeleteAllCreatedBetweenAsync(delete_begin, delete_end,
|
||||
callback);
|
||||
std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,25 +128,24 @@ void CefCookieStoreProxy::DeleteAllCreatedBetweenWithPredicateAsync(
|
|||
const base::Time& delete_begin,
|
||||
const base::Time& delete_end,
|
||||
const CookiePredicate& predicate,
|
||||
const DeleteCallback& callback) {
|
||||
DeleteCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store) {
|
||||
cookie_store->DeleteAllCreatedBetweenWithPredicateAsync(
|
||||
delete_begin, delete_end, predicate, callback);
|
||||
delete_begin, delete_end, predicate, std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::DeleteSessionCookiesAsync(
|
||||
const DeleteCallback& callback) {
|
||||
void CefCookieStoreProxy::DeleteSessionCookiesAsync(DeleteCallback callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->DeleteSessionCookiesAsync(callback);
|
||||
cookie_store->DeleteSessionCookiesAsync(std::move(callback));
|
||||
}
|
||||
|
||||
void CefCookieStoreProxy::FlushStore(const base::Closure& callback) {
|
||||
void CefCookieStoreProxy::FlushStore(base::OnceClosure callback) {
|
||||
net::CookieStore* cookie_store = GetCookieStore();
|
||||
if (cookie_store)
|
||||
cookie_store->FlushStore(callback);
|
||||
cookie_store->FlushStore(std::move(callback));
|
||||
}
|
||||
|
||||
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
|
||||
|
|
|
@ -25,7 +25,7 @@ class CefCookieStoreProxy : public net::CookieStore {
|
|||
void SetCookieWithOptionsAsync(const GURL& url,
|
||||
const std::string& cookie_line,
|
||||
const net::CookieOptions& options,
|
||||
const SetCookiesCallback& callback) override;
|
||||
SetCookiesCallback callback) override;
|
||||
void SetCookieWithDetailsAsync(const GURL& url,
|
||||
const std::string& name,
|
||||
const std::string& value,
|
||||
|
@ -38,30 +38,33 @@ class CefCookieStoreProxy : public net::CookieStore {
|
|||
bool http_only,
|
||||
net::CookieSameSite same_site,
|
||||
net::CookiePriority priority,
|
||||
const SetCookiesCallback& callback) override;
|
||||
SetCookiesCallback callback) override;
|
||||
void SetCanonicalCookieAsync(std::unique_ptr<net::CanonicalCookie> cookie,
|
||||
bool secure_source,
|
||||
bool modify_http_only,
|
||||
SetCookiesCallback callback) override;
|
||||
void GetCookiesWithOptionsAsync(const GURL& url,
|
||||
const net::CookieOptions& options,
|
||||
const GetCookiesCallback& callback) override;
|
||||
void GetCookieListWithOptionsAsync(
|
||||
const GURL& url,
|
||||
GetCookiesCallback callback) override;
|
||||
void GetCookieListWithOptionsAsync(const GURL& url,
|
||||
const net::CookieOptions& options,
|
||||
const GetCookieListCallback& callback) override;
|
||||
void GetAllCookiesAsync(const GetCookieListCallback& callback) override;
|
||||
GetCookieListCallback callback) override;
|
||||
void GetAllCookiesAsync(GetCookieListCallback callback) override;
|
||||
void DeleteCookieAsync(const GURL& url,
|
||||
const std::string& cookie_name,
|
||||
const base::Closure& callback) override;
|
||||
base::OnceClosure callback) override;
|
||||
void DeleteCanonicalCookieAsync(const net::CanonicalCookie& cookie,
|
||||
const DeleteCallback& callback) override;
|
||||
DeleteCallback callback) override;
|
||||
void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
|
||||
const base::Time& delete_end,
|
||||
const DeleteCallback& callback) override;
|
||||
DeleteCallback callback) override;
|
||||
void DeleteAllCreatedBetweenWithPredicateAsync(
|
||||
const base::Time& delete_begin,
|
||||
const base::Time& delete_end,
|
||||
const CookiePredicate& predicate,
|
||||
const DeleteCallback& callback) override;
|
||||
void DeleteSessionCookiesAsync(const DeleteCallback& callback) override;
|
||||
void FlushStore(const base::Closure& callback) override;
|
||||
DeleteCallback callback) override;
|
||||
void DeleteSessionCookiesAsync(DeleteCallback callback) override;
|
||||
void FlushStore(base::OnceClosure callback) override;
|
||||
std::unique_ptr<CookieChangedSubscription> AddCallbackForCookie(
|
||||
const GURL& url,
|
||||
const std::string& name,
|
||||
|
|
|
@ -426,8 +426,10 @@ net::NetworkDelegate::AuthRequiredResponse CefNetworkDelegate::OnAuthRequired(
|
|||
return AUTH_REQUIRED_RESPONSE_NO_ACTION;
|
||||
}
|
||||
|
||||
bool CefNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
|
||||
const base::FilePath& path) const {
|
||||
bool CefNetworkDelegate::OnCanAccessFile(
|
||||
const net::URLRequest& request,
|
||||
const base::FilePath& original_path,
|
||||
const base::FilePath& absolute_path) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
|
|||
net::AuthCredentials* credentials) override;
|
||||
void OnCompleted(net::URLRequest* request, bool started) override;
|
||||
bool OnCanAccessFile(const net::URLRequest& request,
|
||||
const base::FilePath& path) const override;
|
||||
const base::FilePath& original_path,
|
||||
const base::FilePath& absolute_path) const override;
|
||||
bool OnAreExperimentalCookieFeaturesEnabled() const override;
|
||||
|
||||
// Weak, owned by our owner (CefURLRequestContextGetterImpl).
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
#include "libcef/browser/net/url_request_context.h"
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCount CefURLRequestContext::DebugObjCt = 0;
|
||||
base::AtomicRefCount CefURLRequestContext::DebugObjCt;
|
||||
#endif
|
||||
|
||||
CefURLRequestContext::CefURLRequestContext() {
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountInc(&DebugObjCt);
|
||||
DebugObjCt.Increment();
|
||||
#endif
|
||||
}
|
||||
|
||||
CefURLRequestContext::~CefURLRequestContext() {
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountDec(&DebugObjCt);
|
||||
DebugObjCt.Decrement();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
#include "base/threading/worker_pool.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/net/proxy_service_factory.h"
|
||||
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
|
@ -50,7 +51,10 @@
|
|||
#include "net/http/http_server_properties_impl.h"
|
||||
#include "net/http/http_util.h"
|
||||
#include "net/http/transport_security_state.h"
|
||||
#include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
|
||||
#include "net/proxy/proxy_script_fetcher_impl.h"
|
||||
#include "net/proxy/proxy_service.h"
|
||||
#include "net/proxy/proxy_service_mojo.h"
|
||||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
#include "net/url_request/http_user_agent_settings.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
|
@ -105,13 +109,58 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings {
|
|||
DISALLOW_COPY_AND_ASSIGN(CefHttpUserAgentSettings);
|
||||
};
|
||||
|
||||
// Based on ProxyServiceFactory::CreateProxyService which was deleted in
|
||||
// http://crrev.com/1c261ff4.
|
||||
std::unique_ptr<net::ProxyService> CreateProxyService(
|
||||
net::NetLog* net_log,
|
||||
net::URLRequestContext* context,
|
||||
net::NetworkDelegate* network_delegate,
|
||||
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
|
||||
const base::CommandLine& command_line,
|
||||
bool quick_check_enabled,
|
||||
bool pac_https_url_stripping_enabled) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
bool use_v8 = !command_line.HasSwitch(switches::kWinHttpProxyResolver);
|
||||
// TODO(eroman): Figure out why this doesn't work in single-process mode.
|
||||
// Should be possible now that a private isolate is used.
|
||||
// http://crbug.com/474654
|
||||
if (use_v8 && command_line.HasSwitch(switches::kSingleProcess)) {
|
||||
LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
|
||||
use_v8 = false; // Fallback to non-v8 implementation.
|
||||
}
|
||||
|
||||
std::unique_ptr<net::ProxyService> proxy_service;
|
||||
if (use_v8) {
|
||||
std::unique_ptr<net::DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher;
|
||||
net::DhcpProxyScriptFetcherFactory dhcp_factory;
|
||||
dhcp_proxy_script_fetcher = dhcp_factory.Create(context);
|
||||
|
||||
proxy_service = net::CreateProxyServiceUsingMojoFactory(
|
||||
ChromeMojoProxyResolverFactory::GetInstance(),
|
||||
std::move(proxy_config_service),
|
||||
new net::ProxyScriptFetcherImpl(context),
|
||||
std::move(dhcp_proxy_script_fetcher), context->host_resolver(), net_log,
|
||||
network_delegate);
|
||||
} else {
|
||||
proxy_service = net::ProxyService::CreateUsingSystemProxyResolver(
|
||||
std::move(proxy_config_service), net_log);
|
||||
}
|
||||
|
||||
proxy_service->set_quick_check_enabled(quick_check_enabled);
|
||||
proxy_service->set_sanitize_url_policy(
|
||||
pac_https_url_stripping_enabled
|
||||
? net::ProxyService::SanitizeUrlPolicy::SAFE
|
||||
: net::ProxyService::SanitizeUrlPolicy::UNSAFE);
|
||||
|
||||
return proxy_service;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
|
||||
const CefRequestContextSettings& settings,
|
||||
PrefService* pref_service,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors)
|
||||
|
@ -122,7 +171,6 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
|
|||
io_state_->net_log_ = g_browser_process->net_log(),
|
||||
DCHECK(io_state_->net_log_);
|
||||
io_state_->io_task_runner_ = std::move(io_task_runner);
|
||||
io_state_->file_task_runner_ = std::move(file_task_runner);
|
||||
io_state_->proxy_config_service_ = std::move(proxy_config_service);
|
||||
io_state_->request_interceptors_ = std::move(request_interceptors);
|
||||
|
||||
|
@ -266,11 +314,11 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||
io_state_->storage_->set_ct_policy_enforcer(std::move(ct_policy_enforcer));
|
||||
|
||||
std::unique_ptr<net::ProxyService> system_proxy_service =
|
||||
ProxyServiceFactory::CreateProxyService(
|
||||
io_state_->net_log_, io_state_->url_request_context_.get(),
|
||||
CreateProxyService(io_state_->net_log_,
|
||||
io_state_->url_request_context_.get(),
|
||||
io_state_->url_request_context_->network_delegate(),
|
||||
std::move(io_state_->proxy_config_service_), *command_line,
|
||||
quick_check_enabled_.GetValue(),
|
||||
std::move(io_state_->proxy_config_service_),
|
||||
*command_line, quick_check_enabled_.GetValue(),
|
||||
pac_https_url_stripping_enabled_.GetValue());
|
||||
io_state_->storage_->set_proxy_service(std::move(system_proxy_service));
|
||||
|
||||
|
@ -311,31 +359,34 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||
net::CACHE_BACKEND_DEFAULT, http_cache_path, 0,
|
||||
BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE)));
|
||||
|
||||
net::HttpNetworkSession::Params network_session_params;
|
||||
network_session_params.host_resolver =
|
||||
net::HttpNetworkSession::Context network_session_context;
|
||||
network_session_context.host_resolver =
|
||||
io_state_->url_request_context_->host_resolver();
|
||||
network_session_params.cert_verifier =
|
||||
network_session_context.cert_verifier =
|
||||
io_state_->url_request_context_->cert_verifier();
|
||||
network_session_params.transport_security_state =
|
||||
network_session_context.transport_security_state =
|
||||
io_state_->url_request_context_->transport_security_state();
|
||||
network_session_params.cert_transparency_verifier =
|
||||
network_session_context.cert_transparency_verifier =
|
||||
io_state_->url_request_context_->cert_transparency_verifier();
|
||||
network_session_params.ct_policy_enforcer =
|
||||
network_session_context.ct_policy_enforcer =
|
||||
io_state_->url_request_context_->ct_policy_enforcer();
|
||||
network_session_params.proxy_service =
|
||||
network_session_context.proxy_service =
|
||||
io_state_->url_request_context_->proxy_service();
|
||||
network_session_params.ssl_config_service =
|
||||
network_session_context.ssl_config_service =
|
||||
io_state_->url_request_context_->ssl_config_service();
|
||||
network_session_params.http_auth_handler_factory =
|
||||
network_session_context.http_auth_handler_factory =
|
||||
io_state_->url_request_context_->http_auth_handler_factory();
|
||||
network_session_params.http_server_properties =
|
||||
network_session_context.http_server_properties =
|
||||
io_state_->url_request_context_->http_server_properties();
|
||||
network_session_context.net_log = io_state_->net_log_;
|
||||
|
||||
net::HttpNetworkSession::Params network_session_params;
|
||||
network_session_params.ignore_certificate_errors =
|
||||
settings_.ignore_certificate_errors ? true : false;
|
||||
network_session_params.net_log = io_state_->net_log_;
|
||||
|
||||
io_state_->storage_->set_http_network_session(
|
||||
base::WrapUnique(new net::HttpNetworkSession(network_session_params)));
|
||||
base::WrapUnique(new net::HttpNetworkSession(network_session_params,
|
||||
network_session_context)));
|
||||
io_state_->storage_->set_http_transaction_factory(
|
||||
base::WrapUnique(new net::HttpCache(
|
||||
io_state_->storage_->http_network_session(),
|
||||
|
@ -349,7 +400,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
|||
// Install internal scheme handlers that cannot be overridden.
|
||||
scheme::InstallInternalProtectedHandlers(
|
||||
job_factory.get(), io_state_->url_request_manager_.get(),
|
||||
&io_state_->protocol_handlers_, network_session_params.host_resolver);
|
||||
&io_state_->protocol_handlers_, network_session_context.host_resolver);
|
||||
io_state_->protocol_handlers_.clear();
|
||||
|
||||
// Register internal scheme handlers that can be overridden.
|
||||
|
@ -476,7 +527,7 @@ void CefURLRequestContextGetterImpl::CreateProxyConfigService() {
|
|||
|
||||
io_state_->proxy_config_service_ =
|
||||
net::ProxyService::CreateSystemProxyConfigService(
|
||||
io_state_->io_task_runner_, io_state_->file_task_runner_);
|
||||
io_state_->io_task_runner_);
|
||||
}
|
||||
|
||||
void CefURLRequestContextGetterImpl::UpdateServerWhitelist() {
|
||||
|
|
|
@ -36,7 +36,7 @@ class ProxyConfigService;
|
|||
class URLRequestContextStorage;
|
||||
class URLRequestJobFactory;
|
||||
class URLRequestJobFactoryImpl;
|
||||
}
|
||||
} // namespace net
|
||||
|
||||
// Isolated URLRequestContextGetter implementation. Life span is primarily
|
||||
// controlled by CefResourceContext and (for the global context)
|
||||
|
@ -48,7 +48,6 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
|||
const CefRequestContextSettings& settings,
|
||||
PrefService* pref_service,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
||||
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
|
||||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
|
||||
content::URLRequestInterceptorScopedVector request_interceptors);
|
||||
|
@ -101,7 +100,6 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
|||
net::NetLog* net_log_ = nullptr; // Guaranteed to outlive this object.
|
||||
|
||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
|
||||
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
std::string gsapi_library_name_;
|
||||
|
|
|
@ -99,6 +99,7 @@ struct PopulateAxNodeAttributes {
|
|||
case ui::AX_ATTR_ACTIVEDESCENDANT_ID:
|
||||
case ui::AX_ATTR_IN_PAGE_LINK_TARGET_ID:
|
||||
case ui::AX_ATTR_ERRORMESSAGE_ID:
|
||||
case ui::AX_ATTR_DETAILS_ID:
|
||||
case ui::AX_ATTR_MEMBER_OF_ID:
|
||||
case ui::AX_ATTR_NEXT_ON_LINE_ID:
|
||||
case ui::AX_ATTR_PREVIOUS_ON_LINE_ID:
|
||||
|
@ -127,6 +128,11 @@ struct PopulateAxNodeAttributes {
|
|||
ToString(static_cast<ui::AXCheckedState>(attr.second)));
|
||||
}
|
||||
break;
|
||||
case ui::AX_ATTR_RESTRICTION:
|
||||
attributes->SetString(
|
||||
ToString(attr.first),
|
||||
ToString(static_cast<ui::AXRestriction>(attr.second)));
|
||||
break;
|
||||
case ui::AX_ATTR_SORT_DIRECTION:
|
||||
if (ui::AX_SORT_DIRECTION_NONE != attr.second) {
|
||||
attributes->SetString(
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace content {
|
||||
struct AXEventNotificationDetails;
|
||||
struct AXLocationChangeNotificationDetails;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace osr_accessibility_util {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "cc/base/switches.h"
|
||||
#include "cc/output/copy_output_request.h"
|
||||
#include "cc/scheduler/delay_based_time_source.h"
|
||||
#include "components/viz/display_compositor/gl_helper.h"
|
||||
#include "components/viz/common/gl_helper.h"
|
||||
#include "content/browser/bad_message.h"
|
||||
#include "content/browser/compositor/image_transport_factory.h"
|
||||
#include "content/browser/frame_host/render_widget_host_view_guest.h"
|
||||
|
@ -187,7 +187,7 @@ class CefCopyFrameGenerator {
|
|||
|
||||
uint8_t* pixels = static_cast<uint8_t*>(bitmap_->getPixels());
|
||||
|
||||
cc::TextureMailbox texture_mailbox;
|
||||
viz::TextureMailbox texture_mailbox;
|
||||
std::unique_ptr<cc::SingleReleaseCallback> release_callback;
|
||||
result->TakeTexture(&texture_mailbox, &release_callback);
|
||||
DCHECK(texture_mailbox.IsTexture());
|
||||
|
@ -398,7 +398,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
|
|||
compositor_.reset(
|
||||
new ui::Compositor(context_factory_private->AllocateFrameSinkId(),
|
||||
content::GetContextFactory(), context_factory_private,
|
||||
base::ThreadTaskRunnerHandle::Get()));
|
||||
base::ThreadTaskRunnerHandle::Get(),
|
||||
false /* enable_surface_synchronization */));
|
||||
compositor_->SetAcceleratedWidget(compositor_widget_);
|
||||
compositor_->SetDelegate(this);
|
||||
compositor_->SetRootLayer(root_layer_.get());
|
||||
|
@ -571,7 +572,7 @@ bool CefRenderWidgetHostViewOSR::LockMouse() {
|
|||
void CefRenderWidgetHostViewOSR::UnlockMouse() {}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
|
||||
cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink) {
|
||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) {
|
||||
renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
|
||||
if (GetDelegatedFrameHost()) {
|
||||
GetDelegatedFrameHost()->DidCreateNewRendererCompositorFrameSink(
|
||||
|
@ -580,7 +581,7 @@ void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
|
|||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
|
||||
const cc::LocalSurfaceId& local_surface_id,
|
||||
const viz::LocalSurfaceId& local_surface_id,
|
||||
cc::CompositorFrame frame) {
|
||||
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
|
||||
|
||||
|
@ -842,7 +843,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
|
|||
browser_impl_->client()->GetRenderHandler();
|
||||
if (handler.get() && handler->GetRootScreenRect(browser_impl_.get(), rc))
|
||||
return gfx::Rect(rc.x, rc.y, rc.width, rc.height);
|
||||
return gfx::Rect();
|
||||
return GetViewBounds();
|
||||
}
|
||||
|
||||
content::BrowserAccessibilityManager*
|
||||
|
@ -867,10 +868,10 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition(
|
|||
if (!render_widget_host_)
|
||||
return;
|
||||
|
||||
std::vector<blink::WebCompositionUnderline> web_underlines;
|
||||
std::vector<ui::CompositionUnderline> web_underlines;
|
||||
web_underlines.reserve(underlines.size());
|
||||
for (const CefCompositionUnderline& line : underlines) {
|
||||
web_underlines.push_back(blink::WebCompositionUnderline(
|
||||
web_underlines.push_back(ui::CompositionUnderline(
|
||||
line.range.from, line.range.to, line.color, line.thick ? true : false,
|
||||
line.background_color));
|
||||
}
|
||||
|
@ -892,9 +893,9 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
|
|||
return;
|
||||
|
||||
gfx::Range range(replacement_range.from, replacement_range.to);
|
||||
render_widget_host_->ImeCommitText(
|
||||
text, std::vector<blink::WebCompositionUnderline>(), range,
|
||||
relative_cursor_pos);
|
||||
render_widget_host_->ImeCommitText(text,
|
||||
std::vector<ui::CompositionUnderline>(),
|
||||
range, relative_cursor_pos);
|
||||
|
||||
// Stop Monitoring for composition updates after we are done.
|
||||
RequestImeCompositionUpdate(false);
|
||||
|
@ -967,7 +968,7 @@ void CefRenderWidgetHostViewOSR::ProcessGestureEvent(
|
|||
|
||||
bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpace(
|
||||
const gfx::Point& point,
|
||||
const cc::SurfaceId& original_surface,
|
||||
const viz::SurfaceId& original_surface,
|
||||
gfx::Point* transformed_point) {
|
||||
// Transformations use physical pixels rather than DIP, so conversion
|
||||
// is necessary.
|
||||
|
@ -1051,7 +1052,7 @@ CefRenderWidgetHostViewOSR::DelegatedFrameHostCreateResizeLock() {
|
|||
return base::MakeUnique<content::CompositorResizeLock>(this, desired_size);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnBeginFrame(const cc::BeginFrameArgs& args) {
|
||||
void CefRenderWidgetHostViewOSR::OnBeginFrame() {
|
||||
// TODO(cef): Maybe we can use this method in combination with
|
||||
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
|
||||
// See https://codereview.chromium.org/1841083007.
|
||||
|
@ -1302,7 +1303,7 @@ void CefRenderWidgetHostViewOSR::SendFocusEvent(bool focus) {
|
|||
browser_impl_->CancelContextMenu();
|
||||
|
||||
widget->SetActive(false);
|
||||
widget->Blur();
|
||||
widget->LostFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1498,8 +1499,8 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
|
|||
DCHECK(begin_frame_args.IsValid());
|
||||
begin_frame_number_++;
|
||||
|
||||
render_widget_host_->Send(new ViewMsg_BeginFrame(
|
||||
render_widget_host_->GetRoutingID(), begin_frame_args));
|
||||
if (renderer_compositor_frame_sink_)
|
||||
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::CancelWidget() {
|
||||
|
@ -1621,7 +1622,7 @@ void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
|
|||
}
|
||||
}
|
||||
|
||||
cc::FrameSinkId CefRenderWidgetHostViewOSR::AllocateFrameSinkId(
|
||||
viz::FrameSinkId CefRenderWidgetHostViewOSR::AllocateFrameSinkId(
|
||||
bool is_guest_view_hack) {
|
||||
// GuestViews have two RenderWidgetHostViews and so we need to make sure
|
||||
// we don't have FrameSinkId collisions.
|
||||
|
@ -1631,7 +1632,7 @@ cc::FrameSinkId CefRenderWidgetHostViewOSR::AllocateFrameSinkId(
|
|||
content::ImageTransportFactory::GetInstance();
|
||||
return is_guest_view_hack
|
||||
? factory->GetContextFactoryPrivate()->AllocateFrameSinkId()
|
||||
: cc::FrameSinkId(base::checked_cast<uint32_t>(
|
||||
: viz::FrameSinkId(base::checked_cast<uint32_t>(
|
||||
render_widget_host_->GetProcess()->GetID()),
|
||||
base::checked_cast<uint32_t>(
|
||||
render_widget_host_->GetRoutingID()));
|
||||
|
|
|
@ -38,7 +38,7 @@ class RenderWidgetHost;
|
|||
class RenderWidgetHostImpl;
|
||||
class RenderWidgetHostViewGuest;
|
||||
class BackingStore;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
class CefBeginFrameTimer;
|
||||
class CefBrowserHostImpl;
|
||||
|
@ -129,9 +129,9 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
|
||||
// RenderWidgetHostViewBase implementation.
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink)
|
||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
|
||||
override;
|
||||
void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
|
||||
void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id,
|
||||
cc::CompositorFrame frame) override;
|
||||
void ClearCompositorFrame() override;
|
||||
void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
|
||||
|
@ -146,7 +146,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
int error_code) override;
|
||||
void Destroy() override;
|
||||
void SetTooltipText(const base::string16& tooltip_text) override;
|
||||
void OnSetNeedsFlushInput() override {}
|
||||
|
||||
gfx::Size GetRequestedRendererSize() const override;
|
||||
gfx::Size GetPhysicalBackingSize() const override;
|
||||
|
@ -189,7 +188,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency) override;
|
||||
bool TransformPointToLocalCoordSpace(const gfx::Point& point,
|
||||
const cc::SurfaceId& original_surface,
|
||||
const viz::SurfaceId& original_surface,
|
||||
gfx::Point* transformed_point) override;
|
||||
bool TransformPointToCoordSpaceForView(
|
||||
const gfx::Point& point,
|
||||
|
@ -209,7 +208,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
bool DelegatedFrameCanCreateResizeLock() const override;
|
||||
std::unique_ptr<content::CompositorResizeLock>
|
||||
DelegatedFrameHostCreateResizeLock() override;
|
||||
void OnBeginFrame(const cc::BeginFrameArgs& args) override;
|
||||
void OnBeginFrame() override;
|
||||
bool IsAutoResizeEnabled() const override;
|
||||
|
||||
// CompositorResizeLockClient implementation.
|
||||
|
@ -298,7 +297,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
|
||||
void RequestImeCompositionUpdate(bool start_monitoring);
|
||||
|
||||
cc::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
|
||||
viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
|
||||
|
||||
// Applies background color without notifying the RenderWidget about
|
||||
// opaqueness changes.
|
||||
|
@ -378,7 +377,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
|||
gfx::Vector2dF last_scroll_offset_;
|
||||
bool is_scroll_offset_changed_pending_;
|
||||
|
||||
cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ =
|
||||
cc::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ =
|
||||
nullptr;
|
||||
|
||||
base::WeakPtrFactory<CefRenderWidgetHostViewOSR> weak_ptr_factory_;
|
||||
|
|
|
@ -44,11 +44,7 @@ class MacHelper : public content::BrowserCompositorMacClient,
|
|||
return color;
|
||||
}
|
||||
|
||||
void BrowserCompositorMacSendBeginFrame(
|
||||
const cc::BeginFrameArgs& args) override {
|
||||
view_->render_widget_host()->Send(new ViewMsg_BeginFrame(
|
||||
view_->render_widget_host()->GetRoutingID(), args));
|
||||
}
|
||||
void BrowserCompositorMacOnBeginFrame() override {}
|
||||
|
||||
// AcceleratedWidgetMacNSView methods:
|
||||
|
||||
|
|
|
@ -63,12 +63,23 @@ void CefWebContentsViewOSR::StoreFocus() {}
|
|||
|
||||
void CefWebContentsViewOSR::RestoreFocus() {}
|
||||
|
||||
void CefWebContentsViewOSR::GotFocus() {
|
||||
void CefWebContentsViewOSR::GotFocus(
|
||||
content::RenderWidgetHostImpl* render_widget_host) {
|
||||
if (web_contents_) {
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
if (web_contents_impl)
|
||||
web_contents_impl->NotifyWebContentsFocused();
|
||||
web_contents_impl->NotifyWebContentsFocused(render_widget_host);
|
||||
}
|
||||
}
|
||||
|
||||
void CefWebContentsViewOSR::LostFocus(
|
||||
content::RenderWidgetHostImpl* render_widget_host) {
|
||||
if (web_contents_) {
|
||||
content::WebContentsImpl* web_contents_impl =
|
||||
static_cast<content::WebContentsImpl*>(web_contents_);
|
||||
if (web_contents_impl)
|
||||
web_contents_impl->NotifyWebContentsLostFocus(render_widget_host);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace content {
|
|||
class BrowserPluginGuest;
|
||||
class WebContents;
|
||||
class WebContentsViewDelegate;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
class CefRenderWidgetHostViewOSR;
|
||||
|
@ -69,7 +69,10 @@ class CefWebContentsViewOSR : public content::WebContentsView,
|
|||
const content::DragEventSourceInfo& event_info,
|
||||
content::RenderWidgetHostImpl* source_rwh) override;
|
||||
void UpdateDragCursor(blink::WebDragOperation operation) override;
|
||||
virtual void GotFocus() override;
|
||||
virtual void GotFocus(
|
||||
content::RenderWidgetHostImpl* render_widget_host) override;
|
||||
virtual void LostFocus(
|
||||
content::RenderWidgetHostImpl* render_widget_host) override;
|
||||
virtual void TakeFocus(bool reverse) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "chrome/browser/plugins/plugins_field_trial.h"
|
||||
#include "chrome/common/features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/content_settings/core/browser/content_settings_utils.h"
|
||||
#include "components/content_settings/core/common/content_settings_utils.h"
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
|
|
|
@ -94,8 +94,9 @@ void CefPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
|
|||
NotifyInitializationCompleted();
|
||||
}
|
||||
|
||||
void CefPrefStore::CommitPendingWrite() {
|
||||
void CefPrefStore::CommitPendingWrite(base::OnceClosure done_callback) {
|
||||
committed_ = true;
|
||||
PersistentPrefStore::CommitPendingWrite(std::move(done_callback));
|
||||
}
|
||||
|
||||
void CefPrefStore::SchedulePendingLossyWrites() {}
|
||||
|
|
|
@ -45,7 +45,7 @@ class CefPrefStore : public PersistentPrefStore {
|
|||
PrefReadError GetReadError() const override;
|
||||
PersistentPrefStore::PrefReadError ReadPrefs() override;
|
||||
void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override;
|
||||
void CommitPendingWrite() override;
|
||||
virtual void CommitPendingWrite(base::OnceClosure done_callback) override;
|
||||
void SchedulePendingLossyWrites() override;
|
||||
|
||||
// Marks the store as having completed initialization.
|
||||
|
|
|
@ -173,8 +173,11 @@ void CefPrintViewManagerBase::OnDidPrintPage(
|
|||
document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf"));
|
||||
|
||||
const auto& settings = document->settings();
|
||||
if ((settings.printer_is_ps2() || settings.printer_is_ps3()) &&
|
||||
!base::FeatureList::IsEnabled(features::kDisablePostScriptPrinting)) {
|
||||
if (settings.printer_is_textonly()) {
|
||||
print_job_->StartPdfToTextConversion(bytes, params.page_size);
|
||||
} else if ((settings.printer_is_ps2() || settings.printer_is_ps3()) &&
|
||||
!base::FeatureList::IsEnabled(
|
||||
features::kDisablePostScriptPrinting)) {
|
||||
print_job_->StartPdfToPostScriptConversion(bytes, params.content_area,
|
||||
params.physical_offsets,
|
||||
settings.printer_is_ps2());
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "libcef/common/extensions/extensions_util.h"
|
||||
|
||||
#include "base/guid.h"
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
|
||||
#include "content/public/browser/plugin_service.h"
|
||||
|
|
|
@ -191,7 +191,7 @@ void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {}
|
|||
|
||||
void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
|
||||
int session_id,
|
||||
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
|
||||
base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
|
||||
const content::SpeechRecognitionSessionContext& context =
|
||||
|
@ -200,7 +200,8 @@ void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
|
|||
// Make sure that initiators properly set the |render_process_id| field.
|
||||
DCHECK_NE(context.render_process_id, 0);
|
||||
|
||||
callback.Run(false, true);
|
||||
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
||||
base::BindOnce(std::move(callback), false, true));
|
||||
}
|
||||
|
||||
content::SpeechRecognitionEventListener*
|
||||
|
|
|
@ -42,7 +42,8 @@ class CefSpeechRecognitionManagerDelegate
|
|||
// SpeechRecognitionManagerDelegate methods.
|
||||
void CheckRecognitionIsAllowed(
|
||||
int session_id,
|
||||
base::Callback<void(bool ask_user, bool is_allowed)> callback) override;
|
||||
base::OnceCallback<void(bool ask_user, bool is_allowed)> callback)
|
||||
override;
|
||||
content::SpeechRecognitionEventListener* GetEventListener() override;
|
||||
bool FilterProfanities(int render_process_id) override;
|
||||
|
||||
|
|
|
@ -103,6 +103,15 @@ CefStoragePartitionProxy::GetBluetoothAllowedDevicesMap() {
|
|||
return parent_->GetBluetoothAllowedDevicesMap();
|
||||
}
|
||||
|
||||
content::BlobURLLoaderFactory*
|
||||
CefStoragePartitionProxy::GetBlobURLLoaderFactory() {
|
||||
return parent_->GetBlobURLLoaderFactory();
|
||||
}
|
||||
|
||||
content::BlobRegistryWrapper* CefStoragePartitionProxy::GetBlobRegistry() {
|
||||
return parent_->GetBlobRegistry();
|
||||
}
|
||||
|
||||
void CefStoragePartitionProxy::ClearDataForOrigin(
|
||||
uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
|
|
|
@ -42,6 +42,8 @@ class CefStoragePartitionProxy : public content::StoragePartition {
|
|||
content::PaymentAppContextImpl* GetPaymentAppContext() override;
|
||||
content::BroadcastChannelProvider* GetBroadcastChannelProvider() override;
|
||||
content::BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
|
||||
content::BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
|
||||
content::BlobRegistryWrapper* GetBlobRegistry() override;
|
||||
void ClearDataForOrigin(uint32_t remove_mask,
|
||||
uint32_t quota_storage_remove_mask,
|
||||
const GURL& storage_origin,
|
||||
|
|
|
@ -53,11 +53,11 @@ CefBoxLayoutImpl::CefBoxLayoutImpl(const CefBoxLayoutSettings& settings)
|
|||
: settings_(settings) {}
|
||||
|
||||
views::BoxLayout* CefBoxLayoutImpl::CreateLayout() {
|
||||
views::BoxLayout* layout =
|
||||
new views::BoxLayout(settings_.horizontal ? views::BoxLayout::kHorizontal
|
||||
views::BoxLayout* layout = new views::BoxLayout(
|
||||
settings_.horizontal ? views::BoxLayout::kHorizontal
|
||||
: views::BoxLayout::kVertical,
|
||||
settings_.inside_border_horizontal_spacing,
|
||||
settings_.inside_border_vertical_spacing,
|
||||
gfx::Insets(settings_.inside_border_vertical_spacing,
|
||||
settings_.inside_border_horizontal_spacing),
|
||||
settings_.between_child_spacing);
|
||||
layout->set_main_axis_alignment(
|
||||
static_cast<views::BoxLayout::MainAxisAlignment>(
|
||||
|
|
|
@ -653,8 +653,7 @@ CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::RequestFocus() {
|
|||
|
||||
CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetBackgroundColor(cef_color_t color) {
|
||||
CEF_REQUIRE_VALID_RETURN_VOID();
|
||||
content_view()->set_background(
|
||||
views::Background::CreateSolidBackground(color));
|
||||
content_view()->SetBackground(views::CreateSolidBackground(color));
|
||||
}
|
||||
|
||||
CEF_VIEW_IMPL_T cef_color_t CEF_VIEW_IMPL_D::GetBackgroundColor() {
|
||||
|
|
|
@ -43,8 +43,8 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
|
|||
// views::View-derived methods here.
|
||||
virtual void Initialize() {
|
||||
// Use our defaults instead of the Views framework defaults.
|
||||
ParentClass::set_background(views::Background::CreateSolidBackground(
|
||||
view_util::kDefaultBackgroundColor));
|
||||
ParentClass::SetBackground(
|
||||
views::CreateSolidBackground(view_util::kDefaultBackgroundColor));
|
||||
}
|
||||
|
||||
// Returns the CefViewDelegate-derived delegate associated with this view.
|
||||
|
@ -63,7 +63,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
|
|||
}
|
||||
|
||||
// views::View methods:
|
||||
gfx::Size GetPreferredSize() const override;
|
||||
gfx::Size CalculatePreferredSize() const override;
|
||||
gfx::Size GetMinimumSize() const override;
|
||||
gfx::Size GetMaximumSize() const override;
|
||||
int GetHeightForWidth(int w) const override;
|
||||
|
@ -87,7 +87,7 @@ CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass {
|
|||
CefViewDelegateClass* cef_delegate_;
|
||||
};
|
||||
|
||||
CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::GetPreferredSize() const {
|
||||
CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::CalculatePreferredSize() const {
|
||||
gfx::Size result;
|
||||
if (cef_delegate()) {
|
||||
CefSize cef_size = cef_delegate()->GetPreferredSize(GetCefView());
|
||||
|
@ -95,7 +95,7 @@ CEF_VIEW_VIEW_T gfx::Size CEF_VIEW_VIEW_D::GetPreferredSize() const {
|
|||
result = gfx::Size(cef_size.width, cef_size.height);
|
||||
}
|
||||
if (result.IsEmpty())
|
||||
result = ParentClass::GetPreferredSize();
|
||||
result = ParentClass::CalculatePreferredSize();
|
||||
if (result.IsEmpty()) {
|
||||
// Some layouts like BoxLayout expect the preferred size to be non-empty.
|
||||
// The user may have set the size explicitly. Therefore return the current
|
||||
|
@ -142,7 +142,7 @@ CEF_VIEW_VIEW_T int CEF_VIEW_VIEW_D::GetHeightForWidth(int w) const {
|
|||
// Some layouts like FillLayout will ignore the preferred size if this view
|
||||
// has no children. We want to use the preferred size if not otherwise
|
||||
// specified.
|
||||
result = GetPreferredSize().height();
|
||||
result = ParentClass::GetPreferredSize().height();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ class CaptionlessFrameView : public views::NonClientFrameView {
|
|||
client_view_bounds_.SetRect(0, 0, width(), height());
|
||||
}
|
||||
|
||||
gfx::Size GetPreferredSize() const override {
|
||||
gfx::Size CalculatePreferredSize() const override {
|
||||
return widget_->non_client_view()
|
||||
->GetWindowBoundsForClientBounds(
|
||||
gfx::Rect(widget_->client_view()->GetPreferredSize()))
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
// can be found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/x509_certificate_impl.h"
|
||||
|
||||
#include "libcef/browser/x509_cert_principal_impl.h"
|
||||
#include "libcef/common/time_util.h"
|
||||
|
||||
#include "net/ssl/ssl_private_key.h"
|
||||
|
||||
namespace {
|
||||
|
||||
CefRefPtr<CefBinaryValue> EncodeCertificate(
|
||||
|
@ -24,6 +27,10 @@ CefRefPtr<CefBinaryValue> EncodeCertificate(
|
|||
|
||||
} // namespace
|
||||
|
||||
CefX509CertificateImpl::CefX509CertificateImpl(
|
||||
std::unique_ptr<net::ClientCertIdentity> identity)
|
||||
: identity_(std::move(identity)), cert_(identity_->certificate()) {}
|
||||
|
||||
CefX509CertificateImpl::CefX509CertificateImpl(
|
||||
scoped_refptr<net::X509Certificate> cert)
|
||||
: cert_(cert) {}
|
||||
|
@ -92,6 +99,15 @@ size_t CefX509CertificateImpl::GetIssuerChainSize() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void CefX509CertificateImpl::AcquirePrivateKey(
|
||||
const base::Callback<void(scoped_refptr<net::SSLPrivateKey>)>&
|
||||
private_key_callback) {
|
||||
if (identity_)
|
||||
identity_->AcquirePrivateKey(private_key_callback);
|
||||
else
|
||||
private_key_callback.Run(nullptr);
|
||||
}
|
||||
|
||||
void CefX509CertificateImpl::GetEncodedIssuerChain(
|
||||
CefX509Certificate::IssuerChainBinaryList& chain,
|
||||
bool der) {
|
||||
|
|
|
@ -8,13 +8,19 @@
|
|||
|
||||
#include "include/cef_x509_certificate.h"
|
||||
|
||||
#include "net/cert/x509_certificate.h"
|
||||
#include <memory>
|
||||
|
||||
#include "net/ssl/client_cert_identity.h"
|
||||
|
||||
// CefX509Certificate implementation
|
||||
class CefX509CertificateImpl : public CefX509Certificate {
|
||||
public:
|
||||
explicit CefX509CertificateImpl(scoped_refptr<net::X509Certificate> cert);
|
||||
|
||||
// Used with CefContentBrowserClient::SelectClientCertificate only.
|
||||
explicit CefX509CertificateImpl(
|
||||
std::unique_ptr<net::ClientCertIdentity> identity);
|
||||
|
||||
// CefX509Certificate methods.
|
||||
CefRefPtr<CefX509CertPrincipal> GetSubject() override;
|
||||
CefRefPtr<CefX509CertPrincipal> GetIssuer() override;
|
||||
|
@ -28,10 +34,14 @@ class CefX509CertificateImpl : public CefX509Certificate {
|
|||
void GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) override;
|
||||
|
||||
scoped_refptr<net::X509Certificate> GetInternalCertObject() { return cert_; }
|
||||
void AcquirePrivateKey(
|
||||
const base::Callback<void(scoped_refptr<net::SSLPrivateKey>)>&
|
||||
private_key_callback);
|
||||
|
||||
private:
|
||||
void GetEncodedIssuerChain(IssuerChainBinaryList& chain, bool der);
|
||||
|
||||
std::unique_ptr<net::ClientCertIdentity> identity_;
|
||||
scoped_refptr<net::X509Certificate> cert_;
|
||||
IssuerChainBinaryList pem_encoded_issuer_chain_;
|
||||
IssuerChainBinaryList der_encoded_issuer_chain_;
|
||||
|
|
|
@ -123,7 +123,7 @@ IPC_STRUCT_BEGIN(CefMsg_LoadRequest_Params)
|
|||
// The URL to send in the "Referer" header field. Can be empty if there is
|
||||
// no referrer.
|
||||
IPC_STRUCT_MEMBER(GURL, referrer)
|
||||
// One of the blink::WebReferrerPolicy values.
|
||||
// One of the cef_referrer_policy_t values.
|
||||
IPC_STRUCT_MEMBER(int, referrer_policy)
|
||||
|
||||
// Identifies the frame within the RenderView that sent the request.
|
||||
|
|
|
@ -2,9 +2,21 @@
|
|||
"name": "content_browser",
|
||||
"display_name": "CEF",
|
||||
"interface_provider_specs": {
|
||||
"service_manager:connector": {
|
||||
"provides": {
|
||||
"renderer": [
|
||||
"blink::mojom::BudgetService",
|
||||
"metrics::mojom::LeakDetector",
|
||||
"mojom::ModuleEventSink",
|
||||
"spellcheck::mojom::SpellCheckHost",
|
||||
"startup_metric_utils::mojom::StartupMetricHost"
|
||||
]
|
||||
}
|
||||
},
|
||||
"navigation:frame": {
|
||||
"provides": {
|
||||
"renderer": [
|
||||
"blink::mojom::BudgetService",
|
||||
"extensions::KeepAlive",
|
||||
"extensions::mime_handler::MimeHandlerService"
|
||||
]
|
||||
|
|
|
@ -90,42 +90,6 @@ class FileElementReader : public net::UploadFileElementReader {
|
|||
DISALLOW_COPY_AND_ASSIGN(FileElementReader);
|
||||
};
|
||||
|
||||
// GetURLRequestReferrerPolicy() and GetURLRequestReferrer() are based on
|
||||
// SetReferrerForRequest() from
|
||||
// content/browser/loader/resource_dispatcher_host_impl.cc
|
||||
|
||||
net::URLRequest::ReferrerPolicy GetURLRequestReferrerPolicy(
|
||||
cef_referrer_policy_t policy) {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
net::URLRequest::ReferrerPolicy net_referrer_policy =
|
||||
net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
switch (static_cast<blink::WebReferrerPolicy>(policy)) {
|
||||
case blink::kWebReferrerPolicyAlways:
|
||||
case blink::kWebReferrerPolicyNever:
|
||||
case blink::kWebReferrerPolicyOrigin:
|
||||
net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER;
|
||||
break;
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngrade:
|
||||
net_referrer_policy =
|
||||
net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
break;
|
||||
case blink::kWebReferrerPolicyOriginWhenCrossOrigin:
|
||||
net_referrer_policy =
|
||||
net::URLRequest::ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN;
|
||||
break;
|
||||
case blink::kWebReferrerPolicyDefault:
|
||||
default:
|
||||
net_referrer_policy =
|
||||
command_line->HasSwitch(switches::kReducedReferrerGranularity)
|
||||
? net::URLRequest::
|
||||
REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN
|
||||
: net::URLRequest::
|
||||
CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
break;
|
||||
}
|
||||
return net_referrer_policy;
|
||||
}
|
||||
|
||||
std::string GetURLRequestReferrer(const GURL& referrer_url) {
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (!referrer_url.is_valid() ||
|
||||
|
@ -251,6 +215,11 @@ CefRefPtr<CefRequest> CefRequest::Create() {
|
|||
// CefRequestImpl -------------------------------------------------------------
|
||||
|
||||
CefRequestImpl::CefRequestImpl() : read_only_(false), track_changes_(false) {
|
||||
// Verify that our enum matches Chromium's values.
|
||||
static_assert(
|
||||
REFERRER_POLICY_LAST_VALUE == net::URLRequest::MAX_REFERRER_POLICY,
|
||||
"enum mismatch");
|
||||
|
||||
base::AutoLock lock_scope(lock_);
|
||||
Reset();
|
||||
}
|
||||
|
@ -422,30 +391,8 @@ void CefRequestImpl::Set(net::URLRequest* request) {
|
|||
// instance WebCore::FrameLoader::HideReferrer.
|
||||
if (referrer.is_valid()) {
|
||||
referrer_url_ = referrer;
|
||||
switch (request->referrer_policy()) {
|
||||
case net::URLRequest::
|
||||
CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
referrer_policy_ = REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE;
|
||||
break;
|
||||
case net::URLRequest::
|
||||
REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
referrer_policy_ = REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN;
|
||||
break;
|
||||
case net::URLRequest::ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
referrer_policy_ = REFERRER_POLICY_ORIGIN_WHEN_CROSS_ORIGIN;
|
||||
break;
|
||||
case net::URLRequest::NEVER_CLEAR_REFERRER:
|
||||
referrer_policy_ = REFERRER_POLICY_ALWAYS;
|
||||
break;
|
||||
case net::URLRequest::ORIGIN:
|
||||
referrer_policy_ = REFERRER_POLICY_ORIGIN;
|
||||
break;
|
||||
case net::URLRequest::NO_REFERRER:
|
||||
referrer_policy_ = REFERRER_POLICY_NEVER;
|
||||
break;
|
||||
case net::URLRequest::MAX_REFERRER_POLICY:
|
||||
break;
|
||||
}
|
||||
referrer_policy_ =
|
||||
static_cast<cef_referrer_policy_t>(request->referrer_policy());
|
||||
}
|
||||
|
||||
// Transfer request headers.
|
||||
|
@ -477,7 +424,8 @@ void CefRequestImpl::Get(net::URLRequest* request, bool changed_only) const {
|
|||
|
||||
if (ShouldSet(kChangedReferrer, changed_only)) {
|
||||
request->SetReferrer(GetURLRequestReferrer(referrer_url_));
|
||||
request->set_referrer_policy(GetURLRequestReferrerPolicy(referrer_policy_));
|
||||
request->set_referrer_policy(
|
||||
static_cast<net::URLRequest::ReferrerPolicy>(referrer_policy_));
|
||||
}
|
||||
|
||||
if (ShouldSet(kChangedHeaderMap, changed_only)) {
|
||||
|
@ -516,7 +464,7 @@ void CefRequestImpl::Set(
|
|||
content::Referrer::SanitizeForRequest(params.url(), params.referrer());
|
||||
referrer_url_ = sanitized_referrer.url;
|
||||
referrer_policy_ =
|
||||
static_cast<cef_referrer_policy_t>(sanitized_referrer.policy);
|
||||
BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy);
|
||||
|
||||
resource_type_ = is_main_frame ? RT_MAIN_FRAME : RT_SUB_FRAME;
|
||||
transition_type_ =
|
||||
|
@ -536,7 +484,7 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
|
|||
|
||||
::GetHeaderMap(request, headermap_, referrer_url_);
|
||||
referrer_policy_ =
|
||||
static_cast<cef_referrer_policy_t>(request.GetReferrerPolicy());
|
||||
BlinkReferrerPolicyToNetReferrerPolicy(request.GetReferrerPolicy());
|
||||
|
||||
const blink::WebHTTPBody& body = request.HttpBody();
|
||||
if (!body.IsNull()) {
|
||||
|
@ -565,11 +513,11 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
|
|||
if (!referrer_url_.is_empty()) {
|
||||
const blink::WebString& referrer =
|
||||
blink::WebSecurityPolicy::GenerateReferrerHeader(
|
||||
static_cast<blink::WebReferrerPolicy>(referrer_policy_), url_,
|
||||
NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_), url_,
|
||||
blink::WebString::FromUTF8(referrer_url_.spec()));
|
||||
if (!referrer.IsEmpty()) {
|
||||
request.SetHTTPReferrer(
|
||||
referrer, static_cast<blink::WebReferrerPolicy>(referrer_policy_));
|
||||
referrer, NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -616,11 +564,14 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
|
|||
if (params.referrer.is_valid()) {
|
||||
const blink::WebString& referrer =
|
||||
blink::WebSecurityPolicy::GenerateReferrerHeader(
|
||||
static_cast<blink::WebReferrerPolicy>(params.referrer_policy),
|
||||
NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
static_cast<cef_referrer_policy_t>(params.referrer_policy)),
|
||||
params.url, blink::WebString::FromUTF8(params.referrer.spec()));
|
||||
if (!referrer.IsEmpty()) {
|
||||
request.SetHTTPReferrer(referrer, static_cast<blink::WebReferrerPolicy>(
|
||||
params.referrer_policy));
|
||||
request.SetHTTPReferrer(
|
||||
referrer,
|
||||
NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
static_cast<cef_referrer_policy_t>(params.referrer_policy)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -691,7 +642,7 @@ void CefRequestImpl::Get(CefNavigateParams& params) const {
|
|||
// Referrer policy will be applied later in the request pipeline.
|
||||
params.referrer.url = referrer_url_;
|
||||
params.referrer.policy =
|
||||
static_cast<blink::WebReferrerPolicy>(referrer_policy_);
|
||||
NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_);
|
||||
|
||||
if (!headermap_.empty())
|
||||
params.headers = HttpHeaderUtils::GenerateHeaders(headermap_);
|
||||
|
@ -712,7 +663,8 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher,
|
|||
|
||||
if (!referrer_url_.is_empty()) {
|
||||
fetcher.SetReferrer(GetURLRequestReferrer(referrer_url_));
|
||||
fetcher.SetReferrerPolicy(GetURLRequestReferrerPolicy(referrer_policy_));
|
||||
fetcher.SetReferrerPolicy(
|
||||
static_cast<net::URLRequest::ReferrerPolicy>(referrer_policy_));
|
||||
}
|
||||
|
||||
CefRequest::HeaderMap headerMap = headermap_;
|
||||
|
@ -826,6 +778,63 @@ uint8_t CefRequestImpl::GetChanges() const {
|
|||
return changes;
|
||||
}
|
||||
|
||||
// From content/child/web_url_loader_impl.cc
|
||||
// static
|
||||
blink::WebReferrerPolicy CefRequestImpl::NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
cef_referrer_policy_t net_policy) {
|
||||
switch (net_policy) {
|
||||
case REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
return blink::kWebReferrerPolicyNoReferrerWhenDowngrade;
|
||||
case REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::
|
||||
kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin;
|
||||
case REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::kWebReferrerPolicyOriginWhenCrossOrigin;
|
||||
case REFERRER_POLICY_NEVER_CLEAR_REFERRER:
|
||||
return blink::kWebReferrerPolicyAlways;
|
||||
case REFERRER_POLICY_ORIGIN:
|
||||
return blink::kWebReferrerPolicyOrigin;
|
||||
case REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN:
|
||||
return blink::kWebReferrerPolicySameOrigin;
|
||||
case REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE:
|
||||
return blink::kWebReferrerPolicyStrictOrigin;
|
||||
case REFERRER_POLICY_NO_REFERRER:
|
||||
return blink::kWebReferrerPolicyNever;
|
||||
case REFERRER_POLICY_LAST_VALUE:
|
||||
NOTREACHED();
|
||||
return blink::kWebReferrerPolicyDefault;
|
||||
}
|
||||
NOTREACHED();
|
||||
return blink::kWebReferrerPolicyDefault;
|
||||
}
|
||||
|
||||
// static
|
||||
cef_referrer_policy_t CefRequestImpl::BlinkReferrerPolicyToNetReferrerPolicy(
|
||||
blink::WebReferrerPolicy blink_policy) {
|
||||
switch (blink_policy) {
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngrade:
|
||||
return REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin:
|
||||
return REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyOriginWhenCrossOrigin:
|
||||
return REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyAlways:
|
||||
return REFERRER_POLICY_NEVER_CLEAR_REFERRER;
|
||||
case blink::kWebReferrerPolicyOrigin:
|
||||
return REFERRER_POLICY_ORIGIN;
|
||||
case blink::kWebReferrerPolicySameOrigin:
|
||||
return REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN;
|
||||
case blink::kWebReferrerPolicyStrictOrigin:
|
||||
return REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
|
||||
case blink::kWebReferrerPolicyNever:
|
||||
return REFERRER_POLICY_NO_REFERRER;
|
||||
case blink::kWebReferrerPolicyDefault:
|
||||
return REFERRER_POLICY_DEFAULT;
|
||||
}
|
||||
NOTREACHED();
|
||||
return REFERRER_POLICY_DEFAULT;
|
||||
}
|
||||
|
||||
void CefRequestImpl::Changed(uint8_t changes) {
|
||||
lock_.AssertAcquired();
|
||||
if (track_changes_)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "third_party/WebKit/public/platform/WebHTTPBody.h"
|
||||
#include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace navigation_interception {
|
||||
|
@ -28,11 +29,11 @@ class UploadElement;
|
|||
class UploadElementReader;
|
||||
class URLFetcher;
|
||||
class URLRequest;
|
||||
};
|
||||
}; // namespace net
|
||||
|
||||
namespace blink {
|
||||
class WebURLRequest;
|
||||
}
|
||||
} // namespace blink
|
||||
|
||||
struct CefMsg_LoadRequest_Params;
|
||||
struct CefNavigateParams;
|
||||
|
@ -118,6 +119,11 @@ class CefRequestImpl : public CefRequest {
|
|||
void SetTrackChanges(bool track_changes);
|
||||
uint8_t GetChanges() const;
|
||||
|
||||
static blink::WebReferrerPolicy NetReferrerPolicyToBlinkReferrerPolicy(
|
||||
cef_referrer_policy_t net_policy);
|
||||
static cef_referrer_policy_t BlinkReferrerPolicyToNetReferrerPolicy(
|
||||
blink::WebReferrerPolicy blink_policy);
|
||||
|
||||
private:
|
||||
void Changed(uint8_t changes);
|
||||
bool ShouldSet(uint8_t changes, bool changed_only) const;
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
CefResponseManager::CefResponseManager() : next_request_id_(0) {}
|
||||
|
||||
int CefResponseManager::GetNextRequestId() {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
return ++next_request_id_;
|
||||
}
|
||||
|
||||
int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
int request_id = GetNextRequestId();
|
||||
TRACE_EVENT_ASYNC_BEGIN1("libcef", "CefResponseManager::Handler", request_id,
|
||||
"request_id", request_id);
|
||||
|
@ -24,7 +24,7 @@ int CefResponseManager::RegisterHandler(CefRefPtr<Handler> handler) {
|
|||
}
|
||||
|
||||
bool CefResponseManager::RunHandler(const Cef_Response_Params& params) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK_GT(params.request_id, 0);
|
||||
HandlerMap::iterator it = handlers_.find(params.request_id);
|
||||
if (it != handlers_.end()) {
|
||||
|
@ -42,12 +42,12 @@ bool CefResponseManager::RunHandler(const Cef_Response_Params& params) {
|
|||
|
||||
void CefResponseManager::RegisterAckHandler(int request_id,
|
||||
CefRefPtr<AckHandler> handler) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
ack_handlers_.insert(std::make_pair(request_id, handler));
|
||||
}
|
||||
|
||||
bool CefResponseManager::RunAckHandler(int request_id) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK_GT(request_id, 0);
|
||||
AckHandlerMap::iterator it = ack_handlers_.find(request_id);
|
||||
if (it != ack_handlers_.end()) {
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
#include "base/threading/non_thread_safe.h"
|
||||
#include "base/sequence_checker.h"
|
||||
|
||||
struct Cef_Response_Params;
|
||||
|
||||
// This class is not thread-safe.
|
||||
class CefResponseManager : base::NonThreadSafe {
|
||||
class CefResponseManager {
|
||||
public:
|
||||
// Used for handling response messages.
|
||||
class Handler : public virtual CefBaseRefCounted {
|
||||
|
@ -59,6 +59,8 @@ class CefResponseManager : base::NonThreadSafe {
|
|||
// Map of unique request ids to AckHandler references.
|
||||
typedef std::map<int, CefRefPtr<AckHandler>> AckHandlerMap;
|
||||
AckHandlerMap ack_handlers_;
|
||||
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_RESPONSE_MANAGER_H_
|
||||
|
|
|
@ -28,7 +28,7 @@ CefRefPtr<CefThread> CefThread::CreateThread(
|
|||
cef_message_loop_type_t message_loop_type,
|
||||
bool stoppable,
|
||||
cef_com_init_mode_t com_init_mode) {
|
||||
if (!base::MessageLoop::current()) {
|
||||
if (!CefTaskRunnerImpl::GetCurrentTaskRunner()) {
|
||||
NOTREACHED() << "called on invalid thread";
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
|
||||
using blink::WebFrame;
|
||||
using blink::WebLocalFrame;
|
||||
using blink::WebScriptSource;
|
||||
using blink::WebString;
|
||||
using blink::WebURL;
|
||||
|
@ -108,26 +109,35 @@ bool CefBrowserImpl::IsLoading() {
|
|||
void CefBrowserImpl::Reload() {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame()) {
|
||||
render_view()->GetWebView()->MainFrame()->Reload(
|
||||
blink::WebFrameLoadType::kReload);
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
main_frame->ToWebLocalFrame()->Reload(blink::WebFrameLoadType::kReload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserImpl::ReloadIgnoreCache() {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame()) {
|
||||
render_view()->GetWebView()->MainFrame()->Reload(
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
main_frame->ToWebLocalFrame()->Reload(
|
||||
blink::WebFrameLoadType::kReloadBypassingCache);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserImpl::StopLoad() {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame())
|
||||
render_view()->GetWebView()->MainFrame()->StopLoading();
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
main_frame->ToWebLocalFrame()->StopLoading();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CefBrowserImpl::GetIdentifier() {
|
||||
|
@ -152,16 +162,24 @@ bool CefBrowserImpl::IsPopup() {
|
|||
bool CefBrowserImpl::HasDocument() {
|
||||
CEF_REQUIRE_RT_RETURN(false);
|
||||
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame())
|
||||
return !render_view()->GetWebView()->MainFrame()->GetDocument().IsNull();
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
return !main_frame->ToWebLocalFrame()->GetDocument().IsNull();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefFrame> CefBrowserImpl::GetMainFrame() {
|
||||
CEF_REQUIRE_RT_RETURN(nullptr);
|
||||
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame())
|
||||
return GetWebFrameImpl(render_view()->GetWebView()->MainFrame()).get();
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
return GetWebFrameImpl(main_frame->ToWebLocalFrame()).get();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -188,21 +206,24 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
|
|||
if (web_view) {
|
||||
const blink::WebString& frame_name = blink::WebString::FromUTF16(name);
|
||||
// Search by assigned frame name (Frame::name).
|
||||
WebFrame* frame =
|
||||
web_view->FindFrameByName(frame_name, web_view->MainFrame());
|
||||
WebFrame* frame = web_view->MainFrame();
|
||||
if (frame && frame->IsWebLocalFrame())
|
||||
frame = frame->ToWebLocalFrame()->FindFrameByName(frame_name);
|
||||
if (!frame) {
|
||||
// Search by unique frame name (Frame::uniqueName).
|
||||
const std::string& searchname = name;
|
||||
for (WebFrame* cur_frame = web_view->MainFrame(); cur_frame;
|
||||
cur_frame = cur_frame->TraverseNext()) {
|
||||
if (render_frame_util::GetUniqueName(cur_frame) == searchname) {
|
||||
if (cur_frame->IsWebLocalFrame() &&
|
||||
render_frame_util::GetUniqueName(cur_frame->ToWebLocalFrame()) ==
|
||||
searchname) {
|
||||
frame = cur_frame;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (frame)
|
||||
return GetWebFrameImpl(frame).get();
|
||||
if (frame && frame->IsWebLocalFrame())
|
||||
return GetWebFrameImpl(frame->ToWebLocalFrame()).get();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -232,7 +253,9 @@ 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(render_frame_util::GetIdentifier(frame));
|
||||
if (frame->IsWebLocalFrame())
|
||||
identifiers.push_back(
|
||||
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +269,9 @@ 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(render_frame_util::GetUniqueName(frame));
|
||||
if (frame->IsWebLocalFrame())
|
||||
names.push_back(
|
||||
render_frame_util::GetUniqueName(frame->ToWebLocalFrame()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +310,7 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) {
|
|||
if (!framePtr.get())
|
||||
return;
|
||||
|
||||
WebFrame* web_frame = framePtr->web_frame();
|
||||
WebLocalFrame* web_frame = framePtr->web_frame();
|
||||
|
||||
blink::WebURLRequest request;
|
||||
CefRequestImpl::Get(params, request);
|
||||
|
@ -313,7 +338,7 @@ bool CefBrowserImpl::SendProcessMessage(CefProcessId target_process,
|
|||
}
|
||||
|
||||
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
|
||||
blink::WebFrame* frame) {
|
||||
blink::WebLocalFrame* frame) {
|
||||
DCHECK(frame);
|
||||
int64_t frame_id = render_frame_util::GetIdentifier(frame);
|
||||
|
||||
|
@ -325,10 +350,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
|
||||
const int64_t parent_id = frame->Parent() == NULL
|
||||
? webkit_glue::kInvalidFrameId
|
||||
: render_frame_util::GetIdentifier(frame->Parent());
|
||||
: frame->Parent()->IsWebLocalFrame()
|
||||
? render_frame_util::GetIdentifier(
|
||||
frame->Parent()->ToWebLocalFrame())
|
||||
: webkit_glue::kInvalidFrameId;
|
||||
const base::string16& name =
|
||||
base::UTF8ToUTF16(render_frame_util::GetUniqueName(frame));
|
||||
|
||||
|
@ -340,8 +367,12 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
|
|||
|
||||
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
|
||||
if (frame_id == webkit_glue::kInvalidFrameId) {
|
||||
if (render_view()->GetWebView() && render_view()->GetWebView()->MainFrame())
|
||||
return GetWebFrameImpl(render_view()->GetWebView()->MainFrame());
|
||||
if (render_view()->GetWebView()) {
|
||||
WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
|
||||
if (main_frame && main_frame->IsWebLocalFrame()) {
|
||||
return GetWebFrameImpl(main_frame->ToWebLocalFrame());
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -354,8 +385,11 @@ 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 (render_frame_util::GetIdentifier(frame) == frame_id)
|
||||
return GetWebFrameImpl(frame);
|
||||
if (frame->IsWebLocalFrame() &&
|
||||
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) ==
|
||||
frame_id) {
|
||||
return GetWebFrameImpl(frame->ToWebLocalFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -435,7 +469,7 @@ void CefBrowserImpl::DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
|
|||
OnLoadStart(frame);
|
||||
}
|
||||
|
||||
void CefBrowserImpl::FrameDetached(WebFrame* frame) {
|
||||
void CefBrowserImpl::FrameDetached(WebLocalFrame* frame) {
|
||||
int64_t frame_id = render_frame_util::GetIdentifier(frame);
|
||||
|
||||
if (!frames_.empty()) {
|
||||
|
@ -467,9 +501,12 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) {
|
|||
const blink::WebDocument& document = node.GetDocument();
|
||||
if (!document.IsNull()) {
|
||||
blink::WebFrame* frame = document.GetFrame();
|
||||
if (!frame->IsWebLocalFrame())
|
||||
return;
|
||||
CefRefPtr<CefDOMDocumentImpl> documentImpl =
|
||||
new CefDOMDocumentImpl(this, frame);
|
||||
handler->OnFocusedNodeChanged(this, GetWebFrameImpl(frame).get(),
|
||||
new CefDOMDocumentImpl(this, frame->ToWebLocalFrame());
|
||||
handler->OnFocusedNodeChanged(
|
||||
this, GetWebFrameImpl(frame->ToWebLocalFrame()).get(),
|
||||
documentImpl->GetOrCreateNode(node));
|
||||
documentImpl->Detach();
|
||||
}
|
||||
|
@ -479,7 +516,7 @@ void CefBrowserImpl::FocusedNodeChanged(const blink::WebNode& node) {
|
|||
}
|
||||
|
||||
// Based on ExtensionHelper::DraggableRegionsChanged.
|
||||
void CefBrowserImpl::DraggableRegionsChanged(blink::WebFrame* frame) {
|
||||
void CefBrowserImpl::DraggableRegionsChanged(blink::WebLocalFrame* frame) {
|
||||
blink::WebVector<blink::WebDraggableRegion> webregions =
|
||||
frame->GetDocument().DraggableRegions();
|
||||
std::vector<Cef_DraggableRegion_Params> regions;
|
||||
|
@ -535,7 +572,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
// Execute code.
|
||||
CefRefPtr<CefFrameImpl> framePtr = GetWebFrameImpl(params.frame_id);
|
||||
if (framePtr.get()) {
|
||||
WebFrame* web_frame = framePtr->web_frame();
|
||||
WebLocalFrame* web_frame = framePtr->web_frame();
|
||||
if (web_frame) {
|
||||
DCHECK_EQ(params.arguments.GetSize(), (size_t)4);
|
||||
|
||||
|
@ -565,7 +602,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
// Execute command.
|
||||
CefRefPtr<CefFrameImpl> framePtr = GetWebFrameImpl(params.frame_id);
|
||||
if (framePtr.get()) {
|
||||
WebFrame* web_frame = framePtr->web_frame();
|
||||
WebLocalFrame* web_frame = framePtr->web_frame();
|
||||
if (web_frame) {
|
||||
DCHECK_EQ(params.arguments.GetSize(), (size_t)1);
|
||||
|
||||
|
@ -575,17 +612,13 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
DCHECK(!command.empty());
|
||||
|
||||
if (base::LowerCaseEqualsASCII(command, "getsource")) {
|
||||
if (web_frame->IsWebLocalFrame()) {
|
||||
response = blink::WebFrameContentDumper::DumpAsMarkup(
|
||||
web_frame->ToWebLocalFrame())
|
||||
.Utf8();
|
||||
response =
|
||||
blink::WebFrameContentDumper::DumpAsMarkup(web_frame).Utf8();
|
||||
success = true;
|
||||
}
|
||||
} else if (base::LowerCaseEqualsASCII(command, "gettext")) {
|
||||
response = webkit_glue::DumpDocumentText(web_frame);
|
||||
success = true;
|
||||
} else if (web_frame->IsWebLocalFrame() &&
|
||||
web_frame->ToWebLocalFrame()->ExecuteCommand(
|
||||
} else if (web_frame->ExecuteCommand(
|
||||
blink::WebString::FromUTF8(command))) {
|
||||
success = true;
|
||||
}
|
||||
|
@ -595,7 +628,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
|
|||
// Load a string.
|
||||
CefRefPtr<CefFrameImpl> framePtr = GetWebFrameImpl(params.frame_id);
|
||||
if (framePtr.get()) {
|
||||
WebFrame* web_frame = framePtr->web_frame();
|
||||
WebLocalFrame* web_frame = framePtr->web_frame();
|
||||
if (web_frame) {
|
||||
DCHECK_EQ(params.arguments.GetSize(), (size_t)2);
|
||||
|
||||
|
|
|
@ -32,8 +32,9 @@ class ListValue;
|
|||
}
|
||||
|
||||
namespace blink {
|
||||
class WebFrame;
|
||||
class WebNode;
|
||||
}
|
||||
} // namespace blink
|
||||
|
||||
// Renderer plumbing for CEF features. There is a one-to-one relationship
|
||||
// between RenderView on the renderer side and RenderViewHost on the browser
|
||||
|
@ -91,7 +92,7 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
|
|||
bool user_initiated);
|
||||
|
||||
// Returns the matching CefFrameImpl reference or creates a new one.
|
||||
CefRefPtr<CefFrameImpl> GetWebFrameImpl(blink::WebFrame* frame);
|
||||
CefRefPtr<CefFrameImpl> GetWebFrameImpl(blink::WebLocalFrame* frame);
|
||||
CefRefPtr<CefFrameImpl> GetWebFrameImpl(int64_t frame_id);
|
||||
|
||||
// Frame objects will be deleted immediately before the frame is closed.
|
||||
|
@ -114,14 +115,14 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
|
|||
const blink::WebURLError& error) override;
|
||||
void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
|
||||
bool is_new_navigation) override;
|
||||
void DraggableRegionsChanged(blink::WebFrame* frame) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// Forwarded from CefRenderFrameObserver.
|
||||
void DidFinishLoad(blink::WebLocalFrame* frame);
|
||||
void DidStartProvisionalLoad(blink::WebLocalFrame* frame);
|
||||
void FrameDetached(blink::WebFrame* frame);
|
||||
void FrameDetached(blink::WebLocalFrame* frame);
|
||||
void FocusedNodeChanged(const blink::WebNode& node);
|
||||
void DraggableRegionsChanged(blink::WebLocalFrame* frame);
|
||||
|
||||
private:
|
||||
// RenderViewObserver::OnMessageReceived message handlers.
|
||||
|
|
|
@ -282,8 +282,6 @@ void CefContentRendererClient::WebKitInitialized() {
|
|||
blink::WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(scheme);
|
||||
if (info.is_secure)
|
||||
webkit_glue::RegisterURLSchemeAsSecure(scheme);
|
||||
if (info.is_cors_enabled)
|
||||
webkit_glue::RegisterURLSchemeAsCORSEnabled(scheme);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,6 +533,9 @@ bool CefContentRendererClient::HandleNavigation(
|
|||
blink::WebNavigationType type,
|
||||
blink::WebNavigationPolicy default_policy,
|
||||
bool is_redirect) {
|
||||
if (!frame->IsWebLocalFrame())
|
||||
return false;
|
||||
|
||||
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
|
||||
if (application.get()) {
|
||||
CefRefPtr<CefRenderProcessHandler> handler =
|
||||
|
@ -543,7 +544,8 @@ bool CefContentRendererClient::HandleNavigation(
|
|||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (browserPtr.get()) {
|
||||
CefRefPtr<CefFrameImpl> framePtr = browserPtr->GetWebFrameImpl(frame);
|
||||
CefRefPtr<CefFrameImpl> framePtr =
|
||||
browserPtr->GetWebFrameImpl(frame->ToWebLocalFrame());
|
||||
CefRefPtr<CefRequest> requestPtr(CefRequest::Create());
|
||||
CefRequestImpl* requestImpl =
|
||||
static_cast<CefRequestImpl*>(requestPtr.get());
|
||||
|
@ -611,6 +613,7 @@ bool CefContentRendererClient::WillSendRequest(
|
|||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
const blink::WebURL& url,
|
||||
std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
|
||||
GURL* new_url) {
|
||||
if (extensions::ExtensionsEnabled()) {
|
||||
return extensions_renderer_client_->WillSendRequest(frame, transition_type,
|
||||
|
|
|
@ -28,7 +28,7 @@ class ExtensionsClient;
|
|||
class ExtensionsGuestViewContainerDispatcher;
|
||||
class ExtensionsRendererClient;
|
||||
class ResourceRequestPolicy;
|
||||
}
|
||||
} // namespace extensions
|
||||
|
||||
namespace web_cache {
|
||||
class WebCacheImpl;
|
||||
|
@ -110,9 +110,11 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
|||
bool is_initial_navigation,
|
||||
bool is_server_redirect,
|
||||
bool* send_referrer) override;
|
||||
bool WillSendRequest(blink::WebLocalFrame* frame,
|
||||
bool WillSendRequest(
|
||||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
const blink::WebURL& url,
|
||||
std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
|
||||
GURL* new_url) override;
|
||||
unsigned long long VisitedLinkHash(const char* canonical_url,
|
||||
size_t length) override;
|
||||
|
|
|
@ -11,20 +11,20 @@
|
|||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||
#include "third_party/WebKit/public/web/WebElement.h"
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebNode.h"
|
||||
#include "third_party/WebKit/public/web/WebRange.h"
|
||||
|
||||
using blink::WebDocument;
|
||||
using blink::WebElement;
|
||||
using blink::WebFrame;
|
||||
using blink::WebLocalFrame;
|
||||
using blink::WebNode;
|
||||
using blink::WebRange;
|
||||
using blink::WebString;
|
||||
using blink::WebURL;
|
||||
|
||||
CefDOMDocumentImpl::CefDOMDocumentImpl(CefBrowserImpl* browser, WebFrame* frame)
|
||||
CefDOMDocumentImpl::CefDOMDocumentImpl(CefBrowserImpl* browser,
|
||||
WebLocalFrame* frame)
|
||||
: browser_(browser), frame_(frame) {
|
||||
const WebDocument& document = frame_->GetDocument();
|
||||
DCHECK(!document.IsNull());
|
||||
|
@ -90,21 +90,20 @@ CefRefPtr<CefDOMNode> CefDOMDocumentImpl::GetFocusedNode() {
|
|||
}
|
||||
|
||||
bool CefDOMDocumentImpl::HasSelection() {
|
||||
if (!VerifyContext() || !frame_->IsWebLocalFrame())
|
||||
if (!VerifyContext())
|
||||
return false;
|
||||
|
||||
return frame_->ToWebLocalFrame()->HasSelection();
|
||||
return frame_->HasSelection();
|
||||
}
|
||||
|
||||
int CefDOMDocumentImpl::GetSelectionStartOffset() {
|
||||
if (!VerifyContext() || !frame_->IsWebLocalFrame())
|
||||
if (!VerifyContext())
|
||||
return 0;
|
||||
|
||||
blink::WebLocalFrame* local_frame = frame_->ToWebLocalFrame();
|
||||
if (!!local_frame->HasSelection())
|
||||
if (!frame_->HasSelection())
|
||||
return 0;
|
||||
|
||||
const WebRange& range = local_frame->SelectionRange();
|
||||
const WebRange& range = frame_->SelectionRange();
|
||||
if (range.IsNull())
|
||||
return 0;
|
||||
|
||||
|
@ -112,14 +111,13 @@ int CefDOMDocumentImpl::GetSelectionStartOffset() {
|
|||
}
|
||||
|
||||
int CefDOMDocumentImpl::GetSelectionEndOffset() {
|
||||
if (!VerifyContext() || !frame_->IsWebLocalFrame())
|
||||
if (!VerifyContext())
|
||||
return 0;
|
||||
|
||||
blink::WebLocalFrame* local_frame = frame_->ToWebLocalFrame();
|
||||
if (!!local_frame->HasSelection())
|
||||
if (!frame_->HasSelection())
|
||||
return 0;
|
||||
|
||||
const WebRange& range = local_frame->SelectionRange();
|
||||
const WebRange& range = frame_->SelectionRange();
|
||||
if (range.IsNull())
|
||||
return 0;
|
||||
|
||||
|
@ -128,14 +126,13 @@ int CefDOMDocumentImpl::GetSelectionEndOffset() {
|
|||
|
||||
CefString CefDOMDocumentImpl::GetSelectionAsMarkup() {
|
||||
CefString str;
|
||||
if (!VerifyContext() || !frame_->IsWebLocalFrame())
|
||||
if (!VerifyContext())
|
||||
return str;
|
||||
|
||||
blink::WebLocalFrame* local_frame = frame_->ToWebLocalFrame();
|
||||
if (!!local_frame->HasSelection())
|
||||
if (!frame_->HasSelection())
|
||||
return str;
|
||||
|
||||
const WebString& markup = local_frame->SelectionAsMarkup();
|
||||
const WebString& markup = frame_->SelectionAsMarkup();
|
||||
if (!markup.IsNull())
|
||||
str = markup.Utf16();
|
||||
|
||||
|
@ -144,14 +141,13 @@ CefString CefDOMDocumentImpl::GetSelectionAsMarkup() {
|
|||
|
||||
CefString CefDOMDocumentImpl::GetSelectionAsText() {
|
||||
CefString str;
|
||||
if (!VerifyContext() || !frame_->IsWebLocalFrame())
|
||||
if (!VerifyContext())
|
||||
return str;
|
||||
|
||||
blink::WebLocalFrame* local_frame = frame_->ToWebLocalFrame();
|
||||
if (!!local_frame->HasSelection())
|
||||
if (!frame_->HasSelection())
|
||||
return str;
|
||||
|
||||
const WebString& text = local_frame->SelectionAsText();
|
||||
const WebString& text = frame_->SelectionAsText();
|
||||
if (!text.IsNull())
|
||||
str = text.Utf16();
|
||||
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
#include "include/cef_dom.h"
|
||||
|
||||
namespace blink {
|
||||
class WebFrame;
|
||||
class WebLocalFrame;
|
||||
class WebNode;
|
||||
};
|
||||
}; // namespace blink
|
||||
|
||||
class CefBrowserImpl;
|
||||
|
||||
class CefDOMDocumentImpl : public CefDOMDocument {
|
||||
public:
|
||||
CefDOMDocumentImpl(CefBrowserImpl* browser, blink::WebFrame* frame);
|
||||
CefDOMDocumentImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame);
|
||||
~CefDOMDocumentImpl() override;
|
||||
|
||||
// CefDOMDocument methods.
|
||||
|
@ -38,7 +38,7 @@ class CefDOMDocumentImpl : public CefDOMDocument {
|
|||
CefString GetCompleteURL(const CefString& partialURL) override;
|
||||
|
||||
CefBrowserImpl* GetBrowser() { return browser_; }
|
||||
blink::WebFrame* GetFrame() { return frame_; }
|
||||
blink::WebLocalFrame* GetFrame() { return frame_; }
|
||||
|
||||
// The document maintains a map of all existing node objects.
|
||||
CefRefPtr<CefDOMNode> GetOrCreateNode(const blink::WebNode& node);
|
||||
|
@ -52,7 +52,7 @@ class CefDOMDocumentImpl : public CefDOMDocument {
|
|||
|
||||
protected:
|
||||
CefBrowserImpl* browser_;
|
||||
blink::WebFrame* frame_;
|
||||
blink::WebLocalFrame* frame_;
|
||||
|
||||
typedef std::map<blink::WebNode, CefDOMNode*> NodeMap;
|
||||
NodeMap node_map_;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||
#include "third_party/WebKit/public/web/WebElement.h"
|
||||
#include "third_party/WebKit/public/web/WebFormControlElement.h"
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
#include "third_party/WebKit/public/web/WebInputElement.h"
|
||||
#include "third_party/WebKit/public/web/WebNode.h"
|
||||
#include "third_party/WebKit/public/web/WebSelectElement.h"
|
||||
|
@ -26,7 +25,6 @@
|
|||
using blink::WebDocument;
|
||||
using blink::WebDOMEvent;
|
||||
using blink::WebElement;
|
||||
using blink::WebFrame;
|
||||
using blink::WebFormControlElement;
|
||||
using blink::WebInputElement;
|
||||
using blink::WebNode;
|
||||
|
|
|
@ -117,6 +117,20 @@ int CefExtensionsRendererClient::GetLowestIsolatedWorldId() const {
|
|||
return 1;
|
||||
}
|
||||
|
||||
extensions::Dispatcher* CefExtensionsRendererClient::GetDispatcher() {
|
||||
return extension_dispatcher_.get();
|
||||
}
|
||||
|
||||
void CefExtensionsRendererClient::OnExtensionLoaded(
|
||||
const extensions::Extension& extension) {
|
||||
resource_request_policy_->OnExtensionLoaded(extension);
|
||||
}
|
||||
|
||||
void CefExtensionsRendererClient::OnExtensionUnloaded(
|
||||
const extensions::ExtensionId& extension_id) {
|
||||
resource_request_policy_->OnExtensionUnloaded(extension_id);
|
||||
}
|
||||
|
||||
void CefExtensionsRendererClient::RenderThreadStarted() {
|
||||
content::RenderThread* thread = content::RenderThread::Get();
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ class WebFrame;
|
|||
class WebLocalFrame;
|
||||
struct WebPluginParams;
|
||||
class WebURL;
|
||||
}
|
||||
} // namespace blink
|
||||
|
||||
namespace content {
|
||||
class BrowserPluginDelegate;
|
||||
class RenderFrame;
|
||||
class RenderView;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace extensions {
|
||||
|
||||
|
@ -42,6 +42,10 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
|
|||
// ExtensionsRendererClient implementation.
|
||||
bool IsIncognitoProcess() const override;
|
||||
int GetLowestIsolatedWorldId() const override;
|
||||
extensions::Dispatcher* GetDispatcher() override;
|
||||
void OnExtensionLoaded(const extensions::Extension& extension) override;
|
||||
void OnExtensionUnloaded(
|
||||
const extensions::ExtensionId& extension_id) override;
|
||||
|
||||
// See CefContentRendererClient methods with the same names.
|
||||
void RenderThreadStarted();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
#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/WebLocalFrame.h"
|
||||
|
@ -35,7 +34,7 @@
|
|||
|
||||
using blink::WebString;
|
||||
|
||||
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame)
|
||||
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame)
|
||||
: browser_(browser),
|
||||
frame_(frame),
|
||||
frame_id_(render_frame_util::GetIdentifier(frame)) {}
|
||||
|
@ -82,10 +81,9 @@ void CefFrameImpl::ViewSource() {
|
|||
|
||||
void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
if (frame_ && frame_->IsWebLocalFrame()) {
|
||||
const CefString& content = std::string(
|
||||
blink::WebFrameContentDumper::DumpAsMarkup(frame_->ToWebLocalFrame())
|
||||
.Utf8());
|
||||
if (frame_) {
|
||||
const CefString& content =
|
||||
std::string(blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8());
|
||||
visitor->Visit(content);
|
||||
}
|
||||
}
|
||||
|
@ -205,8 +203,8 @@ CefRefPtr<CefFrame> CefFrameImpl::GetParent() {
|
|||
|
||||
if (frame_) {
|
||||
blink::WebFrame* parent = frame_->Parent();
|
||||
if (parent)
|
||||
return browser_->GetWebFrameImpl(parent).get();
|
||||
if (parent && parent->IsWebLocalFrame())
|
||||
return browser_->GetWebFrameImpl(parent->ToWebLocalFrame()).get();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -267,8 +265,8 @@ void CefFrameImpl::Detach() {
|
|||
|
||||
void CefFrameImpl::ExecuteCommand(const std::string& command) {
|
||||
CEF_REQUIRE_RT_RETURN_VOID();
|
||||
if (frame_ && frame_->IsWebLocalFrame())
|
||||
frame_->ToWebLocalFrame()->ExecuteCommand(WebString::FromUTF8(command));
|
||||
if (frame_)
|
||||
frame_->ExecuteCommand(WebString::FromUTF8(command));
|
||||
}
|
||||
|
||||
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
class CefBrowserImpl;
|
||||
|
||||
namespace blink {
|
||||
class WebFrame;
|
||||
class WebLocalFrame;
|
||||
}
|
||||
|
||||
// Implementation of CefFrame. CefFrameImpl objects are owned by the
|
||||
|
@ -21,7 +21,7 @@ class WebFrame;
|
|||
// associated renderer WebFrame will close.
|
||||
class CefFrameImpl : public CefFrame {
|
||||
public:
|
||||
CefFrameImpl(CefBrowserImpl* browser, blink::WebFrame* frame);
|
||||
CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame);
|
||||
~CefFrameImpl() override;
|
||||
|
||||
// CefFrame implementation.
|
||||
|
@ -54,13 +54,13 @@ class CefFrameImpl : public CefFrame {
|
|||
|
||||
void Detach();
|
||||
|
||||
blink::WebFrame* web_frame() const { return frame_; }
|
||||
blink::WebLocalFrame* web_frame() const { return frame_; }
|
||||
|
||||
private:
|
||||
void ExecuteCommand(const std::string& command);
|
||||
|
||||
CefBrowserImpl* browser_;
|
||||
blink::WebFrame* frame_;
|
||||
blink::WebLocalFrame* frame_;
|
||||
int64 frame_id_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefFrameImpl);
|
||||
|
|
|
@ -169,7 +169,10 @@ void CefPluginPlaceholder::PluginListChanged() {
|
|||
if (!render_frame() || !plugin())
|
||||
return;
|
||||
blink::WebLocalFrame* web_frame = render_frame()->GetWebFrame();
|
||||
blink::WebDocument document = web_frame->Top()->GetDocument();
|
||||
if (!web_frame->Top()->IsWebLocalFrame())
|
||||
return;
|
||||
blink::WebDocument document =
|
||||
web_frame->Top()->ToWebLocalFrame()->GetDocument();
|
||||
if (document.IsNull())
|
||||
return;
|
||||
|
||||
|
|
|
@ -73,6 +73,16 @@ void CefRenderFrameObserver::FocusedNodeChanged(const blink::WebNode& node) {
|
|||
browserPtr->FocusedNodeChanged(node);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DraggableRegionsChanged() {
|
||||
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
CefRefPtr<CefBrowserImpl> browserPtr =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
|
||||
if (!browserPtr.get())
|
||||
return;
|
||||
|
||||
browserPtr->DraggableRegionsChanged(frame);
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::DidCreateScriptContext(
|
||||
v8::Handle<v8::Context> context,
|
||||
int world_id) {
|
||||
|
|
|
@ -22,6 +22,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
|||
void FrameDetached() override;
|
||||
void FrameFocused() override;
|
||||
void FocusedNodeChanged(const blink::WebNode& node) override;
|
||||
void DraggableRegionsChanged() override;
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
int world_id) override;
|
||||
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace render_frame_util {
|
||||
|
||||
int64_t GetIdentifier(blink::WebFrame* frame) {
|
||||
int64_t GetIdentifier(blink::WebLocalFrame* frame) {
|
||||
// Each WebFrame will have an associated RenderFrame. The RenderFrame
|
||||
// routing IDs are unique within a given renderer process.
|
||||
content::RenderFrame* render_frame =
|
||||
|
@ -23,7 +23,7 @@ int64_t GetIdentifier(blink::WebFrame* frame) {
|
|||
return webkit_glue::kInvalidFrameId;
|
||||
}
|
||||
|
||||
std::string GetUniqueName(blink::WebFrame* frame) {
|
||||
std::string GetUniqueName(blink::WebLocalFrame* frame) {
|
||||
content::RenderFrameImpl* render_frame =
|
||||
content::RenderFrameImpl::FromWebFrame(frame);
|
||||
DCHECK(render_frame);
|
||||
|
@ -32,4 +32,4 @@ std::string GetUniqueName(blink::WebFrame* frame) {
|
|||
return std::string();
|
||||
}
|
||||
|
||||
} // render_frame_util
|
||||
} // namespace render_frame_util
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
#include <string>
|
||||
|
||||
namespace blink {
|
||||
class WebFrame;
|
||||
class WebLocalFrame;
|
||||
}
|
||||
|
||||
namespace render_frame_util {
|
||||
|
||||
int64_t GetIdentifier(blink::WebFrame* frame);
|
||||
std::string GetUniqueName(blink::WebFrame* frame);
|
||||
int64_t GetIdentifier(blink::WebLocalFrame* frame);
|
||||
std::string GetUniqueName(blink::WebLocalFrame* frame);
|
||||
|
||||
} // render_frame_util
|
||||
} // namespace render_frame_util
|
||||
|
||||
#endif // CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_
|
||||
|
|
|
@ -94,13 +94,19 @@ class CefRenderURLRequest::Context
|
|||
if (!url.is_valid())
|
||||
return false;
|
||||
|
||||
loader_ = blink::Platform::Current()->CreateURLLoader();
|
||||
url_client_.reset(new CefWebURLLoaderClient(this, request_->GetFlags()));
|
||||
|
||||
WebURLRequest urlRequest;
|
||||
static_cast<CefRequestImpl*>(request_.get())
|
||||
->Get(urlRequest, upload_data_size_);
|
||||
|
||||
// Set the origin to match the request. The requirement for an origin is
|
||||
// DCHECK'd in ResourceDispatcherHostImpl::ContinuePendingBeginRequest.
|
||||
urlRequest.SetRequestorOrigin(
|
||||
blink::WebSecurityOrigin::Create(urlRequest.Url()));
|
||||
|
||||
loader_ = blink::Platform::Current()->CreateURLLoader(urlRequest,
|
||||
task_runner_.get());
|
||||
loader_->LoadAsynchronously(urlRequest, url_client_.get());
|
||||
return true;
|
||||
}
|
||||
|
@ -211,7 +217,7 @@ class CefRenderURLRequest::Context
|
|||
CefRefPtr<CefRenderURLRequest> url_request_;
|
||||
CefRefPtr<CefRequest> request_;
|
||||
CefRefPtr<CefURLRequestClient> client_;
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner_;
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
||||
CefURLRequest::Status status_;
|
||||
CefURLRequest::ErrorCode error_code_;
|
||||
CefRefPtr<CefResponse> response_;
|
||||
|
|
|
@ -883,7 +883,7 @@ CefRefPtr<CefBrowser> CefV8ContextImpl::GetBrowser() {
|
|||
CefRefPtr<CefBrowser> browser;
|
||||
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(browser);
|
||||
|
||||
blink::WebFrame* webframe = GetWebFrame();
|
||||
blink::WebLocalFrame* webframe = GetWebFrame();
|
||||
if (webframe)
|
||||
browser = CefBrowserImpl::GetBrowserForMainFrame(webframe->Top());
|
||||
|
||||
|
@ -894,7 +894,7 @@ CefRefPtr<CefFrame> CefV8ContextImpl::GetFrame() {
|
|||
CefRefPtr<CefFrame> frame;
|
||||
CEF_V8_REQUIRE_VALID_HANDLE_RETURN(frame);
|
||||
|
||||
blink::WebFrame* webframe = GetWebFrame();
|
||||
blink::WebLocalFrame* webframe = GetWebFrame();
|
||||
if (webframe) {
|
||||
CefRefPtr<CefBrowserImpl> browser =
|
||||
CefBrowserImpl::GetBrowserForMainFrame(webframe->Top());
|
||||
|
@ -1023,7 +1023,7 @@ v8::Local<v8::Context> CefV8ContextImpl::GetV8Context() {
|
|||
return handle_->GetNewV8Handle();
|
||||
}
|
||||
|
||||
blink::WebFrame* CefV8ContextImpl::GetWebFrame() {
|
||||
blink::WebLocalFrame* CefV8ContextImpl::GetWebFrame() {
|
||||
CEF_REQUIRE_RT();
|
||||
|
||||
if (webkit_glue::IsScriptForbidden())
|
||||
|
|
|
@ -21,7 +21,7 @@ class CefTrackNode;
|
|||
class GURL;
|
||||
|
||||
namespace blink {
|
||||
class WebFrame;
|
||||
class WebLocalFrame;
|
||||
};
|
||||
|
||||
// Call after a V8 Isolate has been created and entered for the first time.
|
||||
|
@ -177,7 +177,7 @@ class CefV8ContextImpl : public CefV8Context {
|
|||
CefRefPtr<CefV8Exception>& exception) override;
|
||||
|
||||
v8::Local<v8::Context> GetV8Context();
|
||||
blink::WebFrame* GetWebFrame();
|
||||
blink::WebLocalFrame* GetWebFrame();
|
||||
|
||||
private:
|
||||
typedef CefV8Handle<v8::Context> Handle;
|
||||
|
|
|
@ -66,7 +66,7 @@ void GoForward(blink::WebView* view) {
|
|||
impl->Client()->NavigateBackForwardSoon(1);
|
||||
}
|
||||
|
||||
std::string DumpDocumentText(blink::WebFrame* frame) {
|
||||
std::string DumpDocumentText(blink::WebLocalFrame* frame) {
|
||||
// We use the document element's text instead of the body text here because
|
||||
// not all documents have a body, such as XML documents.
|
||||
blink::WebElement document_element = frame->GetDocument().DocumentElement();
|
||||
|
@ -201,10 +201,6 @@ void RegisterURLSchemeAsSecure(const blink::WebString& scheme) {
|
|||
blink::SchemeRegistry::RegisterURLSchemeAsSecure(scheme);
|
||||
}
|
||||
|
||||
void RegisterURLSchemeAsCORSEnabled(const blink::WebString& scheme) {
|
||||
blink::SchemeRegistry::RegisterURLSchemeAsCORSEnabled(scheme);
|
||||
}
|
||||
|
||||
struct CefScriptForbiddenScope::Impl {
|
||||
blink::ScriptForbiddenScope scope_;
|
||||
};
|
||||
|
@ -213,4 +209,4 @@ CefScriptForbiddenScope::CefScriptForbiddenScope() : impl_(new Impl()) {}
|
|||
|
||||
CefScriptForbiddenScope::~CefScriptForbiddenScope() {}
|
||||
|
||||
} // webkit_glue
|
||||
} // namespace webkit_glue
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
|
||||
namespace blink {
|
||||
class WebElement;
|
||||
class WebFrame;
|
||||
class WebLocalFrame;
|
||||
class WebNode;
|
||||
class WebString;
|
||||
class WebView;
|
||||
}
|
||||
} // namespace blink
|
||||
|
||||
namespace webkit_glue {
|
||||
|
||||
|
@ -35,7 +35,7 @@ BLINK_EXPORT void GoBack(blink::WebView* view);
|
|||
BLINK_EXPORT void GoForward(blink::WebView* view);
|
||||
|
||||
// Returns the text of the document element.
|
||||
BLINK_EXPORT std::string DumpDocumentText(blink::WebFrame* frame);
|
||||
BLINK_EXPORT std::string DumpDocumentText(blink::WebLocalFrame* frame);
|
||||
|
||||
// Expose additional actions on WebNode.
|
||||
BLINK_EXPORT cef_dom_node_type_t GetNodeType(const blink::WebNode& node);
|
||||
|
@ -67,8 +67,6 @@ BLINK_EXPORT bool IsScriptForbidden();
|
|||
|
||||
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 {
|
||||
|
@ -83,6 +81,6 @@ class BLINK_EXPORT CefScriptForbiddenScope final {
|
|||
DISALLOW_COPY_AND_ASSIGN(CefScriptForbiddenScope);
|
||||
};
|
||||
|
||||
} // webkit_glue
|
||||
} // namespace webkit_glue
|
||||
|
||||
#endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/common/chrome_utility_messages.h"
|
||||
#include "chrome/utility/utility_message_handler.h"
|
||||
#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
|
||||
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
|
||||
|
@ -26,7 +25,6 @@
|
|||
namespace {
|
||||
|
||||
void CreateProxyResolverFactory(
|
||||
const service_manager::BindSourceInfo& source_info,
|
||||
net::interfaces::ProxyResolverFactoryRequest request) {
|
||||
mojo::MakeStrongBinding(base::MakeUnique<net::MojoProxyResolverFactoryImpl>(),
|
||||
std::move(request));
|
||||
|
@ -36,7 +34,7 @@ void CreateProxyResolverFactory(
|
|||
|
||||
CefContentUtilityClient::CefContentUtilityClient() {
|
||||
#if defined(OS_WIN)
|
||||
handlers_.push_back(new printing::PrintingHandler());
|
||||
handlers_.push_back(base::MakeUnique<printing::PrintingHandler>());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -73,7 +71,7 @@ bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) {
|
|||
}
|
||||
|
||||
void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) {
|
||||
content::ServiceInfo pdf_compositor_info;
|
||||
service_manager::EmbeddedServiceInfo pdf_compositor_info;
|
||||
pdf_compositor_info.factory =
|
||||
base::Bind(&printing::CreatePdfCompositorService, std::string());
|
||||
services->emplace(printing::mojom::kServiceName, pdf_compositor_info);
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
#ifndef LIBCEF_UTILITY_CONTENT_UTILITY_CLIENT_H_
|
||||
#define LIBCEF_UTILITY_CONTENT_UTILITY_CLIENT_H_
|
||||
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "content/public/utility/content_utility_client.h"
|
||||
|
||||
class UtilityMessageHandler;
|
||||
|
@ -21,7 +23,7 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
|
|||
void RegisterServices(StaticServiceMap* services) override;
|
||||
|
||||
private:
|
||||
typedef ScopedVector<UtilityMessageHandler> Handlers;
|
||||
using Handlers = std::vector<std::unique_ptr<UtilityMessageHandler>>;
|
||||
Handlers handlers_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefContentUtilityClient);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=fa03e8ba9a443a9028246fe21a8995d8a7bdb7d5$
|
||||
// $hash=a62c6931d085746acf26926662f2b8497bd61186$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h"
|
||||
|
@ -79,10 +79,10 @@ CefRefPtr<CefAccessibilityHandler> CefCppToCRefCounted<
|
|||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount
|
||||
CefCppToCRefCounted<CefAccessibilityHandlerCppToC,
|
||||
base::AtomicRefCount CefCppToCRefCounted<
|
||||
CefAccessibilityHandlerCppToC,
|
||||
CefAccessibilityHandler,
|
||||
cef_accessibility_handler_t>::DebugObjCt = 0;
|
||||
cef_accessibility_handler_t>::DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=9f5778bffbd8c25b6f4ee2e7ec06e9eca5f9f48d$
|
||||
// $hash=0316cd113473467a653145abd66ec920256f53ce$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/app_cpptoc.h"
|
||||
|
@ -137,7 +137,8 @@ CefCppToCRefCounted<CefAppCppToC, CefApp, cef_app_t>::UnwrapDerived(
|
|||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount
|
||||
CefCppToCRefCounted<CefAppCppToC, CefApp, cef_app_t>::DebugObjCt = 0;
|
||||
CefCppToCRefCounted<CefAppCppToC, CefApp, cef_app_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=bffdd556dc95e464816b9aa0c8b46e7fadd89e5d$
|
||||
// $hash=59c6739c35bb63b28d66cc94109583eb5bd615f6$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
|
@ -71,7 +71,8 @@ CefRefPtr<CefAuthCallback> CefCppToCRefCounted<
|
|||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefAuthCallbackCppToC,
|
||||
CefAuthCallback,
|
||||
cef_auth_callback_t>::DebugObjCt = 0;
|
||||
cef_auth_callback_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -20,8 +20,8 @@ CefRefPtr<CefBaseRefCounted> CefCppToCRefCounted<
|
|||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefBaseRefCountedCppToC,
|
||||
CefBaseRefCounted,
|
||||
cef_base_ref_counted_t>::DebugObjCt =
|
||||
0;
|
||||
cef_base_ref_counted_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -24,9 +24,9 @@ CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>::
|
|||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCppToCScoped<CefBaseScopedCppToC,
|
||||
CefBaseScoped,
|
||||
cef_base_scoped_t>::DebugObjCt = 0;
|
||||
base::AtomicRefCount
|
||||
CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>::
|
||||
DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a904d37178d2bce73fdd6937cefa9f70dc352038$
|
||||
// $hash=f1065394dac333079e531be1c0868c78bdc61163$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/before_download_callback_cpptoc.h"
|
||||
|
@ -54,10 +54,10 @@ CefCppToCRefCounted<CefBeforeDownloadCallbackCppToC,
|
|||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount
|
||||
CefCppToCRefCounted<CefBeforeDownloadCallbackCppToC,
|
||||
base::AtomicRefCount CefCppToCRefCounted<
|
||||
CefBeforeDownloadCallbackCppToC,
|
||||
CefBeforeDownloadCallback,
|
||||
cef_before_download_callback_t>::DebugObjCt = 0;
|
||||
cef_before_download_callback_t>::DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=3bb896234f1b9fc0ee14f936f28b6585a82502db$
|
||||
// $hash=050a562b7dad49c1fff63b7f17adfa0670fa186a$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
|
||||
|
@ -181,7 +181,8 @@ CefCppToCRefCounted<CefBinaryValueCppToC, CefBinaryValue, cef_binary_value_t>::
|
|||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefBinaryValueCppToC,
|
||||
CefBinaryValue,
|
||||
cef_binary_value_t>::DebugObjCt = 0;
|
||||
cef_binary_value_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a5b87e4e7e656c8643febf4afb3d1bd3f06c7ac0$
|
||||
// $hash=28cdec0f8fd53a117bc9d4ea51d3bf9102ad239a$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
|
@ -394,9 +394,9 @@ CefCppToCRefCounted<CefBrowserCppToC, CefBrowser, cef_browser_t>::UnwrapDerived(
|
|||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefBrowserCppToC,
|
||||
CefBrowser,
|
||||
cef_browser_t>::DebugObjCt = 0;
|
||||
base::AtomicRefCount
|
||||
CefCppToCRefCounted<CefBrowserCppToC, CefBrowser, cef_browser_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=63aa1967a233a66852969c1e72ecd0c12e69105b$
|
||||
// $hash=1c14ea52e06cca6ef0ad5e82797b9b1cda7141b4$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
||||
|
@ -1091,7 +1091,8 @@ CefCppToCRefCounted<CefBrowserHostCppToC, CefBrowserHost, cef_browser_host_t>::
|
|||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<CefBrowserHostCppToC,
|
||||
CefBrowserHost,
|
||||
cef_browser_host_t>::DebugObjCt = 0;
|
||||
cef_browser_host_t>::DebugObjCt
|
||||
ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=81332687e151af6933a729c1456dd4b3a64f82df$
|
||||
// $hash=dc92a1083681b1f0b2c2bf42470f5421d256391c$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
|
@ -129,10 +129,10 @@ CefRefPtr<CefBrowserProcessHandler> CefCppToCRefCounted<
|
|||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount
|
||||
CefCppToCRefCounted<CefBrowserProcessHandlerCppToC,
|
||||
base::AtomicRefCount CefCppToCRefCounted<
|
||||
CefBrowserProcessHandlerCppToC,
|
||||
CefBrowserProcessHandler,
|
||||
cef_browser_process_handler_t>::DebugObjCt = 0;
|
||||
cef_browser_process_handler_t>::DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue