summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authornduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 08:32:39 +0000
committernduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 08:32:39 +0000
commit91acd1c77e2c68956e867c0d09649bdef91749be (patch)
tree4760a13aea2743718fbdfa5eefaa91e8b700bbbe /content/renderer
parentbafbd385fd837190767124df55cf32244b30450c (diff)
downloadchromium_src-91acd1c77e2c68956e867c0d09649bdef91749be.zip
chromium_src-91acd1c77e2c68956e867c0d09649bdef91749be.tar.gz
chromium_src-91acd1c77e2c68956e867c0d09649bdef91749be.tar.bz2
Remove dead code left over from old-style WebCompositor initialization path.
Review URL: http://codereview.chromium.org/9633014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/gpu/compositor_thread.cc69
-rw-r--r--content/renderer/gpu/compositor_thread.h14
-rw-r--r--content/renderer/render_thread_impl.cc11
-rw-r--r--content/renderer/render_widget.cc4
-rw-r--r--content/renderer/render_widget.h2
5 files changed, 48 insertions, 52 deletions
diff --git a/content/renderer/gpu/compositor_thread.cc b/content/renderer/gpu/compositor_thread.cc
index 355a85f..d4c790c 100644
--- a/content/renderer/gpu/compositor_thread.cc
+++ b/content/renderer/gpu/compositor_thread.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -8,34 +8,38 @@
#include "content/renderer/gpu/input_event_filter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorClient.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorInputHandler.h"
-using WebKit::WebCompositor;
+using WebKit::WebCompositorInputHandler;
using WebKit::WebInputEvent;
//------------------------------------------------------------------------------
-class CompositorThread::CompositorWrapper : public WebKit::WebCompositorClient {
+class CompositorThread::InputHandlerWrapper
+ : public WebKit::WebCompositorClient {
public:
- CompositorWrapper(CompositorThread* compositor_thread,
- int routing_id,
- WebKit::WebCompositor* compositor)
+ InputHandlerWrapper(CompositorThread* compositor_thread,
+ int routing_id,
+ WebKit::WebCompositorInputHandler* input_handler)
: compositor_thread_(compositor_thread),
routing_id_(routing_id),
- compositor_(compositor) {
- compositor_->setClient(this);
+ input_handler_(input_handler) {
+ input_handler_->setClient(this);
}
- virtual ~CompositorWrapper() {
- compositor_->setClient(NULL);
+ virtual ~InputHandlerWrapper() {
+ input_handler_->setClient(NULL);
}
int routing_id() const { return routing_id_; }
- WebKit::WebCompositor* compositor() const { return compositor_; }
+ WebKit::WebCompositorInputHandler* input_handler() const {
+ return input_handler_;
+ }
// WebCompositorClient methods:
virtual void willShutdown() {
- compositor_thread_->RemoveCompositor(routing_id_);
+ compositor_thread_->RemoveInputHandler(routing_id_);
}
virtual void didHandleInputEvent() {
@@ -49,9 +53,9 @@ class CompositorThread::CompositorWrapper : public WebKit::WebCompositorClient {
private:
CompositorThread* compositor_thread_;
int routing_id_;
- WebKit::WebCompositor* compositor_;
+ WebKit::WebCompositorInputHandler* input_handler_;
- DISALLOW_COPY_AND_ASSIGN(CompositorWrapper);
+ DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper);
};
//------------------------------------------------------------------------------
@@ -72,37 +76,38 @@ IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const {
return filter_;
}
-void CompositorThread::AddCompositor(int routing_id, int compositor_id) {
+void CompositorThread::AddInputHandler(int routing_id, int input_handler_id) {
if (thread_.message_loop() != MessageLoop::current()) {
thread_.message_loop()->PostTask(
FROM_HERE,
- base::Bind(&CompositorThread::AddCompositor, base::Unretained(this),
- routing_id, compositor_id));
+ base::Bind(&CompositorThread::AddInputHandler, base::Unretained(this),
+ routing_id, input_handler_id));
return;
}
- WebCompositor* compositor = WebCompositor::fromIdentifier(compositor_id);
- if (!compositor)
+ WebCompositorInputHandler* input_handler =
+ WebCompositorInputHandler::fromIdentifier(input_handler_id);
+ if (!input_handler)
return;
- if (compositors_.count(routing_id) != 0) {
- // It's valid to call AddCompositor() for the same routing id with the same
- // compositor many times, but it's not valid to change the compositor for
- // a route.
- DCHECK_EQ(compositors_[routing_id]->compositor(), compositor);
+ if (input_handlers_.count(routing_id) != 0) {
+ // It's valid to call AddInputHandler() for the same routing id with the
+ // same input_handler many times, but it's not valid to change the
+ // input_handler for a route.
+ DCHECK_EQ(input_handlers_[routing_id]->input_handler(), input_handler);
return;
}
filter_->AddRoute(routing_id);
- compositors_[routing_id] =
- make_linked_ptr(new CompositorWrapper(this, routing_id, compositor));
+ input_handlers_[routing_id] =
+ make_linked_ptr(new InputHandlerWrapper(this, routing_id, input_handler));
}
-void CompositorThread::RemoveCompositor(int routing_id) {
+void CompositorThread::RemoveInputHandler(int routing_id) {
DCHECK(thread_.message_loop() == MessageLoop::current());
filter_->RemoveRoute(routing_id);
- compositors_.erase(routing_id);
+ input_handlers_.erase(routing_id);
}
void CompositorThread::HandleInputEvent(
@@ -110,12 +115,12 @@ void CompositorThread::HandleInputEvent(
const WebInputEvent* input_event) {
DCHECK_EQ(MessageLoop::current(), thread_.message_loop());
- CompositorMap::iterator it = compositors_.find(routing_id);
- if (it == compositors_.end()) {
- // Oops, we no longer have an interested compositor.
+ InputHandlerMap::iterator it = input_handlers_.find(routing_id);
+ if (it == input_handlers_.end()) {
+ // Oops, we no longer have an interested input handler..
filter_->DidNotHandleInputEvent(true);
return;
}
- it->second->compositor()->handleInputEvent(*input_event);
+ it->second->input_handler()->handleInputEvent(*input_event);
}
diff --git a/content/renderer/gpu/compositor_thread.h b/content/renderer/gpu/compositor_thread.h
index 15843b8..ea506d1 100644
--- a/content/renderer/gpu/compositor_thread.h
+++ b/content/renderer/gpu/compositor_thread.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -32,24 +32,24 @@ class CompositorThread {
IPC::ChannelProxy::MessageFilter* GetMessageFilter() const;
// Callable from the main thread or the compositor's thread.
- void AddCompositor(int routing_id, int compositor_id);
+ void AddInputHandler(int routing_id, int input_handler_id);
webkit_glue::WebThreadImpl* GetWebThread() { return &thread_; }
private:
// Callback only from the compositor's thread.
- void RemoveCompositor(int routing_id);
+ void RemoveInputHandler(int routing_id);
// Called from the compositor's thread.
void HandleInputEvent(int routing_id,
const WebKit::WebInputEvent* input_event);
- class CompositorWrapper;
- friend class CompositorWrapper;
+ class InputHandlerWrapper;
+ friend class InputHandlerWrapper;
typedef std::map<int, // routing_id
- linked_ptr<CompositorWrapper> > CompositorMap;
- CompositorMap compositors_;
+ linked_ptr<InputHandlerWrapper> > InputHandlerMap;
+ InputHandlerMap input_handlers_;
webkit_glue::WebThreadImpl thread_;
scoped_refptr<InputEventFilter> filter_;
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 89f7fb4..1b6454b 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -267,12 +267,10 @@ RenderThreadImpl::~RenderThreadImpl() {
if (file_thread_.get())
file_thread_->Stop();
-#ifdef WEBCOMPOSITOR_HAS_INITIALIZE
if (compositor_initialized_) {
WebKit::WebCompositor::shutdown();
compositor_initialized_ = false;
}
-#endif
if (compositor_thread_.get()) {
RemoveFilter(compositor_thread_->GetMessageFilter());
compositor_thread_.reset();
@@ -465,16 +463,9 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
switches::kEnableThreadedCompositing)) {
compositor_thread_.reset(new CompositorThread(this));
AddFilter(compositor_thread_->GetMessageFilter());
-#ifdef WEBCOMPOSITOR_HAS_INITIALIZE
WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread());
-#else
- WebKit::WebCompositor::setThread(compositor_thread_->GetWebThread());
-#endif
- } else {
-#ifdef WEBCOMPOSITOR_HAS_INITIALIZE
+ } else
WebKit::WebCompositor::initialize(NULL);
-#endif
- }
compositor_initialized_ = true;
WebScriptController::enableV8SingleThreadMode();
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 6c09208..a151f65 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1066,13 +1066,13 @@ void RenderWidget::didAutoResize(const WebSize& new_size) {
size_ = new_size;
}
-void RenderWidget::didActivateCompositor(int compositor_identifier) {
+void RenderWidget::didActivateCompositor(int input_handler_identifier) {
TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor");
CompositorThread* compositor_thread =
RenderThreadImpl::current()->compositor_thread();
if (compositor_thread)
- compositor_thread->AddCompositor(routing_id_, compositor_identifier);
+ compositor_thread->AddInputHandler(routing_id_, input_handler_identifier);
if (!is_accelerated_compositing_active_) {
// When not in accelerated compositing mode, in certain cases (e.g. waiting
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 9aa76f6c..3f17d53 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -116,7 +116,7 @@ class CONTENT_EXPORT RenderWidget
virtual void didInvalidateRect(const WebKit::WebRect&);
virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clipRect);
virtual void didAutoResize(const WebKit::WebSize& new_size);
- virtual void didActivateCompositor(int compositorIdentifier);
+ virtual void didActivateCompositor(int input_handler_identifier);
virtual void didDeactivateCompositor();
virtual void didCommitAndDrawCompositorFrame();
virtual void didCompleteSwapBuffers();