summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authordcastagna <dcastagna@chromium.org>2016-03-22 14:30:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-22 21:31:53 +0000
commit1e6a2bc451904125ced0e829f030056b8e2bd8e2 (patch)
treeee7cfa1dea4d7b6142474568f637828382b9e892 /cc/trees
parent1a87fbf87fc1ac4aaef80094be817c6b3a87dc1b (diff)
downloadchromium_src-1e6a2bc451904125ced0e829f030056b8e2bd8e2.zip
chromium_src-1e6a2bc451904125ced0e829f030056b8e2bd8e2.tar.gz
chromium_src-1e6a2bc451904125ced0e829f030056b8e2bd8e2.tar.bz2
Update secure output flags on display changes.
This patch adds a WindowTreeHostManager::Observer to exo that sets the appropriate output secure flag to the compositors when the display configuration changes. The first iteration for the logic that determines if the output is secure is simply a check if the connected display is internal and mirroring is disabled on all the devices. Additionally this patch moves the 'is_secure_' flag from the OutputSurface to LayerTreeImpl, since the lifetime of the latter better matches the display configuration changes. BUG=b/27173841,b/27174223 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1821553002 Cr-Commit-Position: refs/heads/master@{#382683}
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host.cc4
-rw-r--r--cc/trees/layer_tree_host.h2
-rw-r--r--cc/trees/layer_tree_host_impl.cc1
-rw-r--r--cc/trees/layer_tree_host_impl.h8
-rw-r--r--cc/trees/layer_tree_impl.cc4
-rw-r--r--cc/trees/layer_tree_impl.h2
-rw-r--r--cc/trees/proxy.h2
-rw-r--r--cc/trees/proxy_main.cc4
-rw-r--r--cc/trees/proxy_main.h1
-rw-r--r--cc/trees/remote_channel_impl.cc4
-rw-r--r--cc/trees/remote_channel_impl.h1
-rw-r--r--cc/trees/single_thread_proxy.cc4
-rw-r--r--cc/trees/single_thread_proxy.h1
13 files changed, 38 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index ced57c2..16197c3 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -613,6 +613,10 @@ void LayerTreeHost::SetNeedsDisplayOnAllLayers() {
}
}
+void LayerTreeHost::SetOutputIsSecure(bool output_is_secure) {
+ proxy_->SetOutputIsSecure(output_is_secure);
+}
+
const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const {
return proxy_->GetRendererCapabilities();
}
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index ffb597b..8af3dcb 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -182,6 +182,8 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void SetNeedsDisplayOnAllLayers();
+ void SetOutputIsSecure(bool output_is_secure);
+
void CollectRenderingStats(RenderingStats* stats) const;
RenderingStatsInstrumentation* rendering_stats_instrumentation() const {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 7e7adfe..efc8eb0 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -226,6 +226,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
texture_mailbox_deleter_(new TextureMailboxDeleter(GetTaskRunner())),
max_memory_needed_bytes_(0),
resourceless_software_draw_(false),
+ output_is_secure_(false),
animation_host_(),
rendering_stats_instrumentation_(rendering_stats_instrumentation),
micro_benchmark_controller_(this),
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index f9ad198..a7d6b08 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -580,6 +580,12 @@ class CC_EXPORT LayerTreeHostImpl
bool is_direct_manipulation,
ScrollTree* scroll_tree);
+ void set_output_is_secure(bool output_is_secure) {
+ output_is_secure_ = output_is_secure;
+ }
+
+ bool output_is_secure() const { return output_is_secure_; }
+
// Record main frame timing information.
// |start_of_main_frame_args| is the BeginFrameArgs of the beginning of the
// main frame (ie the frame that kicked off the main frame).
@@ -809,6 +815,8 @@ class CC_EXPORT LayerTreeHostImpl
gfx::Rect viewport_rect_for_tile_priority_;
bool resourceless_software_draw_;
+ bool output_is_secure_;
+
gfx::Rect viewport_damage_rect_;
scoped_ptr<AnimationHost> animation_host_;
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 35406d4..e89c84d 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1391,6 +1391,10 @@ bool LayerTreeImpl::IsUIResourceOpaque(UIResourceId uid) const {
return layer_tree_host_impl_->IsUIResourceOpaque(uid);
}
+bool LayerTreeImpl::OutputIsSecure() const {
+ return layer_tree_host_impl_->output_is_secure();
+}
+
void LayerTreeImpl::ProcessUIResourceRequestQueue() {
for (const auto& req : ui_resource_request_queue_) {
switch (req.GetType()) {
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index ce68146..a137011 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -367,6 +367,8 @@ class CC_EXPORT LayerTreeImpl {
bool IsUIResourceOpaque(UIResourceId uid) const;
+ bool OutputIsSecure() const;
+
void RegisterPictureLayerImpl(PictureLayerImpl* layer);
void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
const std::vector<PictureLayerImpl*>& picture_layers() const {
diff --git a/cc/trees/proxy.h b/cc/trees/proxy.h
index cb7152d..27144aa 100644
--- a/cc/trees/proxy.h
+++ b/cc/trees/proxy.h
@@ -83,6 +83,8 @@ class CC_EXPORT Proxy {
TopControlsState current,
bool animate) = 0;
+ virtual void SetOutputIsSecure(bool output_is_secure) = 0;
+
// Testing hooks
virtual bool MainFrameWillHappenForTesting() = 0;
};
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc
index 63bac73..c5821f3 100644
--- a/cc/trees/proxy_main.cc
+++ b/cc/trees/proxy_main.cc
@@ -449,6 +449,10 @@ void ProxyMain::UpdateTopControlsState(TopControlsState constraints,
channel_main_->UpdateTopControlsStateOnImpl(constraints, current, animate);
}
+void ProxyMain::SetOutputIsSecure(bool output_is_secure) {
+ NOTREACHED() << "Only used by SingleProxyMain";
+}
+
bool ProxyMain::SendCommitRequestToImplThreadIfNeeded(
CommitPipelineStage required_stage) {
DCHECK(IsMainThread());
diff --git a/cc/trees/proxy_main.h b/cc/trees/proxy_main.h
index 560d26b..1b627dd 100644
--- a/cc/trees/proxy_main.h
+++ b/cc/trees/proxy_main.h
@@ -113,6 +113,7 @@ class CC_EXPORT ProxyMain : public Proxy {
void UpdateTopControlsState(TopControlsState constraints,
TopControlsState current,
bool animate) override;
+ void SetOutputIsSecure(bool output_is_secure) override;
// This sets the channel used by ProxyMain to communicate with ProxyImpl.
void SetChannel(scoped_ptr<ChannelMain> channel_main);
diff --git a/cc/trees/remote_channel_impl.cc b/cc/trees/remote_channel_impl.cc
index 4708c1e..5d98369 100644
--- a/cc/trees/remote_channel_impl.cc
+++ b/cc/trees/remote_channel_impl.cc
@@ -306,6 +306,10 @@ void RemoteChannelImpl::UpdateTopControlsState(TopControlsState constraints,
NOTREACHED() << "Should not be called on the remote client LayerTreeHost";
}
+void RemoteChannelImpl::SetOutputIsSecure(bool output_is_secure) {
+ NOTREACHED() << "Only used by SingleProxyMain";
+}
+
bool RemoteChannelImpl::MainFrameWillHappenForTesting() {
DCHECK(task_runner_provider_->IsMainThread());
bool main_frame_will_happen;
diff --git a/cc/trees/remote_channel_impl.h b/cc/trees/remote_channel_impl.h
index 79e19ec..8989776 100644
--- a/cc/trees/remote_channel_impl.h
+++ b/cc/trees/remote_channel_impl.h
@@ -162,6 +162,7 @@ class CC_EXPORT RemoteChannelImpl : public ChannelImpl,
void UpdateTopControlsState(TopControlsState constraints,
TopControlsState current,
bool animate) override;
+ void SetOutputIsSecure(bool output_is_secure) override;
bool MainFrameWillHappenForTesting() override;
// Called on impl thread.
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 7c1d821..fa193bf 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -886,6 +886,10 @@ void SingleThreadProxy::UpdateTopControlsState(TopControlsState constraints,
NOTREACHED() << "Top Controls are used only in threaded mode";
}
+void SingleThreadProxy::SetOutputIsSecure(bool output_is_secure) {
+ layer_tree_host_impl_->set_output_is_secure(output_is_secure);
+}
+
void SingleThreadProxy::DidFinishImplFrame() {
layer_tree_host_impl_->DidFinishImplFrame();
#if DCHECK_IS_ON()
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
index 66e0075..b5477f2 100644
--- a/cc/trees/single_thread_proxy.h
+++ b/cc/trees/single_thread_proxy.h
@@ -61,6 +61,7 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
void UpdateTopControlsState(TopControlsState constraints,
TopControlsState current,
bool animate) override;
+ void SetOutputIsSecure(bool output_is_secure) override;
// SchedulerClient implementation
void WillBeginImplFrame(const BeginFrameArgs& args) override;