Commit 721ec7f8 authored by sadrul's avatar sadrul Committed by Commit bot

chrome: Remove the use of WebWorkerRunLoop.

WebWorkerRunLoop serves no purpose anymore. So remove its use from chrome.

This is part 1 of 3.
Part 2: https://codereview.chromium.org/960443002
Part 3: https://codereview.chromium.org/955883002

BUG=461664

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

Cr-Commit-Position: refs/heads/master@{#318235}
parent 53bf6318
...@@ -1040,14 +1040,26 @@ blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( ...@@ -1040,14 +1040,26 @@ blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve(
void BlinkPlatformImpl::didStartWorkerRunLoop( void BlinkPlatformImpl::didStartWorkerRunLoop(
const blink::WebWorkerRunLoop& runLoop) { const blink::WebWorkerRunLoop& runLoop) {
WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); // TODO(sad): Remove once this is removed from the blink::Platform interface.
worker_task_runner->OnWorkerRunLoopStarted(runLoop); // http://crbug.com/461664
didStartWorkerRunLoop();
} }
void BlinkPlatformImpl::didStopWorkerRunLoop( void BlinkPlatformImpl::didStopWorkerRunLoop(
const blink::WebWorkerRunLoop& runLoop) { const blink::WebWorkerRunLoop& runLoop) {
// TODO(sad): Remove once this is removed from the blink::Platform interface.
// http://crbug.com/461664
didStopWorkerRunLoop();
}
void BlinkPlatformImpl::didStartWorkerRunLoop() {
WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
worker_task_runner->OnWorkerRunLoopStarted();
}
void BlinkPlatformImpl::didStopWorkerRunLoop() {
WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
worker_task_runner->OnWorkerRunLoopStopped(runLoop); worker_task_runner->OnWorkerRunLoopStopped();
} }
blink::WebCrypto* BlinkPlatformImpl::crypto() { blink::WebCrypto* BlinkPlatformImpl::crypto() {
......
...@@ -31,6 +31,10 @@ namespace base { ...@@ -31,6 +31,10 @@ namespace base {
class MessageLoop; class MessageLoop;
} }
namespace blink {
class WebWorkerRunLoop;
}
namespace content { namespace content {
class FlingCurveConfiguration; class FlingCurveConfiguration;
class NotificationDispatcher; class NotificationDispatcher;
...@@ -153,6 +157,8 @@ class CONTENT_EXPORT BlinkPlatformImpl ...@@ -153,6 +157,8 @@ class CONTENT_EXPORT BlinkPlatformImpl
const blink::WebWorkerRunLoop& runLoop); const blink::WebWorkerRunLoop& runLoop);
virtual void didStopWorkerRunLoop( virtual void didStopWorkerRunLoop(
const blink::WebWorkerRunLoop& runLoop); const blink::WebWorkerRunLoop& runLoop);
virtual void didStartWorkerRunLoop();
virtual void didStopWorkerRunLoop();
virtual blink::WebCrypto* crypto(); virtual blink::WebCrypto* crypto();
virtual blink::WebGeofencingProvider* geofencingProvider(); virtual blink::WebGeofencingProvider* geofencingProvider();
virtual blink::WebBluetooth* bluetooth(); virtual blink::WebBluetooth* bluetooth();
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/thread_task_runner_handle.h" #include "base/thread_task_runner_handle.h"
using blink::WebWorkerRunLoop;
namespace content { namespace content {
namespace { namespace {
...@@ -90,7 +88,7 @@ void WorkerTaskRunner::RemoveStopObserver(Observer* obs) { ...@@ -90,7 +88,7 @@ void WorkerTaskRunner::RemoveStopObserver(Observer* obs) {
WorkerTaskRunner::~WorkerTaskRunner() { WorkerTaskRunner::~WorkerTaskRunner() {
} }
void WorkerTaskRunner::OnWorkerRunLoopStarted(const WebWorkerRunLoop& loop) { void WorkerTaskRunner::OnWorkerRunLoopStarted() {
DCHECK(!current_tls_.Get()); DCHECK(!current_tls_.Get());
DCHECK(!base::PlatformThread::CurrentRef().is_null()); DCHECK(!base::PlatformThread::CurrentRef().is_null());
current_tls_.Set(new ThreadLocalState()); current_tls_.Set(new ThreadLocalState());
...@@ -101,7 +99,7 @@ void WorkerTaskRunner::OnWorkerRunLoopStarted(const WebWorkerRunLoop& loop) { ...@@ -101,7 +99,7 @@ void WorkerTaskRunner::OnWorkerRunLoopStarted(const WebWorkerRunLoop& loop) {
CHECK(task_runner_map_[id]); CHECK(task_runner_map_[id]);
} }
void WorkerTaskRunner::OnWorkerRunLoopStopped(const WebWorkerRunLoop& loop) { void WorkerTaskRunner::OnWorkerRunLoopStopped() {
DCHECK(current_tls_.Get()); DCHECK(current_tls_.Get());
FOR_EACH_OBSERVER(Observer, current_tls_.Get()->stop_observers_, FOR_EACH_OBSERVER(Observer, current_tls_.Get()->stop_observers_,
OnWorkerRunLoopStopped()); OnWorkerRunLoopStopped());
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "base/threading/thread_local.h" #include "base/threading/thread_local.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebWorkerRunLoop.h"
namespace base { namespace base {
class TaskRunner; class TaskRunner;
...@@ -41,8 +40,8 @@ class CONTENT_EXPORT WorkerTaskRunner { ...@@ -41,8 +40,8 @@ class CONTENT_EXPORT WorkerTaskRunner {
void AddStopObserver(Observer* observer); void AddStopObserver(Observer* observer);
void RemoveStopObserver(Observer* observer); void RemoveStopObserver(Observer* observer);
void OnWorkerRunLoopStarted(const blink::WebWorkerRunLoop& loop); void OnWorkerRunLoopStarted();
void OnWorkerRunLoopStopped(const blink::WebWorkerRunLoop& loop); void OnWorkerRunLoopStopped();
base::TaskRunner* GetTaskRunnerFor(int worker_id); base::TaskRunner* GetTaskRunnerFor(int worker_id);
......
...@@ -14,10 +14,10 @@ namespace content { ...@@ -14,10 +14,10 @@ namespace content {
class WorkerTaskRunnerTest : public testing::Test { class WorkerTaskRunnerTest : public testing::Test {
public: public:
void FakeStart() { void FakeStart() {
task_runner_.OnWorkerRunLoopStarted(blink::WebWorkerRunLoop()); task_runner_.OnWorkerRunLoopStarted();
} }
void FakeStop() { void FakeStop() {
task_runner_.OnWorkerRunLoopStopped(blink::WebWorkerRunLoop()); task_runner_.OnWorkerRunLoopStopped();
} }
WorkerTaskRunner task_runner_; WorkerTaskRunner task_runner_;
......
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