Commit d40d2294 authored by pilgrim@chromium.org's avatar pilgrim@chromium.org

Move webkit/child/webkitplatformsupport_child_impl to content/

BUG=338338

Review URL: https://codereview.chromium.org/148333009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247904 0039d316-1c4b-4281-b951-d872f2087c98
parent 028a8acd
// 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.
#include "webkit/child/webkitplatformsupport_child_impl.h"
#include "content/child/webkitplatformsupport_child_impl.h"
#include "base/memory/discardable_memory.h"
#include "base/memory/scoped_ptr.h"
......@@ -21,7 +21,7 @@
using blink::WebFallbackThemeEngine;
using blink::WebThemeEngine;
namespace webkit_glue {
namespace content {
namespace {
......@@ -46,7 +46,7 @@ class WebWaitableEventImpl : public blink::WebWaitableEvent {
WebKitPlatformSupportChildImpl::WebKitPlatformSupportChildImpl()
: current_thread_slot_(&DestroyCurrentThread),
fling_curve_configuration_(new FlingCurveConfiguration) {}
fling_curve_configuration_(new webkit_glue::FlingCurveConfiguration) {}
WebKitPlatformSupportChildImpl::~WebKitPlatformSupportChildImpl() {}
......@@ -70,7 +70,7 @@ WebKitPlatformSupportChildImpl::createFlingAnimationCurve(
const blink::WebFloatPoint& velocity,
const blink::WebSize& cumulative_scroll) {
#if defined(OS_ANDROID)
return FlingAnimatorImpl::CreateAndroidGestureCurve(velocity,
return webkit_glue::FlingAnimatorImpl::CreateAndroidGestureCurve(velocity,
cumulative_scroll);
#endif
......@@ -84,12 +84,13 @@ WebKitPlatformSupportChildImpl::createFlingAnimationCurve(
blink::WebThread* WebKitPlatformSupportChildImpl::createThread(
const char* name) {
return new WebThreadImpl(name);
return new webkit_glue::WebThreadImpl(name);
}
blink::WebThread* WebKitPlatformSupportChildImpl::currentThread() {
WebThreadImplForMessageLoop* thread =
static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get());
webkit_glue::WebThreadImplForMessageLoop* thread =
static_cast<webkit_glue::WebThreadImplForMessageLoop*>(
current_thread_slot_.Get());
if (thread)
return (thread);
......@@ -98,7 +99,7 @@ blink::WebThread* WebKitPlatformSupportChildImpl::currentThread() {
if (!message_loop.get())
return NULL;
thread = new WebThreadImplForMessageLoop(message_loop.get());
thread = new webkit_glue::WebThreadImplForMessageLoop(message_loop.get());
current_thread_slot_.Set(thread);
return thread;
}
......@@ -119,13 +120,15 @@ blink::WebWaitableEvent* WebKitPlatformSupportChildImpl::waitMultipleEvents(
void WebKitPlatformSupportChildImpl::didStartWorkerRunLoop(
const blink::WebWorkerRunLoop& runLoop) {
WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
webkit_glue::WorkerTaskRunner* worker_task_runner =
webkit_glue::WorkerTaskRunner::Instance();
worker_task_runner->OnWorkerRunLoopStarted(runLoop);
}
void WebKitPlatformSupportChildImpl::didStopWorkerRunLoop(
const blink::WebWorkerRunLoop& runLoop) {
WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
webkit_glue::WorkerTaskRunner* worker_task_runner =
webkit_glue::WorkerTaskRunner::Instance();
worker_task_runner->OnWorkerRunLoopStopped(runLoop);
}
......@@ -135,14 +138,15 @@ WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) {
base::DiscardableMemory::GetPreferredType();
if (type == base::DISCARDABLE_MEMORY_TYPE_EMULATED)
return NULL;
return WebDiscardableMemoryImpl::CreateLockedMemory(bytes).release();
return webkit_glue::WebDiscardableMemoryImpl::CreateLockedMemory(
bytes).release();
}
// static
void WebKitPlatformSupportChildImpl::DestroyCurrentThread(void* thread) {
WebThreadImplForMessageLoop* impl =
static_cast<WebThreadImplForMessageLoop*>(thread);
webkit_glue::WebThreadImplForMessageLoop* impl =
static_cast<webkit_glue::WebThreadImplForMessageLoop*>(thread);
delete impl;
}
} // namespace webkit_glue
} // namespace content
// // 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_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
#define WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
#ifndef CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
#define CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
#include "base/threading/thread_local_storage.h"
#include "content/common/content_export.h"
#include "webkit/child/webfallbackthemeengine_impl.h"
#include "webkit/child/webkit_child_export.h"
#include "webkit/child/webkitplatformsupport_impl.h"
......@@ -21,11 +22,13 @@
#endif
namespace webkit_glue {
class FlingCurveConfiguration;
}
namespace content {
class WEBKIT_CHILD_EXPORT WebKitPlatformSupportChildImpl :
public WebKitPlatformSupportImpl {
class CONTENT_EXPORT WebKitPlatformSupportChildImpl :
public webkit_glue::WebKitPlatformSupportImpl {
public:
WebKitPlatformSupportChildImpl();
virtual ~WebKitPlatformSupportChildImpl();
......@@ -61,12 +64,12 @@ class WEBKIT_CHILD_EXPORT WebKitPlatformSupportChildImpl :
private:
static void DestroyCurrentThread(void*);
WebThemeEngineImpl native_theme_engine_;
WebFallbackThemeEngineImpl fallback_theme_engine_;
webkit_glue::WebThemeEngineImpl native_theme_engine_;
webkit_glue::WebFallbackThemeEngineImpl fallback_theme_engine_;
base::ThreadLocalStorage::Slot current_thread_slot_;
scoped_ptr<FlingCurveConfiguration> fling_curve_configuration_;
scoped_ptr<webkit_glue::FlingCurveConfiguration> fling_curve_configuration_;
};
} // namespace webkit_glue
} // namespace content
#endif // WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
#endif // CONTENT_CHILD_WEBKITPLATFORMSUPPORT_CHILD_IMPL_H_
......@@ -6,16 +6,16 @@
#define CONTENT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_
#include "base/compiler_specific.h"
#include "content/child/webkitplatformsupport_child_impl.h"
#include "content/common/content_export.h"
#include "ui/base/layout.h"
#include "webkit/child/webkitplatformsupport_child_impl.h"
namespace content {
// This is a specialization of WebKitPlatformSupportImpl that implements the
// embedder functions in terms of ContentClient.
class CONTENT_EXPORT WebKitPlatformSupportImpl
: NON_EXPORTED_BASE(public webkit_glue::WebKitPlatformSupportChildImpl) {
: NON_EXPORTED_BASE(public WebKitPlatformSupportChildImpl) {
public:
typedef blink::WebGraphicsContext3D* (OffscreenContextFactory)();
......
......@@ -149,6 +149,8 @@
'child/webblobregistry_impl.h',
'child/webkitplatformsupport_impl.cc',
'child/webkitplatformsupport_impl.h',
'child/webkitplatformsupport_child_impl.cc',
'child/webkitplatformsupport_child_impl.h',
'child/webmessageportchannel_impl.cc',
'child/webmessageportchannel_impl.h',
'child/websocket_bridge.cc',
......
......@@ -7,10 +7,10 @@
#include "base/compiler_specific.h"
#include "base/files/scoped_temp_dir.h"
#include "content/child/webkitplatformsupport_child_impl.h"
#include "content/test/mock_webclipboard_impl.h"
#include "content/test/weburl_loader_mock_factory.h"
#include "third_party/WebKit/public/platform/WebUnitTestSupport.h"
#include "webkit/child/webkitplatformsupport_child_impl.h"
#include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h"
......@@ -24,7 +24,7 @@ namespace content {
// An implementation of WebKitPlatformSupport for tests.
class TestWebKitPlatformSupport
: public blink::WebUnitTestSupport,
public webkit_glue::WebKitPlatformSupportChildImpl {
public content::WebKitPlatformSupportChildImpl {
public:
TestWebKitPlatformSupport();
virtual ~TestWebKitPlatformSupport();
......
......@@ -10,6 +10,7 @@
#include "base/synchronization/lock.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "webkit/child/webkit_child_export.h"
namespace blink {
class WebGestureCurve;
......@@ -19,7 +20,7 @@ namespace webkit_glue {
// A class to manage dynamically adjustable parameters controlling the
// shape of the fling deacceleration function.
class FlingCurveConfiguration {
class WEBKIT_CHILD_EXPORT FlingCurveConfiguration {
public:
FlingCurveConfiguration();
virtual ~FlingCurveConfiguration();
......
......@@ -5,8 +5,10 @@
#ifndef WEBKIT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_
#define WEBKIT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/platform/WebFallbackThemeEngine.h"
#include "webkit/child/webkit_child_export.h"
namespace ui {
class FallbackTheme;
......@@ -14,7 +16,8 @@ class FallbackTheme;
namespace webkit_glue {
class WebFallbackThemeEngineImpl : public blink::WebFallbackThemeEngine {
class WEBKIT_CHILD_EXPORT WebFallbackThemeEngineImpl :
NON_EXPORTED_BASE(public blink::WebFallbackThemeEngine) {
public:
WebFallbackThemeEngineImpl();
virtual ~WebFallbackThemeEngineImpl();
......
......@@ -75,8 +75,6 @@
'webkit_child_export.h',
'webkit_child_helpers.cc',
'webkit_child_helpers.h',
'webkitplatformsupport_child_impl.cc',
'webkitplatformsupport_child_impl.h',
'webkitplatformsupport_impl.cc',
'webkitplatformsupport_impl.h',
'websocketstreamhandle_bridge.h',
......
......@@ -6,10 +6,11 @@
#define WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_ANDROID_H_
#include "third_party/WebKit/public/platform/default/WebThemeEngine.h"
#include "webkit/child/webkit_child_export.h"
namespace webkit_glue {
class WebThemeEngineImpl : public blink::WebThemeEngine {
class WEBKIT_CHILD_EXPORT WebThemeEngineImpl : public blink::WebThemeEngine {
public:
// WebThemeEngine methods:
virtual blink::WebSize getSize(blink::WebThemeEngine::Part);
......
......@@ -5,11 +5,14 @@
#ifndef WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_DEFAULT_H_
#define WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_DEFAULT_H_
#include "base/compiler_specific.h"
#include "third_party/WebKit/public/platform/default/WebThemeEngine.h"
#include "webkit/child/webkit_child_export.h"
namespace webkit_glue {
class WebThemeEngineImpl : public blink::WebThemeEngine {
class WEBKIT_CHILD_EXPORT WebThemeEngineImpl :
NON_EXPORTED_BASE(public blink::WebThemeEngine) {
public:
// WebThemeEngine methods:
virtual blink::WebSize getSize(blink::WebThemeEngine::Part);
......
......@@ -6,10 +6,11 @@
#define WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_MAC_H_
#include "third_party/WebKit/public/platform/mac/WebThemeEngine.h"
#include "webkit/child/webkit_child_export.h"
namespace webkit_glue {
class WebThemeEngineImpl : public blink::WebThemeEngine {
class WEBKIT_CHILD_EXPORT WebThemeEngineImpl : public blink::WebThemeEngine {
public:
// blink::WebThemeEngine implementation.
virtual void paintScrollbarThumb(
......
......@@ -5,11 +5,14 @@
#ifndef WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_WIN_H_
#define WEBKIT_CHILD_WEBTHEMEENGINE_IMPL_WIN_H_
#include "base/compiler_specific.h"
#include "third_party/WebKit/public/platform/win/WebThemeEngine.h"
#include "webkit/child/webkit_child_export.h"
namespace webkit_glue {
class WebThemeEngineImpl : public blink::WebThemeEngine {
class WEBKIT_CHILD_EXPORT WebThemeEngineImpl :
NON_EXPORTED_BASE(public blink::WebThemeEngine) {
public:
// WebThemeEngine methods:
virtual void paintButton(
......
......@@ -36,15 +36,15 @@ class WEBKIT_CHILD_EXPORT WorkerTaskRunner {
void AddStopObserver(Observer* observer);
void RemoveStopObserver(Observer* observer);
void OnWorkerRunLoopStarted(const blink::WebWorkerRunLoop& loop);
void OnWorkerRunLoopStopped(const blink::WebWorkerRunLoop& loop);
private:
friend class WebKitPlatformSupportChildImpl;
friend class WorkerTaskRunnerTest;
typedef std::map<int, blink::WebWorkerRunLoop> IDToLoopMap;
~WorkerTaskRunner();
void OnWorkerRunLoopStarted(const blink::WebWorkerRunLoop& loop);
void OnWorkerRunLoopStopped(const blink::WebWorkerRunLoop& loop);
struct ThreadLocalState;
base::ThreadLocalPointer<ThreadLocalState> current_tls_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment