Commit 6df612a5 authored by Marshall Greenblatt's avatar Marshall Greenblatt
Browse files

Update to Chromium version 72.0.3615.0 (#609159)

- The |category| value for all TRACE calls from CEF client applications is now
  "cef.client" due to https://crrev.com/331266377d.
- The |with_menu_marker| parameter to CreateMenuButton has been removed due to
  https://crrev.com/7f7e382118.
parent 91a1286d
......@@ -679,11 +679,12 @@ static_library("libcef_static") {
"//components/printing/browser",
"//components/printing/common",
"//components/printing/renderer",
"//components/proxy_config",
"//components/safe_browsing/db:test_database_manager",
"//components/services/pdf_compositor:pdf_compositor_manifest",
"//components/services/pdf_compositor/public/cpp:factory",
"//components/services/pdf_compositor/public/interfaces",
"//components/proxy_config",
"//components/tracing",
"//components/update_client",
"//components/url_formatter",
"//components/user_prefs",
......@@ -713,7 +714,6 @@ static_library("libcef_static") {
"//media",
"//media/blink",
"//net",
"//net/dns:mojo_client",
"//net:net_with_v8",
"//pdf",
"//ppapi/buildflags",
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/72.0.3599.0',
'chromium_checkout': 'refs/tags/72.0.3615.0',
}
......@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2ec56bd536038f39754627b528e9b371660c6aa7$
// $hash=f895b0b0b0f2ed088af80eb94e8198eaa0c04b20$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
......@@ -85,14 +85,12 @@ typedef struct _cef_menu_button_t {
// have a visible frame at all times, center alignment, additional padding and a
// default minimum size of 70x33 DIP. If |with_frame| is false (0) the button
// will only have a visible frame on hover/press, left alignment, less padding
// and no default minimum size. If |with_menu_marker| is true (1) a menu marker
// will be added to the button.
// and no default minimum size.
///
CEF_EXPORT cef_menu_button_t* cef_menu_button_create(
struct _cef_menu_button_delegate_t* delegate,
const cef_string_t* text,
int with_frame,
int with_menu_marker);
int with_frame);
#ifdef __cplusplus
}
......
......@@ -58,15 +58,13 @@ class CefMenuButton : public CefLabelButton {
// have a visible frame at all times, center alignment, additional padding and
// a default minimum size of 70x33 DIP. If |with_frame| is false the button
// will only have a visible frame on hover/press, left alignment, less padding
// and no default minimum size. If |with_menu_marker| is true a menu marker
// will be added to the button.
// and no default minimum size.
///
/*--cef(optional_param=text)--*/
static CefRefPtr<CefMenuButton> CreateMenuButton(
CefRefPtr<CefMenuButtonDelegate> delegate,
const CefString& text,
bool with_frame,
bool with_menu_marker);
bool with_frame);
///
// Show a menu with contents |menu_model|. |screen_point| specifies the menu
......
......@@ -105,10 +105,6 @@ void CefBrowserContext::Shutdown() {
}
}
base::FilePath CefBrowserContext::GetCachePath() const {
return GetPath();
}
content::ResourceContext* CefBrowserContext::GetResourceContext() {
return resource_context_.get();
}
......
......@@ -137,7 +137,6 @@ class CefBrowserContext : public ChromeProfileStub {
virtual void Initialize();
// BrowserContext methods.
base::FilePath GetCachePath() const override;
content::ResourceContext* GetResourceContext() override;
net::URLRequestContextGetter* GetRequestContext() override;
net::URLRequestContextGetter* CreateMediaRequestContext() override;
......
......@@ -1771,8 +1771,8 @@ void CefBrowserHostImpl::SendCommand(
// Execute on the UI thread because CefResponseManager is not thread safe.
if (CEF_CURRENTLY_ON_UIT()) {
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id",
frame_id, "needsResponse", responseHandler.get() ? 1 : 0);
TRACE_EVENT2("cef", "CefBrowserHostImpl::SendCommand", "frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params;
params.name = "execute-command";
params.frame_id = frame_id;
......@@ -1810,8 +1810,8 @@ void CefBrowserHostImpl::SendCode(
// Execute on the UI thread because CefResponseManager is not thread safe.
if (CEF_CURRENTLY_ON_UIT()) {
TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id",
frame_id, "needsResponse", responseHandler.get() ? 1 : 0);
TRACE_EVENT2("cef", "CefBrowserHostImpl::SendCommand", "frame_id", frame_id,
"needsResponse", responseHandler.get() ? 1 : 0);
Cef_Request_Params params;
params.name = "execute-code";
params.frame_id = frame_id;
......
......@@ -283,7 +283,7 @@ ChromeBrowserProcessStub::safe_browsing_detection_service() {
return NULL;
}
subresource_filter::ContentRulesetService*
subresource_filter::RulesetService*
ChromeBrowserProcessStub::subresource_filter_ruleset_service() {
NOTREACHED();
return NULL;
......@@ -360,6 +360,12 @@ resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() {
return NULL;
}
resource_coordinator::ResourceCoordinatorParts*
ChromeBrowserProcessStub::resource_coordinator_parts() {
NOTREACHED();
return NULL;
}
prefs::InProcessPrefServiceFactory*
ChromeBrowserProcessStub::pref_service_factory() const {
NOTREACHED();
......
......@@ -85,8 +85,8 @@ class ChromeBrowserProcessStub : public BrowserProcess,
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
safe_browsing::ClientSideDetectionService* safe_browsing_detection_service()
override;
subresource_filter::ContentRulesetService*
subresource_filter_ruleset_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
override;
optimization_guide::OptimizationGuideService* optimization_guide_service()
override;
......@@ -105,6 +105,8 @@ class ChromeBrowserProcessStub : public BrowserProcess,
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
override;
resource_coordinator::TabManager* GetTabManager() override;
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override;
prefs::InProcessPrefServiceFactory* pref_service_factory() const override;
// BrowserContextIncognitoHelper implementation.
......
......@@ -503,10 +503,11 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
*service_request = mojo::MakeRequest(&service);
service_manager::mojom::PIDReceiverPtr pid_receiver;
service_manager::Identity renderer_identity = host->GetChildIdentity();
ChromeService::GetInstance()->connector()->StartService(
ChromeService::GetInstance()->connector()->RegisterServiceInstance(
service_manager::Identity(chrome::mojom::kRendererServiceName,
renderer_identity.user_id(),
renderer_identity.instance()),
renderer_identity.instance_group(),
renderer_identity.instance_id(),
base::Token::CreateRandom()),
std::move(service), mojo::MakeRequest(&pid_receiver));
}
......@@ -1118,7 +1119,9 @@ bool CefContentBrowserClient::HandleExternalProtocol(
content::NavigationUIData* navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture) {
bool has_user_gesture,
const std::string& method,
const net::HttpRequestHeaders& headers) {
CEF_POST_TASK(
CEF_UIT,
base::Bind(
......
......@@ -155,7 +155,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::NavigationUIData* navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture) override;
bool has_user_gesture,
const std::string& method,
const net::HttpRequestHeaders& headers) override;
// Perform browser process registration for the custom scheme.
void RegisterCustomScheme(const std::string& scheme);
......
......@@ -359,15 +359,23 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback(
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();
// Convert FilePath list to SelectedFileInfo list.
base::FilePath base_dir;
std::vector<blink::mojom::FileChooserFileInfoPtr> selected_files;
for (size_t i = 0; i < file_paths.size(); ++i) {
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
selected_files.push_back(std::move(info));
if (!file_paths.empty()) {
if (mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) {
base_dir = file_paths[0];
} else {
// Convert FilePath list to SelectedFileInfo list.
for (size_t i = 0; i < file_paths.size(); ++i) {
auto info = blink::mojom::FileChooserFileInfo::NewNativeFile(
blink::mojom::NativeFileInfo::New(file_paths[i], base::string16()));
selected_files.push_back(std::move(info));
}
}
}
listener->FileSelected(std::move(selected_files), mode);
listener->FileSelected(std::move(selected_files), base_dir, mode);
Cleanup();
}
......
......@@ -253,18 +253,23 @@ CefRefPtr<CefDictionaryValue> ToCefValue(const ui::AXNodeData& node) {
value->SetString("role", ToString(node.role));
value->SetList("state", ToCefValue(node.state));
if (node.offset_container_id != -1)
value->SetInt("offset_container_id", node.offset_container_id);
if (node.relative_bounds.offset_container_id != -1) {
value->SetInt("offset_container_id",
node.relative_bounds.offset_container_id);
}
value->SetDictionary("location", ToCefValue(node.location));
value->SetDictionary("location", ToCefValue(node.relative_bounds.bounds));
// Transform matrix is private, so we set the string that Clients can parse
// and use if needed.
if (node.transform && !node.transform->IsIdentity())
value->SetString("transform", node.transform->ToString());
if (node.relative_bounds.transform &&
!node.relative_bounds.transform->IsIdentity()) {
value->SetString("transform", node.relative_bounds.transform->ToString());
}
if (!node.child_ids.empty())
if (!node.child_ids.empty()) {
value->SetList("child_ids", ToCefValue(node.child_ids));
}
CefRefPtr<CefListValue> actions_strings;
size_t actions_idx = 0;
......
......@@ -84,17 +84,15 @@ class CefCompositorFrameSinkClient
forward_->DidReceiveCompositorFrameAck(resources);
}
void DidPresentCompositorFrame(
uint32_t presentation_token,
const gfx::PresentationFeedback& feedback) override {
forward_->DidPresentCompositorFrame(presentation_token, feedback);
void OnBeginFrame(const viz::BeginFrameArgs& args,
const base::flat_map<uint32_t, gfx::PresentationFeedback>&
feedbacks) override {
if (render_widget_host_view_) {
render_widget_host_view_->OnPresentCompositorFrame(presentation_token);
for (const auto& pair : feedbacks) {
render_widget_host_view_->OnPresentCompositorFrame(pair.first);
}
}
}
void OnBeginFrame(const viz::BeginFrameArgs& args) override {
forward_->OnBeginFrame(args);
forward_->OnBeginFrame(args, feedbacks);
}
void OnBeginFramePausedChanged(bool paused) override {
......@@ -152,7 +150,11 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
return view_->GetDeviceScaleFactor();
}
void WasEvicted() override {}
void AllocateNewSurfaceIdOnEviction() override {}
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override {
return view_->render_widget_host()->CollectSurfaceIdsForEviction();
}
private:
CefRenderWidgetHostViewOSR* const view_;
......@@ -343,7 +345,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
#if !defined(OS_MACOSX)
local_surface_id_allocator_.GenerateId();
local_surface_id_ = local_surface_id_allocator_.GetCurrentLocalSurfaceId();
local_surface_id_allocation_ =
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
delegated_frame_host_client_.reset(new CefDelegatedFrameHostClient(this));
// Matching the attributes from BrowserCompositorMac.
......@@ -487,8 +490,9 @@ void CefRenderWidgetHostViewOSR::Show() {
browser_compositor_->SetRenderWidgetHostIsHidden(false);
#else
delegated_frame_host_->AttachToCompositor(compositor_.get());
delegated_frame_host_->WasShown(GetLocalSurfaceId(),
GetRootLayer()->bounds().size(), false);
delegated_frame_host_->WasShown(
GetLocalSurfaceIdAllocation().local_surface_id(),
GetRootLayer()->bounds().size(), false);
#endif
// Note that |render_widget_host_| will retrieve size parameters from the
......@@ -656,7 +660,7 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
const viz::LocalSurfaceId& local_surface_id,
viz::CompositorFrame frame,
base::Optional<viz::HitTestRegionList> hit_test_region_list) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame");
// Update the frame rate. At this point we should have a valid connection back
// to the Synthetic Frame Source, which is important so we can actually modify
......@@ -745,7 +749,9 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
}
void CefRenderWidgetHostViewOSR::ClearCompositorFrame() {
GetDelegatedFrameHost()->ClearDelegatedFrame();
// This method is only used for content rendering timeout when surface sync is
// off.
NOTREACHED();
}
void CefRenderWidgetHostViewOSR::ResetFallbackToFirstNavigationSurface() {
......@@ -800,7 +806,7 @@ void CefRenderWidgetHostViewOSR::InitAsGuest(
void CefRenderWidgetHostViewOSR::UpdateCursor(
const content::WebCursor& cursor) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::UpdateCursor");
if (!browser_impl_.get())
return;
......@@ -828,8 +834,18 @@ void CefRenderWidgetHostViewOSR::UpdateCursor(
ui::PlatformCursor platform_cursor;
if (web_cursor.IsCustom()) {
ui::Cursor ui_cursor(ui::CursorType::kCustom);
SkBitmap bitmap;
gfx::Point hotspot;
float scale_factor;
web_cursor.CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot,
&scale_factor);
ui_cursor.set_custom_bitmap(bitmap);
ui_cursor.set_custom_hotspot(hotspot);
ui_cursor.set_device_scale_factor(scale_factor);
// |web_cursor| owns the resulting |platform_cursor|.
platform_cursor = web_cursor.GetPlatformCursor();
platform_cursor = web_cursor.GetPlatformCursor(ui_cursor);
} else {
platform_cursor = GetPlatformCursor(cursor_info.type);
}
......@@ -987,7 +1003,7 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition(
const std::vector<CefCompositionUnderline>& underlines,
const CefRange& replacement_range,
const CefRange& selection_range) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeSetComposition");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeSetComposition");
if (!render_widget_host_)
return;
......@@ -1013,7 +1029,7 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
const CefString& text,
const CefRange& replacement_range,
int relative_cursor_pos) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeCommitText");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeCommitText");
if (!render_widget_host_)
return;
......@@ -1026,7 +1042,7 @@ void CefRenderWidgetHostViewOSR::ImeCommitText(
}
void CefRenderWidgetHostViewOSR::ImeFinishComposingText(bool keep_selection) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeFinishComposingText");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeFinishComposingText");
if (!render_widget_host_)
return;
......@@ -1037,7 +1053,7 @@ void CefRenderWidgetHostViewOSR::ImeFinishComposingText(bool keep_selection) {
}
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::ImeCancelComposition");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::ImeCancelComposition");
if (!render_widget_host_)
return;
......@@ -1073,9 +1089,9 @@ void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text,
}
#if !defined(OS_MACOSX)
const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId()
const {
return local_surface_id_;
const viz::LocalSurfaceIdAllocation&
CefRenderWidgetHostViewOSR::GetLocalSurfaceIdAllocation() const {
return local_surface_id_allocation_;
}
#endif
......@@ -1195,7 +1211,7 @@ void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties() {
}
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged");
if (!render_widget_host_)
return;
......@@ -1228,8 +1244,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
void CefRenderWidgetHostViewOSR::Invalidate(
CefBrowserHost::PaintElementType type) {
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::Invalidate", "type",
type);
TRACE_EVENT1("cef", "CefRenderWidgetHostViewOSR::Invalidate", "type", type);
if (!IsPopupWidget() && type == PET_POPUP) {
if (popup_host_view_)
popup_host_view_->Invalidate(type);
......@@ -1256,7 +1271,7 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
if (renderer_compositor_frame_sink_) {
GetCompositor()->IssueExternalBeginFrame(begin_frame_args);
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args);
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args, {});
}
if (!IsPopupWidget() && popup_host_view_) {
......@@ -1266,7 +1281,7 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
void CefRenderWidgetHostViewOSR::SendKeyEvent(
const content::NativeWebKeyboardEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
if (render_widget_host_ && render_widget_host_->GetView()) {
// Direct routing requires that events go directly to the View.
render_widget_host_->ForwardKeyboardEventWithLatencyInfo(
......@@ -1280,7 +1295,7 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
void CefRenderWidgetHostViewOSR::SendMouseEvent(
const blink::WebMouseEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendMouseEvent");
if (!IsPopupWidget()) {
if (browser_impl_.get() &&
event.GetType() == blink::WebMouseEvent::kMouseDown) {
......@@ -1333,7 +1348,7 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
const blink::WebMouseWheelEvent& event) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
blink::WebMouseWheelEvent mouse_wheel_event(event);
......@@ -1452,7 +1467,7 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
int bitmap_width,
int bitmap_height,
void* bitmap_pixels) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnPaint");
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnPaint");
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
......@@ -1598,18 +1613,20 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer(bool force) {
gfx::ConvertSizeToPixel(current_device_scale_factor_, size);
local_surface_id_allocator_.GenerateId();
local_surface_id_ = local_surface_id_allocator_.GetCurrentLocalSurfaceId();
local_surface_id_allocation_ =
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
if (GetCompositor()) {
GetCompositor()->SetScaleAndSize(current_device_scale_factor_,
size_in_pixels, local_surface_id_,
base::TimeTicks());
size_in_pixels,
local_surface_id_allocation_);
}
PlatformResizeCompositorWidget(size_in_pixels);
bool resized = true;
GetDelegatedFrameHost()->EmbedSurface(
local_surface_id_, size, cc::DeadlinePolicy::UseDefaultDeadline());
local_surface_id_allocation_.local_surface_id(), size,
cc::DeadlinePolicy::UseDefaultDeadline());
#endif // !defined(OS_MACOSX)
// Note that |render_widget_host_| will retrieve resize parameters from the
......@@ -1628,7 +1645,7 @@ void CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick() {
void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
base::TimeDelta vsync_period) {
TRACE_EVENT1("libcef", "CefRenderWidgetHostViewOSR::SendBeginFrame",
TRACE_EVENT1("cef", "CefRenderWidgetHostViewOSR::SendBeginFrame",
"frame_time_us", frame_time.ToInternalValue());
base::TimeTicks display_time = frame_time + vsync_period;
......@@ -1647,8 +1664,9 @@ void CefRenderWidgetHostViewOSR::SendBeginFrame(base::TimeTicks frame_time,
DCHECK(begin_frame_args.IsValid());
begin_frame_number_++;
if (renderer_compositor_frame_sink_)
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args);
if (renderer_compositor_frame_sink_) {
renderer_compositor_frame_sink_->OnBeginFrame(begin_frame_args, {});
}
}
void CefRenderWidgetHostViewOSR::CancelWidget() {
......
......@@ -132,7 +132,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void SetActive(bool active) override;
void ShowDefinitionForSelection() override;
void SpeakSelection() override;
bool ShouldContinueToPauseForFrame() override;
#endif // defined(OS_MACOSX)
// RenderWidgetHostViewBase implementation.
......@@ -198,7 +197,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
size_t offset,
const gfx::Range& range) override;
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
const viz::LocalSurfaceIdAllocation& GetLocalSurfaceIdAllocation()
const override;
const viz::FrameSinkId& GetFrameSinkId() const override;
// ui::ExternalBeginFrameClient implementation:
......@@ -338,7 +338,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
std::unique_ptr<content::DelegatedFrameHostClient>
delegated_frame_host_client_;
std::unique_ptr<ui::Layer> root_layer_;
viz::LocalSurfaceId local_surface_id_;
viz::LocalSurfaceIdAllocation local_surface_id_allocation_;
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
#endif
......
......@@ -47,29 +47,14 @@ class MacHelper : public content::BrowserCompositorMacClient,
void DestroyCompositorForShutdown() override {}
bool SynchronizeVisualProperties(
const base::Optional<viz::LocalSurfaceId>&
child_allocated_local_surface_id,
const base::Optional<base::TimeTicks>&
child_local_surface_id_allocation_time) override {
auto* browser_compositor = view_->browser_compositor();
if (child_allocated_local_surface_id) {
browser_compositor->UpdateRendererLocalSurfaceIdFromChild(
*child_allocated_local_surface_id,
*child_local_surface_id_allocation_time);
} else {
browser_compositor->AllocateNewRendererLocalSurfaceId();
}
if (auto* host = browser_compositor->GetDelegatedFrameHost()) {
host->EmbedSurface(browser_compositor->GetRendererLocalSurfaceId(),
browser_compositor->GetRendererSize(),
cc::DeadlinePolicy::UseDefaultDeadline());
}
bool OnBrowserCompositorSurfaceIdChanged() override {
return view_->render_widget_host()->SynchronizeVisualProperties();
}
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override {
return view_->render_widget_host()->CollectSurfaceIdsForEviction();
}
// AcceleratedWidgetMacNSView methods:
void AcceleratedWidgetCALayerParamsUpdated() override {}
......@@ -87,10 +72,6 @@ void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}
void CefRenderWidgetHostViewOSR::SpeakSelection() {}
bool CefRenderWidgetHostViewOSR::ShouldContinueToPauseForFrame() {
return browser_compositor_->ShouldContinueToPauseForFrame();
}
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
......@@ -126,16 +107,15 @@ display::Display CefRenderWidgetHostViewOSR::GetDisplay() {
void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete(
const cc::RenderFrameMetadata& metadata) {
DCHECK_EQ(current_device_scale_factor_, metadata.device_scale_factor);
browser_compositor_->SynchronizeVisualProperties(
browser_compositor_->UpdateSurfaceFromChild(
metadata.device_scale_factor, metadata.viewport_size_in_pixels,
metadata.local_surface_id.value_or(viz::LocalSurfaceId()),
metadata.local_surface_id_allocation_time_from_child.value_or(
base::TimeTicks()));
metadata.local_surface_id_allocation.value_or(
viz::LocalSurfaceIdAllocation()));
}
const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId()
const {
return browser_compositor_->GetRendererLocalSurfaceId();