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