summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 18:20:38 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 18:20:38 +0000
commit387277cea3d8a6f2f29f6e35bf24d524a267e46a (patch)
treeedd9aba9e15434c112483566fe57c1001d8ba77a
parenta9b24304db8e19cc8ee2cf866ea85024de943778 (diff)
downloadchromium_src-387277cea3d8a6f2f29f6e35bf24d524a267e46a.zip
chromium_src-387277cea3d8a6f2f29f6e35bf24d524a267e46a.tar.gz
chromium_src-387277cea3d8a6f2f29f6e35bf24d524a267e46a.tar.bz2
Move webthread_impl.* to content/child.
It is only used by content and is necessary as we continue to move forward with the process of removing src/webkit/. BUG=265753 TEST=content_shell and content_unittests R=jochen@chromium.org TBR=darin Review URL: https://codereview.chromium.org/168923003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252597 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/child/webkitplatformsupport_child_impl.cc15
-rw-r--r--content/child/webthread_impl.cc (renamed from webkit/child/webthread_impl.cc)37
-rw-r--r--content/child/webthread_impl.h (renamed from webkit/child/webthread_impl.h)23
-rw-r--r--content/content_child.gypi2
-rw-r--r--webkit/child/webkit_child.gyp2
-rw-r--r--webkit/renderer/compositor_bindings/web_compositor_support_impl.cc1
6 files changed, 38 insertions, 42 deletions
diff --git a/content/child/webkitplatformsupport_child_impl.cc b/content/child/webkitplatformsupport_child_impl.cc
index d45407e..042e3f3 100644
--- a/content/child/webkitplatformsupport_child_impl.cc
+++ b/content/child/webkitplatformsupport_child_impl.cc
@@ -8,11 +8,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "content/child/web_discardable_memory_impl.h"
+#include "content/child/webthread_impl.h"
#include "content/child/worker_task_runner.h"
#include "third_party/WebKit/public/platform/WebWaitableEvent.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "webkit/child/fling_curve_configuration.h"
-#include "webkit/child/webthread_impl.h"
#if defined(OS_ANDROID)
#include "webkit/child/fling_animator_impl_android.h"
@@ -84,13 +84,12 @@ WebKitPlatformSupportChildImpl::createFlingAnimationCurve(
blink::WebThread* WebKitPlatformSupportChildImpl::createThread(
const char* name) {
- return new webkit_glue::WebThreadImpl(name);
+ return new WebThreadImpl(name);
}
blink::WebThread* WebKitPlatformSupportChildImpl::currentThread() {
- webkit_glue::WebThreadImplForMessageLoop* thread =
- static_cast<webkit_glue::WebThreadImplForMessageLoop*>(
- current_thread_slot_.Get());
+ WebThreadImplForMessageLoop* thread =
+ static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get());
if (thread)
return (thread);
@@ -99,7 +98,7 @@ blink::WebThread* WebKitPlatformSupportChildImpl::currentThread() {
if (!message_loop.get())
return NULL;
- thread = new webkit_glue::WebThreadImplForMessageLoop(message_loop.get());
+ thread = new WebThreadImplForMessageLoop(message_loop.get());
current_thread_slot_.Set(thread);
return thread;
}
@@ -141,8 +140,8 @@ WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) {
// static
void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) {
- webkit_glue::WebThreadImplForMessageLoop* impl =
- static_cast<webkit_glue::WebThreadImplForMessageLoop*>(thread);
+ WebThreadImplForMessageLoop* impl =
+ static_cast<WebThreadImplForMessageLoop*>(thread);
delete impl;
}
diff --git a/webkit/child/webthread_impl.cc b/content/child/webthread_impl.cc
index 4646662..d53d06e 100644
--- a/webkit/child/webthread_impl.cc
+++ b/content/child/webthread_impl.cc
@@ -1,11 +1,11 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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.
// An implementation of WebThread in terms of base::MessageLoop and
// base::Thread
-#include "webkit/child/webthread_impl.h"
+#include "content/child/webthread_impl.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -13,16 +13,16 @@
#include "base/pending_task.h"
#include "base/threading/platform_thread.h"
-namespace webkit_glue {
+namespace content {
-WebThreadBase::WebThreadBase() { }
-WebThreadBase::~WebThreadBase() { }
+WebThreadBase::WebThreadBase() {}
+WebThreadBase::~WebThreadBase() {}
-class WebThreadBase::TaskObserverAdapter :
- public base::MessageLoop::TaskObserver {
+class WebThreadBase::TaskObserverAdapter
+ : public base::MessageLoop::TaskObserver {
public:
TaskObserverAdapter(WebThread::TaskObserver* observer)
- : observer_(observer) { }
+ : observer_(observer) {}
virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE {
observer_->willProcessTask();
@@ -65,8 +65,7 @@ void WebThreadImpl::postTask(Task* task) {
FROM_HERE, base::Bind(&blink::WebThread::Task::run, base::Owned(task)));
}
-void WebThreadImpl::postDelayedTask(
- Task* task, long long delay_ms) {
+void WebThreadImpl::postDelayedTask(Task* task, long long delay_ms) {
thread_->message_loop()->PostDelayedTask(
FROM_HERE,
base::Bind(&blink::WebThread::Task::run, base::Owned(task)),
@@ -75,7 +74,7 @@ void WebThreadImpl::postDelayedTask(
void WebThreadImpl::enterRunLoop() {
CHECK(isCurrentThread());
- CHECK(!thread_->message_loop()->is_running()); // We don't support nesting.
+ CHECK(!thread_->message_loop()->is_running()); // We don't support nesting.
thread_->message_loop()->Run();
}
@@ -95,16 +94,15 @@ WebThreadImpl::~WebThreadImpl() {
WebThreadImplForMessageLoop::WebThreadImplForMessageLoop(
base::MessageLoopProxy* message_loop)
- : message_loop_(message_loop) {
-}
+ : message_loop_(message_loop) {}
void WebThreadImplForMessageLoop::postTask(Task* task) {
message_loop_->PostTask(
FROM_HERE, base::Bind(&blink::WebThread::Task::run, base::Owned(task)));
}
-void WebThreadImplForMessageLoop::postDelayedTask(
- Task* task, long long delay_ms) {
+void WebThreadImplForMessageLoop::postDelayedTask(Task* task,
+ long long delay_ms) {
message_loop_->PostDelayedTask(
FROM_HERE,
base::Bind(&blink::WebThread::Task::run, base::Owned(task)),
@@ -113,8 +111,8 @@ void WebThreadImplForMessageLoop::postDelayedTask(
void WebThreadImplForMessageLoop::enterRunLoop() {
CHECK(isCurrentThread());
- CHECK(!base::MessageLoop::current()
- ->is_running()); // We don't support nesting.
+ // We don't support nesting.
+ CHECK(!base::MessageLoop::current()->is_running());
base::MessageLoop::current()->Run();
}
@@ -128,7 +126,6 @@ bool WebThreadImplForMessageLoop::isCurrentThread() const {
return message_loop_->BelongsToCurrentThread();
}
-WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {
-}
+WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {}
-}
+} // namespace content
diff --git a/webkit/child/webthread_impl.h b/content/child/webthread_impl.h
index 73f21c2..649cad8 100644
--- a/webkit/child/webthread_impl.h
+++ b/content/child/webthread_impl.h
@@ -1,17 +1,18 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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 WEBKIT_CHILD_WEBTHREAD_IMPL_H_
-#define WEBKIT_CHILD_WEBTHREAD_IMPL_H_
+
+#ifndef CONTENT_CHILD_WEBTHREAD_IMPL_H_
+#define CONTENT_CHILD_WEBTHREAD_IMPL_H_
#include <map>
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread.h"
+#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebThread.h"
-#include "webkit/child/webkit_child_export.h"
-namespace webkit_glue {
+namespace content {
class WebThreadBase : public blink::WebThread {
public:
@@ -34,8 +35,8 @@ class WebThreadBase : public blink::WebThread {
class WebThreadImpl : public WebThreadBase {
public:
- WEBKIT_CHILD_EXPORT explicit WebThreadImpl(const char* name);
- WEBKIT_CHILD_EXPORT virtual ~WebThreadImpl();
+ CONTENT_EXPORT explicit WebThreadImpl(const char* name);
+ CONTENT_EXPORT virtual ~WebThreadImpl();
virtual void postTask(Task* task);
virtual void postDelayedTask(Task* task, long long delay_ms);
@@ -52,9 +53,9 @@ class WebThreadImpl : public WebThreadBase {
class WebThreadImplForMessageLoop : public WebThreadBase {
public:
- WEBKIT_CHILD_EXPORT explicit WebThreadImplForMessageLoop(
+ CONTENT_EXPORT explicit WebThreadImplForMessageLoop(
base::MessageLoopProxy* message_loop);
- WEBKIT_CHILD_EXPORT virtual ~WebThreadImplForMessageLoop();
+ CONTENT_EXPORT virtual ~WebThreadImplForMessageLoop();
virtual void postTask(Task* task);
virtual void postDelayedTask(Task* task, long long delay_ms);
@@ -67,6 +68,6 @@ class WebThreadImplForMessageLoop : public WebThreadBase {
scoped_refptr<base::MessageLoopProxy> message_loop_;
};
-} // namespace webkit_glue
+} // namespace content
-#endif // WEBKIT_CHILD_WEBTHREAD_IMPL_H_
+#endif // CONTENT_CHILD_WEBTHREAD_IMPL_H_
diff --git a/content/content_child.gypi b/content/content_child.gypi
index 08be4c1..8cf740d 100644
--- a/content/content_child.gypi
+++ b/content/content_child.gypi
@@ -175,6 +175,8 @@
'child/webthemeengine_impl_default.h',
'child/webthemeengine_impl_mac.cc',
'child/webthemeengine_impl_mac.h',
+ 'child/webthread_impl.cc',
+ 'child/webthread_impl.h',
'child/worker_task_runner.cc',
'child/worker_task_runner.h',
'child/worker_thread_task_runner.cc',
diff --git a/webkit/child/webkit_child.gyp b/webkit/child/webkit_child.gyp
index fd161e7..bdd1833 100644
--- a/webkit/child/webkit_child.gyp
+++ b/webkit/child/webkit_child.gyp
@@ -77,8 +77,6 @@
'websocketstreamhandle_delegate.h',
'websocketstreamhandle_impl.cc',
'websocketstreamhandle_impl.h',
- 'webthread_impl.cc',
- 'webthread_impl.h',
'weburlloader_impl.cc',
'weburlloader_impl.h',
'weburlrequest_extradata_impl.cc',
diff --git a/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc b/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc
index 51bb621..fe6c1f2 100644
--- a/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc
+++ b/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc
@@ -9,7 +9,6 @@
#include "cc/animation/transform_operations.h"
#include "cc/output/output_surface.h"
#include "cc/output/software_output_device.h"
-#include "webkit/child/webthread_impl.h"
#include "webkit/renderer/compositor_bindings/web_animation_impl.h"
#include "webkit/renderer/compositor_bindings/web_content_layer_impl.h"
#include "webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h"