summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/renderer_host')
-rw-r--r--content/browser/renderer_host/compositor_resize_lock_aura.cc65
-rw-r--r--content/browser/renderer_host/compositor_resize_lock_aura.h46
-rw-r--r--content/browser/renderer_host/media/desktop_capture_device_aura.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.h4
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura_unittest.cc2
7 files changed, 117 insertions, 6 deletions
diff --git a/content/browser/renderer_host/compositor_resize_lock_aura.cc b/content/browser/renderer_host/compositor_resize_lock_aura.cc
new file mode 100644
index 0000000..53c2c5b
--- /dev/null
+++ b/content/browser/renderer_host/compositor_resize_lock_aura.cc
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/compositor_resize_lock_aura.h"
+
+#include "base/debug/trace_event.h"
+#include "content/public/browser/browser_thread.h"
+#include "ui/aura/root_window.h"
+#include "ui/compositor/compositor.h"
+
+namespace content {
+
+CompositorResizeLock::CompositorResizeLock(aura::RootWindow* root_window,
+ const gfx::Size new_size,
+ bool defer_compositor_lock,
+ const base::TimeDelta& timeout)
+ : ResizeLock(new_size, defer_compositor_lock),
+ root_window_(root_window),
+ weak_ptr_factory_(this),
+ cancelled_(false) {
+ DCHECK(root_window_);
+
+ TRACE_EVENT_ASYNC_BEGIN2("ui", "CompositorResizeLock", this,
+ "width", expected_size().width(),
+ "height", expected_size().height());
+ root_window_->HoldPointerMoves();
+
+ BrowserThread::PostDelayedTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&CompositorResizeLock::CancelLock,
+ weak_ptr_factory_.GetWeakPtr()),
+ timeout);
+}
+
+CompositorResizeLock::~CompositorResizeLock() {
+ CancelLock();
+ TRACE_EVENT_ASYNC_END2("ui", "CompositorResizeLock", this,
+ "width", expected_size().width(),
+ "height", expected_size().height());
+}
+
+bool CompositorResizeLock::GrabDeferredLock() {
+ return ResizeLock::GrabDeferredLock();
+}
+
+void CompositorResizeLock::UnlockCompositor() {
+ ResizeLock::UnlockCompositor();
+ compositor_lock_ = NULL;
+}
+
+void CompositorResizeLock::LockCompositor() {
+ ResizeLock::LockCompositor();
+ compositor_lock_ = root_window_->host()->compositor()->GetCompositorLock();
+}
+
+void CompositorResizeLock::CancelLock() {
+ if (cancelled_)
+ return;
+ cancelled_ = true;
+ UnlockCompositor();
+ root_window_->ReleasePointerMoves();
+}
+
+} // namespace content
diff --git a/content/browser/renderer_host/compositor_resize_lock_aura.h b/content/browser/renderer_host/compositor_resize_lock_aura.h
new file mode 100644
index 0000000..6963ac2
--- /dev/null
+++ b/content/browser/renderer_host/compositor_resize_lock_aura.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_
+#define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
+#include "content/browser/compositor/resize_lock.h"
+
+namespace aura { class RootWindow; }
+
+namespace ui { class CompositorLock; }
+
+namespace content {
+
+// Used to prevent further resizes while a resize is pending.
+class CompositorResizeLock : public ResizeLock {
+ public:
+ CompositorResizeLock(aura::RootWindow* root_window,
+ const gfx::Size new_size,
+ bool defer_compositor_lock,
+ const base::TimeDelta& timeout);
+ virtual ~CompositorResizeLock();
+
+ virtual bool GrabDeferredLock() OVERRIDE;
+ virtual void UnlockCompositor() OVERRIDE;
+
+ protected:
+ virtual void LockCompositor() OVERRIDE;
+ void CancelLock();
+
+ private:
+ aura::RootWindow* root_window_;
+ scoped_refptr<ui::CompositorLock> compositor_lock_;
+ base::WeakPtrFactory<CompositorResizeLock> weak_ptr_factory_;
+ bool cancelled_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositorResizeLock);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_RESIZE_LOCK_AURA_H_
diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura.cc b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
index 3f8b66f..03e9c89 100644
--- a/content/browser/renderer_host/media/desktop_capture_device_aura.cc
+++ b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
@@ -8,7 +8,7 @@
#include "base/timer/timer.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
-#include "content/browser/aura/image_transport_factory.h"
+#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/renderer_host/media/video_capture_device_impl.h"
#include "content/common/gpu/client/gl_helper.h"
#include "content/public/browser/browser_thread.h"
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index cd3abed..3de0ff1 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -35,7 +35,7 @@
#include "ui/gfx/screen.h"
#if defined(USE_AURA)
-#include "content/browser/aura/image_transport_factory.h"
+#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "ui/aura/env.h"
#include "ui/aura/test/test_screen.h"
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ed380e1..720d820 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -22,9 +22,9 @@
#include "cc/trees/layer_tree_settings.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
-#include "content/browser/aura/compositor_resize_lock.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/renderer_host/backing_store_aura.h"
+#include "content/browser/renderer_host/compositor_resize_lock_aura.h"
#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target_aura.h"
#include "content/browser/renderer_host/overscroll_controller.h"
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 24599a4..37f5f4e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -20,8 +20,8 @@
#include "cc/layers/delegated_frame_resource_collection.h"
#include "cc/resources/texture_mailbox.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
-#include "content/browser/aura/image_transport_factory.h"
-#include "content/browser/aura/owned_mailbox.h"
+#include "content/browser/compositor/image_transport_factory.h"
+#include "content/browser/compositor/owned_mailbox.h"
#include "content/browser/renderer_host/delegated_frame_evictor.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/renderer_host/software_frame_manager.h"
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 3349843..9977aaa 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -13,8 +13,8 @@
#include "cc/output/compositor_frame_metadata.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/gl_frame_data.h"
-#include "content/browser/aura/resize_lock.h"
#include "content/browser/browser_thread_impl.h"
+#include "content/browser/compositor/resize_lock.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/gpu/gpu_messages.h"