diff options
50 files changed, 91 insertions, 344 deletions
diff --git a/components/html_viewer/web_url_loader_impl.cc b/components/html_viewer/web_url_loader_impl.cc index c912d4d..5f5b840 100644 --- a/components/html_viewer/web_url_loader_impl.cc +++ b/components/html_viewer/web_url_loader_impl.cc @@ -312,9 +312,4 @@ void WebURLLoaderImpl::OnResponseBodyStreamReady(MojoResult result) { ReadMore(); } -void WebURLLoaderImpl::setLoadingTaskRunner( - blink::WebTaskRunner* web_task_runner) { - // TODO(alexclarke): Consider hooking this up. -} - } // namespace html_viewer diff --git a/components/html_viewer/web_url_loader_impl.h b/components/html_viewer/web_url_loader_impl.h index a513efa..9acc027 100644 --- a/components/html_viewer/web_url_loader_impl.h +++ b/components/html_viewer/web_url_loader_impl.h @@ -47,7 +47,6 @@ class WebURLLoaderImpl : public blink::WebURLLoader { blink::WebURLLoaderClient* client); virtual void cancel(); virtual void setDefersLoading(bool defers_loading); - virtual void setLoadingTaskRunner(blink::WebTaskRunner* web_task_runner); void OnReceivedResponse(const blink::WebURLRequest& request, mojo::URLResponsePtr response); diff --git a/components/scheduler/child/web_task_runner_impl.cc b/components/scheduler/child/web_task_runner_impl.cc index 56591ac..b4794a4 100644 --- a/components/scheduler/child/web_task_runner_impl.cc +++ b/components/scheduler/child/web_task_runner_impl.cc @@ -36,8 +36,4 @@ void WebTaskRunnerImpl::postDelayedTask( base::TimeDelta::FromMillisecondsD(delayMs)); } -blink::WebTaskRunner* WebTaskRunnerImpl::clone() { - return new WebTaskRunnerImpl(task_runner_); -} - } // namespace scheduler diff --git a/components/scheduler/child/web_task_runner_impl.h b/components/scheduler/child/web_task_runner_impl.h index c9cc55d..73a1e46 100644 --- a/components/scheduler/child/web_task_runner_impl.h +++ b/components/scheduler/child/web_task_runner_impl.h @@ -34,7 +34,6 @@ class SCHEDULER_EXPORT WebTaskRunnerImpl : public blink::WebTaskRunner { void postDelayedTask(const blink::WebTraceLocation& web_location, blink::WebTaskRunner::Task* task, double delayMs) override; - blink::WebTaskRunner* clone() override; private: scoped_refptr<base::SingleThreadTaskRunner> task_runner_; diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 3b26b61..c8f4168 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc @@ -34,7 +34,6 @@ #include "blink/public/resources/grit/blink_image_resources.h" #include "blink/public/resources/grit/blink_resources.h" #include "components/mime_util/mime_util.h" -#include "components/scheduler/child/web_task_runner_impl.h" #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" #include "content/app/resources/grit/content_resources.h" #include "content/app/strings/grit/content_strings.h" @@ -479,8 +478,7 @@ WebURLLoader* BlinkPlatformImpl::createURLLoader() { // data URLs to bypass the ResourceDispatcher. return new WebURLLoaderImpl( child_thread ? child_thread->resource_dispatcher() : NULL, - make_scoped_ptr(new scheduler::WebTaskRunnerImpl( - base::ThreadTaskRunnerHandle::Get()))); + MainTaskRunnerForCurrentThread()); } blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { @@ -1365,6 +1363,16 @@ uint32_t BlinkPlatformImpl::getUniqueIdForProcess() { return base::trace_event::TraceLog::GetInstance()->process_id(); } +scoped_refptr<base::SingleThreadTaskRunner> +BlinkPlatformImpl::MainTaskRunnerForCurrentThread() { + if (main_thread_task_runner_.get() && + main_thread_task_runner_->BelongsToCurrentThread()) { + return main_thread_task_runner_; + } else { + return base::ThreadTaskRunnerHandle::Get(); + } +} + bool BlinkPlatformImpl::IsMainThread() const { return main_thread_task_runner_.get() && main_thread_task_runner_->BelongsToCurrentThread(); diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h index f9bf754..4ec1659 100644 --- a/content/child/blink_platform_impl.h +++ b/content/child/blink_platform_impl.h @@ -195,6 +195,8 @@ class CONTENT_EXPORT BlinkPlatformImpl bool IsMainThread() const; + scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); + scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; WebThemeEngineImpl native_theme_engine_; WebFallbackThemeEngineImpl fallback_theme_engine_; diff --git a/content/child/request_info.cc b/content/child/request_info.cc index 2af34cd..b115b7d 100644 --- a/content/child/request_info.cc +++ b/content/child/request_info.cc @@ -27,8 +27,7 @@ RequestInfo::RequestInfo() enable_upload_progress(false), do_not_prompt_for_login(false), report_raw_headers(false), - extra_data(NULL), - loading_web_task_runner(nullptr) {} + extra_data(NULL) {} RequestInfo::~RequestInfo() {} diff --git a/content/child/request_info.h b/content/child/request_info.h index 037c1db..e610ac8 100644 --- a/content/child/request_info.h +++ b/content/child/request_info.h @@ -17,14 +17,9 @@ #include "content/public/common/resource_type.h" #include "net/base/request_priority.h" #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" -#include "third_party/WebKit/public/platform/WebTaskRunner.h" #include "third_party/WebKit/public/platform/WebURLRequest.h" #include "url/gurl.h" -namespace blink { -class WebTaskRunner; -} // namespace blink - namespace content { // Structure used when calling BlinkPlatformImpl::CreateResourceLoader(). @@ -115,9 +110,6 @@ struct CONTENT_EXPORT RequestInfo { // Extra data associated with this request. We do not own this pointer. blink::WebURLRequest::ExtraData* extra_data; - // Optional, the specific task queue to execute loading tasks on. - scoped_ptr<blink::WebTaskRunner> loading_web_task_runner; - private: DISALLOW_COPY_AND_ASSIGN(RequestInfo); }; diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index ec1a1ef..aeb1cbe 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc @@ -18,7 +18,6 @@ #include "base/strings/string_util.h" #include "content/child/request_extra_data.h" #include "content/child/request_info.h" -#include "content/child/resource_scheduling_filter.h" #include "content/child/shared_memory_received_data_factory.h" #include "content/child/site_isolation_stats_gatherer.h" #include "content/child/sync_load_response.h" @@ -404,9 +403,6 @@ bool ResourceDispatcher::RemovePendingRequest(int request_id) { new ResourceHostMsg_ReleaseDownloadedFile(request_id)); } - if (resource_scheduling_filter_.get()) - resource_scheduling_filter_->ClearRequestIdTaskRunner(request_id); - return true; } @@ -592,13 +588,6 @@ int ResourceDispatcher::StartAsync(const RequestInfo& request_info, request->url, request_info.download_to_file); - if (resource_scheduling_filter_.get() && - request_info.loading_web_task_runner) { - resource_scheduling_filter_->SetRequestIdTaskRunner( - request_id, - make_scoped_ptr(request_info.loading_web_task_runner->clone())); - } - message_sender_->Send(new ResourceHostMsg_RequestResource( request_info.routing_id, request_id, *request)); @@ -805,9 +794,4 @@ scoped_ptr<ResourceHostMsg_Request> ResourceDispatcher::CreateRequest( return request.Pass(); } -void ResourceDispatcher::SetResourceSchedulingFilter( - scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { - resource_scheduling_filter_ = resource_scheduling_filter; -} - } // namespace content diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h index 05500f5..864b081 100644 --- a/content/child/resource_dispatcher.h +++ b/content/child/resource_dispatcher.h @@ -39,7 +39,6 @@ namespace content { class RequestPeer; class ResourceDispatcherDelegate; class ResourceRequestBody; -class ResourceSchedulingFilter; class ThreadedDataProvider; struct ResourceResponseInfo; struct RequestInfo; @@ -130,9 +129,6 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { main_thread_task_runner_ = main_thread_task_runner; } - void SetResourceSchedulingFilter( - scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter); - private: friend class ResourceDispatcherTest; @@ -253,7 +249,6 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { base::TimeTicks io_timestamp_; scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; - scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; base::WeakPtrFactory<ResourceDispatcher> weak_factory_; diff --git a/content/child/resource_scheduling_filter.cc b/content/child/resource_scheduling_filter.cc index 6445c00..843cd87 100644 --- a/content/child/resource_scheduling_filter.cc +++ b/content/child/resource_scheduling_filter.cc @@ -9,32 +9,9 @@ #include "content/child/resource_dispatcher.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_start.h" -#include "third_party/WebKit/public/platform/WebTaskRunner.h" -#include "third_party/WebKit/public/platform/WebTraceLocation.h" namespace content { -namespace { -class DispatchMessageTask : public blink::WebTaskRunner::Task { - public: - DispatchMessageTask( - base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter, - const IPC::Message& message) - : resource_scheduling_filter_(resource_scheduling_filter), - message_(message) {} - - void run() override { - if (!resource_scheduling_filter_.get()) - return; - resource_scheduling_filter_->DispatchMessage(message_); - } - - private: - base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter_; - const IPC::Message message_; -}; -} // namespace - ResourceSchedulingFilter::ResourceSchedulingFilter( const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, ResourceDispatcher* resource_dispatcher) @@ -49,42 +26,12 @@ ResourceSchedulingFilter::~ResourceSchedulingFilter() { } bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) { - base::AutoLock lock(request_id_to_task_runner_map_lock_); - int request_id; - - base::PickleIterator pickle_iterator(message); - if (!pickle_iterator.ReadInt(&request_id)) { - NOTREACHED() << "malformed resource message"; - return true; - } - // Dispatch the message on the request id specific task runner, if there is - // one, or on the general main_thread_task_runner if there isn't. - RequestIdToTaskRunnerMap::const_iterator iter = - request_id_to_task_runner_map_.find(request_id); - if (iter != request_id_to_task_runner_map_.end()) { - // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE coexist. - iter->second->postTask( - blink::WebTraceLocation(__FUNCTION__, __FILE__), - new DispatchMessageTask(weak_ptr_factory_.GetWeakPtr(), message)); - } else { - main_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage, - weak_ptr_factory_.GetWeakPtr(), message)); - } + main_thread_task_runner_->PostTask( + FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage, + weak_ptr_factory_.GetWeakPtr(), message)); return true; } -void ResourceSchedulingFilter::SetRequestIdTaskRunner( - int id, scoped_ptr<blink::WebTaskRunner> web_task_runner) { - base::AutoLock lock(request_id_to_task_runner_map_lock_); - request_id_to_task_runner_map_.insert(id, web_task_runner.Pass()); -} - -void ResourceSchedulingFilter::ClearRequestIdTaskRunner(int id) { - base::AutoLock lock(request_id_to_task_runner_map_lock_); - request_id_to_task_runner_map_.erase(id); -} - bool ResourceSchedulingFilter::GetSupportedMessageClasses( std::vector<uint32>* supported_message_classes) const { supported_message_classes->push_back(ResourceMsgStart); diff --git a/content/child/resource_scheduling_filter.h b/content/child/resource_scheduling_filter.h index fd24559..7ea73c9 100644 --- a/content/child/resource_scheduling_filter.h +++ b/content/child/resource_scheduling_filter.h @@ -5,19 +5,12 @@ #ifndef CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_ #define CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_ -#include <map> - #include "base/containers/hash_tables.h" -#include "base/containers/scoped_ptr_map.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "content/common/content_export.h" #include "ipc/message_filter.h" -namespace blink { -class WebTaskRunner; -} - namespace content { class ResourceDispatcher; @@ -35,24 +28,10 @@ class CONTENT_EXPORT ResourceSchedulingFilter : public IPC::MessageFilter { bool GetSupportedMessageClasses( std::vector<uint32>* supported_message_classes) const override; - // Sets the task runner associated with request messages with |id|. - void SetRequestIdTaskRunner( - int id, scoped_ptr<blink::WebTaskRunner> web_task_runner); - - // Removes the task runner associated with |id|. - void ClearRequestIdTaskRunner(int id); - - void DispatchMessage(const IPC::Message& message); - - private: + protected: ~ResourceSchedulingFilter() override; - typedef base::ScopedPtrMap<int, scoped_ptr<blink::WebTaskRunner>> - RequestIdToTaskRunnerMap; - - // This lock guards |request_id_to_task_runner_map_| - base::Lock request_id_to_task_runner_map_lock_; - RequestIdToTaskRunnerMap request_id_to_task_runner_map_; + void DispatchMessage(const IPC::Message& message); scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; ResourceDispatcher* resource_dispatcher_; // NOT OWNED diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index 4baab4c..83c9ad5 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc @@ -16,7 +16,6 @@ #include "base/strings/string_util.h" #include "base/time/time.h" #include "components/mime_util/mime_util.h" -#include "components/scheduler/child/web_task_runner_impl.h" #include "content/child/child_thread_impl.h" #include "content/child/ftp_directory_listing_response_delegate.h" #include "content/child/multipart_response_delegate.h" @@ -43,7 +42,6 @@ #include "net/ssl/ssl_connection_status_flags.h" #include "net/url_request/url_request_data_job.h" #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" -#include "third_party/WebKit/public/platform/WebTraceLocation.h" #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURLError.h" #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" @@ -256,7 +254,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, public: Context(WebURLLoaderImpl* loader, ResourceDispatcher* resource_dispatcher, - scoped_ptr<blink::WebTaskRunner> task_runner); + scoped_refptr<base::SingleThreadTaskRunner> task_runner); WebURLLoaderClient* client() const { return client_; } void set_client(WebURLLoaderClient* client) { client_ = client; } @@ -269,7 +267,6 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, blink::WebThreadedDataReceiver* threaded_data_receiver); void Start(const WebURLRequest& request, SyncLoadResponse* sync_load_response); - void SetWebTaskRunner(scoped_ptr<blink::WebTaskRunner> task_runner); // RequestPeer methods: void OnUploadProgress(uint64 position, uint64 size) override; @@ -298,19 +295,6 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, friend class base::RefCounted<Context>; ~Context() override; - class HandleDataURLTask : public blink::WebTaskRunner::Task { - public: - explicit HandleDataURLTask(scoped_refptr<Context> context) - : context_(context) {} - - void run() override { - context_->HandleDataURL(); - } - - private: - scoped_refptr<Context> context_; - }; - // Called when the body data stream is detached from the reader side. void CancelBodyStreaming(); // We can optimize the handling of data URLs in most cases. @@ -321,7 +305,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, WebURLRequest request_; WebURLLoaderClient* client_; ResourceDispatcher* resource_dispatcher_; - scoped_ptr<blink::WebTaskRunner> web_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; WebReferrerPolicy referrer_policy_; scoped_ptr<FtpDirectoryListingResponseDelegate> ftp_listing_delegate_; scoped_ptr<MultipartResponseDelegate> multipart_delegate_; @@ -335,11 +319,11 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, WebURLLoaderImpl::Context::Context( WebURLLoaderImpl* loader, ResourceDispatcher* resource_dispatcher, - scoped_ptr<blink::WebTaskRunner> web_task_runner) + scoped_refptr<base::SingleThreadTaskRunner> task_runner) : loader_(loader), client_(NULL), resource_dispatcher_(resource_dispatcher), - web_task_runner_(web_task_runner.Pass()), + task_runner_(task_runner), referrer_policy_(blink::WebReferrerPolicyDefault), defers_loading_(NOT_DEFERRING), request_id_(-1) { @@ -375,11 +359,8 @@ void WebURLLoaderImpl::Context::SetDefersLoading(bool value) { defers_loading_ = SHOULD_DEFER; } else if (!value && defers_loading_ != NOT_DEFERRING) { if (defers_loading_ == DEFERRED_DATA) { - // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE - // coexist. - web_task_runner_->postTask( - ::blink::WebTraceLocation(__FUNCTION__, __FILE__), - new HandleDataURLTask(this)); + task_runner_->PostTask(FROM_HERE, + base::Bind(&Context::HandleDataURL, this)); } defers_loading_ = NOT_DEFERRING; } @@ -437,11 +418,8 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, GetInfoFromDataURL(sync_load_response->url, sync_load_response, &sync_load_response->data); } else { - // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE - // coexist. - web_task_runner_->postTask( - ::blink::WebTraceLocation(__FUNCTION__, __FILE__), - new HandleDataURLTask(this)); + task_runner_->PostTask(FROM_HERE, + base::Bind(&Context::HandleDataURL, this)); } return; } @@ -504,7 +482,6 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, GetRequestContextFrameTypeForWebURLRequest(request); request_info.extra_data = request.extraData(); request_info.report_raw_headers = request.reportRawHeaders(); - request_info.loading_web_task_runner.reset(web_task_runner_->clone()); scoped_refptr<ResourceRequestBody> request_body = GetRequestBodyForWebURLRequest(request).get(); @@ -519,11 +496,6 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, request_info, request_body.get(), this); } -void WebURLLoaderImpl::Context::SetWebTaskRunner( - scoped_ptr<blink::WebTaskRunner> web_task_runner) { - web_task_runner_ = web_task_runner.Pass(); -} - void WebURLLoaderImpl::Context::OnUploadProgress(uint64 position, uint64 size) { if (client_) client_->didSendData(loader_, position, size); @@ -869,8 +841,8 @@ void WebURLLoaderImpl::Context::HandleDataURL() { WebURLLoaderImpl::WebURLLoaderImpl( ResourceDispatcher* resource_dispatcher, - scoped_ptr<blink::WebTaskRunner> web_task_runner) - : context_(new Context(this, resource_dispatcher, web_task_runner.Pass())) { + scoped_refptr<base::SingleThreadTaskRunner> task_runner) + : context_(new Context(this, resource_dispatcher, task_runner)) { } WebURLLoaderImpl::~WebURLLoaderImpl() { @@ -1087,11 +1059,4 @@ bool WebURLLoaderImpl::attachThreadedDataReceiver( return context_->AttachThreadedDataReceiver(threaded_data_receiver); } -void WebURLLoaderImpl::setLoadingTaskRunner( - blink::WebTaskRunner* loading_task_runner) { - // There's no guarantee on the lifetime of |loading_task_runner| so we take a - // copy. - context_->SetWebTaskRunner(make_scoped_ptr(loading_task_runner->clone())); -} - } // namespace content diff --git a/content/child/web_url_loader_impl.h b/content/child/web_url_loader_impl.h index b31b57e..ebad018 100644 --- a/content/child/web_url_loader_impl.h +++ b/content/child/web_url_loader_impl.h @@ -36,10 +36,9 @@ struct StreamOverrideParameters { class CONTENT_EXPORT WebURLLoaderImpl : public NON_EXPORTED_BASE(blink::WebURLLoader) { public: - - // Takes ownership of |web_task_runner|. - WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, - scoped_ptr<blink::WebTaskRunner> web_task_runner); + explicit WebURLLoaderImpl( + ResourceDispatcher* resource_dispatcher, + scoped_refptr<base::SingleThreadTaskRunner> task_runner); ~WebURLLoaderImpl() override; static void PopulateURLResponse(const GURL& url, @@ -68,7 +67,6 @@ class CONTENT_EXPORT WebURLLoaderImpl int intra_priority_value) override; bool attachThreadedDataReceiver( blink::WebThreadedDataReceiver* threaded_data_receiver) override; - void setLoadingTaskRunner(blink::WebTaskRunner* loading_task_runner) override; private: class Context; diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc index fdb77c5..1d98b3f 100644 --- a/content/child/web_url_loader_impl_unittest.cc +++ b/content/child/web_url_loader_impl_unittest.cc @@ -13,7 +13,6 @@ #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" #include "base/time/time.h" -#include "components/scheduler/child/web_task_runner_impl.h" #include "content/child/request_extra_data.h" #include "content/child/request_info.h" #include "content/child/resource_dispatcher.h" @@ -107,10 +106,7 @@ class TestWebURLLoaderClient : public blink::WebURLLoaderClient { TestWebURLLoaderClient( ResourceDispatcher* dispatcher, scoped_refptr<base::SingleThreadTaskRunner> task_runner) - : loader_( - new WebURLLoaderImpl( - dispatcher, - make_scoped_ptr(new scheduler::WebTaskRunnerImpl(task_runner)))), + : loader_(new WebURLLoaderImpl(dispatcher, task_runner)), expect_multipart_response_(false), delete_on_receive_redirect_(false), delete_on_receive_response_(false), diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 65f86ab..aa5828c 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -1041,10 +1041,9 @@ void RenderThreadImpl::SetResourceDispatchTaskQueue( const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { // Add a filter that forces resource messages to be dispatched via a // particular task runner. - scoped_refptr<ResourceSchedulingFilter> filter( - new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher())); - channel()->AddFilter(filter.get()); - resource_dispatcher()->SetResourceSchedulingFilter(filter); + resource_scheduling_filter_ = + new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher()); + channel()->AddFilter(resource_scheduling_filter_.get()); // The ChildResourceMessageFilter and the ResourceDispatcher need to use the // same queue to ensure tasks are executed in the expected order. diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 9eed365..190d557 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -109,6 +109,7 @@ class RenderProcessObserver; class RendererBlinkPlatformImpl; class RendererDemuxerAndroid; class ResourceDispatchThrottler; +class ResourceSchedulingFilter; class V8SamplingProfiler; class VideoCaptureImplManager; class WebGraphicsContext3DCommandBufferImpl; @@ -615,6 +616,8 @@ class CONTENT_EXPORT RenderThreadImpl scoped_refptr<base::SingleThreadTaskRunner> main_thread_compositor_task_runner_; + scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; + // Compositor settings. bool is_gpu_rasterization_enabled_; bool is_gpu_rasterization_forced_; diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 8049ef3..f68ee6a 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc @@ -19,7 +19,6 @@ #include "build/build_config.h" #include "cc/blink/context_provider_web_context.h" #include "components/scheduler/child/web_scheduler_impl.h" -#include "components/scheduler/child/web_task_runner_impl.h" #include "components/scheduler/renderer/renderer_scheduler.h" #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" #include "components/url_formatter/url_formatter.h" @@ -33,7 +32,6 @@ #include "content/child/simple_webmimeregistry_impl.h" #include "content/child/thread_safe_sender.h" #include "content/child/web_database_observer_impl.h" -#include "content/child/web_url_loader_impl.h" #include "content/child/webblobregistry_impl.h" #include "content/child/webfileutilities_impl.h" #include "content/child/webmessageportchannel_impl.h" @@ -239,7 +237,6 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( sudden_termination_disables_(0), plugin_refresh_allowed_(true), default_task_runner_(renderer_scheduler->DefaultTaskRunner()), - loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) { #if !defined(OS_ANDROID) && !defined(OS_WIN) if (g_sandbox_enabled && sandboxEnabled()) { @@ -276,19 +273,6 @@ void RendererBlinkPlatformImpl::Shutdown() { //------------------------------------------------------------------------------ -blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { - ChildThreadImpl* child_thread = ChildThreadImpl::current(); - // There may be no child thread in RenderViewTests. These tests can still use - // data URLs to bypass the ResourceDispatcher. - scoped_ptr<scheduler::WebTaskRunnerImpl> task_runner( - new scheduler::WebTaskRunnerImpl( - loading_task_runner_->BelongsToCurrentThread() - ? loading_task_runner_ : base::ThreadTaskRunnerHandle::Get())); - return new content::WebURLLoaderImpl( - child_thread ? child_thread->resource_dispatcher() : NULL, - task_runner.Pass()); -} - blink::WebThread* RendererBlinkPlatformImpl::currentThread() { if (main_thread_->isCurrentThread()) return main_thread_.get(); diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 32edd5f..6a64c59 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h @@ -205,8 +205,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { return web_database_observer_impl_.get(); } - blink::WebURLLoader* createURLLoader() override; - private: bool CheckPreparsedJsCachingEnabled() const; @@ -256,7 +254,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; - scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; scoped_refptr<ThreadSafeSender> thread_safe_sender_; scoped_refptr<QuotaMessageFilter> quota_message_filter_; diff --git a/content/test/mock_weburlloader.h b/content/test/mock_weburlloader.h index 4b96ed3d..db26111 100644 --- a/content/test/mock_weburlloader.h +++ b/content/test/mock_weburlloader.h @@ -23,8 +23,6 @@ class MockWebURLLoader : public blink::WebURLLoader { blink::WebURLLoaderClient* client)); MOCK_METHOD0(cancel, void()); MOCK_METHOD1(setDefersLoading, void(bool value)); - MOCK_METHOD1(setLoadingTaskRunner, - void(blink::WebTaskRunner* loading_task_runner)); private: DISALLOW_COPY_AND_ASSIGN(MockWebURLLoader); diff --git a/content/test/weburl_loader_mock.cc b/content/test/weburl_loader_mock.cc index c0d6ffc..30826fb 100644 --- a/content/test/weburl_loader_mock.cc +++ b/content/test/weburl_loader_mock.cc @@ -147,7 +147,3 @@ void WebURLLoaderMock::setDefersLoading(bool deferred) { } NOTIMPLEMENTED(); } - -void WebURLLoaderMock::setLoadingTaskRunner(blink::WebTaskRunner*) { - NOTIMPLEMENTED(); -} diff --git a/content/test/weburl_loader_mock.h b/content/test/weburl_loader_mock.h index a098a8e..025eaef 100644 --- a/content/test/weburl_loader_mock.h +++ b/content/test/weburl_loader_mock.h @@ -55,8 +55,6 @@ class WebURLLoaderMock : public blink::WebURLLoader { bool isDeferred() { return is_deferred_; } - void setLoadingTaskRunner(blink::WebTaskRunner*) override; - private: WebURLLoaderMockFactory* factory_; blink::WebURLLoaderClient* client_; diff --git a/media/blink/mock_weburlloader.h b/media/blink/mock_weburlloader.h index 68cf6da..70dd5a6 100644 --- a/media/blink/mock_weburlloader.h +++ b/media/blink/mock_weburlloader.h @@ -23,7 +23,6 @@ class MockWebURLLoader : public blink::WebURLLoader { blink::WebURLLoaderClient* client)); MOCK_METHOD0(cancel, void()); MOCK_METHOD1(setDefersLoading, void(bool value)); - MOCK_METHOD1(setLoadingTaskRunner, void(blink::WebTaskRunner* task_runner)); private: DISALLOW_COPY_AND_ASSIGN(MockWebURLLoader); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp index 7c178f9..d38e6cc 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp @@ -18,7 +18,6 @@ #include "platform/ThreadSafeFunctional.h" #include "platform/TraceEvent.h" #include "public/platform/Platform.h" -#include "public/platform/WebScheduler.h" #include "wtf/MainThread.h" #include "wtf/text/TextEncodingRegistry.h" @@ -163,7 +162,7 @@ private: class SourceStream : public v8::ScriptCompiler::ExternalSourceStream { WTF_MAKE_NONCOPYABLE(SourceStream); public: - explicit SourceStream(WebTaskRunner* loadingTaskRunner) + SourceStream() : v8::ScriptCompiler::ExternalSourceStream() , m_cancelled(false) , m_finished(false) @@ -171,7 +170,6 @@ public: , m_queueTailPosition(0) , m_bookmarkPosition(0) , m_lengthOfBOM(0) - , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone())) { } @@ -221,7 +219,7 @@ public: } // Inform main thread to re-queue the data. - m_loadingTaskRunner->postTask( + Platform::current()->mainThread()->taskRunner()->postTask( FROM_HERE, bind(&SourceStream::fetchDataFromResourceBuffer, this, 0)); } @@ -372,18 +370,16 @@ private: // We store this separately, to avoid having to guard all // m_queueLeadPosition references with a mutex. unsigned m_lengthOfBOM; // Used by both threads; guarded by m_mutex. - - OwnPtr<WebTaskRunner> m_loadingTaskRunner; }; size_t ScriptStreamer::kSmallScriptThreshold = 30 * 1024; -void ScriptStreamer::startStreaming(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState, WebTaskRunner* loadingTaskRunner) +void ScriptStreamer::startStreaming(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState) { // We don't yet know whether the script will really be streamed. E.g., // suppressing streaming for short scripts is done later. Record only the // sure negative cases here. - bool startedStreaming = startStreamingInternal(script, scriptType, settings, scriptState, loadingTaskRunner); + bool startedStreaming = startStreamingInternal(script, scriptType, settings, scriptState); if (!startedStreaming) Platform::current()->histogramEnumeration(startedStreamingHistogramName(scriptType), 0, 2); } @@ -425,7 +421,7 @@ void ScriptStreamer::streamingCompleteOnBackgroundThread() // notifyFinished might already be called, or it might be called in the // future (if the parsing finishes earlier because of a parse error). - m_loadingTaskRunner->postTask(FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, AllowCrossThreadAccess(this))); + Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, AllowCrossThreadAccess(this))); // The task might delete ScriptStreamer, so it's not safe to do anything // after posting it. Note that there's no way to guarantee that this @@ -517,7 +513,7 @@ void ScriptStreamer::notifyAppendData(ScriptResource* resource) ASSERT(!m_stream); ASSERT(!m_source); - m_stream = new SourceStream(m_loadingTaskRunner.get()); + m_stream = new SourceStream(); // m_source takes ownership of m_stream. m_source = adoptPtr(new v8::ScriptCompiler::StreamedSource(m_stream, m_encoding)); @@ -568,7 +564,7 @@ void ScriptStreamer::notifyFinished(Resource* resource) notifyFinishedToClient(); } -ScriptStreamer::ScriptStreamer(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner) +ScriptStreamer::ScriptStreamer(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions) : m_resource(resource) , m_detached(false) , m_stream(0) @@ -581,7 +577,6 @@ ScriptStreamer::ScriptStreamer(ScriptResource* resource, PendingScript::Type scr , m_scriptState(scriptState) , m_scriptType(scriptType) , m_encoding(v8::ScriptCompiler::StreamedSource::TWO_BYTE) // Unfortunately there's no dummy encoding value in the enum; let's use one we don't stream. - , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone())) { } @@ -637,7 +632,7 @@ void ScriptStreamer::notifyFinishedToClient() m_client->notifyFinished(m_resource); } -bool ScriptStreamer::startStreamingInternal(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState, WebTaskRunner* loadingTaskRunner) +bool ScriptStreamer::startStreamingInternal(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState) { ASSERT(isMainThread()); ASSERT(scriptState->contextIsValid()); @@ -670,7 +665,7 @@ bool ScriptStreamer::startStreamingInternal(PendingScript& script, PendingScript // The Resource might go out of scope if the script is no longer // needed. This makes PendingScript notify the ScriptStreamer when it is // destroyed. - script.setStreamer(ScriptStreamer::create(resource, scriptType, scriptState, compileOption, loadingTaskRunner)); + script.setStreamer(ScriptStreamer::create(resource, scriptType, scriptState, compileOption)); return true; } diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h index c002175..e3eb425 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h @@ -21,7 +21,6 @@ class ScriptResourceClient; class ScriptState; class Settings; class SourceStream; -class WebTaskRunner; // ScriptStreamer streams incomplete script data to V8 so that it can be parsed // while it's loaded. PendingScript holds a reference to ScriptStreamer. At the @@ -33,9 +32,9 @@ class WebTaskRunner; class CORE_EXPORT ScriptStreamer final : public RefCountedWillBeRefCountedGarbageCollected<ScriptStreamer> { WTF_MAKE_NONCOPYABLE(ScriptStreamer); public: - static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner) + static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions) { - return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions, loadingTaskRunner)); + return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions)); } ~ScriptStreamer(); @@ -43,7 +42,7 @@ public: // Launches a task (on a background thread) which will stream the given // PendingScript into V8 as it loads. - static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*); + static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*); // Returns false if we cannot stream the given encoding. static bool convertEncoding(const char* encodingName, v8::ScriptCompiler::StreamedSource::Encoding*); @@ -108,12 +107,12 @@ private: // streamed. Non-const for testing. static size_t kSmallScriptThreshold; - ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions, WebTaskRunner*); + ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions); void streamingComplete(); void notifyFinishedToClient(); - static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*); + static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*); // This pointer is weak. If PendingScript and its Resource are deleted // before ScriptStreamer, PendingScript will notify ScriptStreamer of its @@ -150,8 +149,6 @@ private: // Encoding of the streamed script. Saved for sanity checking purposes. v8::ScriptCompiler::StreamedSource::Encoding m_encoding; - - OwnPtr<WebTaskRunner> m_loadingTaskRunner; }; } // namespace blink diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp index cbfdd8c..62d9c84 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp @@ -18,7 +18,6 @@ #include "platform/heap/Handle.h" #include "platform/testing/UnitTestHelpers.h" #include "public/platform/Platform.h" -#include "public/platform/WebScheduler.h" #include <gtest/gtest.h> #include <v8.h> @@ -65,8 +64,7 @@ private: class ScriptStreamingTest : public ::testing::Test { public: ScriptStreamingTest() - : m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()->loadingTaskRunner()) - , m_scope(v8::Isolate::GetCurrent()) + : m_scope(v8::Isolate::GetCurrent()) , m_settings(Settings::create()) , m_resourceRequest("http://www.streaming-test.com/") , m_resource(new ScriptResource(m_resourceRequest, "UTF-8")) @@ -118,7 +116,6 @@ protected: testing::runPendingTasks(); } - WebTaskRunner* m_loadingTaskRunner; // NOT OWNED V8TestingScope m_scope; OwnPtr<Settings> m_settings; // The Resource and PendingScript where we stream from. These don't really @@ -145,7 +142,7 @@ private: TEST_F(ScriptStreamingTest, CompilingStreamedScript) { // Test that we can successfully compile a streamed script. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); @@ -176,7 +173,7 @@ TEST_F(ScriptStreamingTest, CompilingStreamedScriptWithParseError) // Test that scripts with parse errors are handled properly. In those cases, // the V8 side typically finished before loading finishes: make sure we // handle it gracefully. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); appendData("function foo() {"); @@ -208,7 +205,7 @@ TEST_F(ScriptStreamingTest, CancellingStreaming) { // Test that the upper layers (PendingScript and up) can be ramped down // while streaming is ongoing, and ScriptStreamer handles it gracefully. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); appendData("function foo() {"); @@ -237,7 +234,7 @@ TEST_F(ScriptStreamingTest, SuppressingStreaming) // is suppressed (V8 doesn't parse while the script is loading), and the // upper layer (ScriptResourceClient) should get a notification when the // script is loaded. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); appendData("function foo() {"); @@ -266,7 +263,7 @@ TEST_F(ScriptStreamingTest, EmptyScripts) // Empty scripts should also be streamed properly, that is, the upper layer // (ScriptResourceClient) should be notified when an empty script has been // loaded. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); @@ -287,7 +284,7 @@ TEST_F(ScriptStreamingTest, SmallScripts) // Small scripts shouldn't be streamed. ScriptStreamer::setSmallScriptThresholdForTesting(100); - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); @@ -311,7 +308,7 @@ TEST_F(ScriptStreamingTest, ScriptsWithSmallFirstChunk) // chunk is small. ScriptStreamer::setSmallScriptThresholdForTesting(100); - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); @@ -341,7 +338,7 @@ TEST_F(ScriptStreamingTest, EncodingChanges) // loading it. m_resource->setEncoding("windows-1252"); - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); @@ -370,7 +367,7 @@ TEST_F(ScriptStreamingTest, EncodingFromBOM) // will also affect encoding detection. m_resource->setEncoding("windows-1252"); // This encoding is wrong on purpose. - ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState()); TestScriptResourceClient client; pendingScript().watchForLoad(&client); diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 34b8f70..f057388 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -5685,13 +5685,6 @@ bool Document::isSecureContext(String& errorMessage, const SecureContextCheck pr return true; } -WebTaskRunner* Document::loadingTaskRunner() const -{ - if (frame()) - return frame()->frameScheduler()->loadingTaskRunner(); - return Platform::current()->currentThread()->scheduler()->loadingTaskRunner(); -} - DEFINE_TRACE(Document) { #if ENABLE(OILPAN) diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 511c567..926381d 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h @@ -1049,8 +1049,6 @@ public: using WeakDocumentSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<Document>>; static WeakDocumentSet& liveDocumentSet(); - WebTaskRunner* loadingTaskRunner() const; - protected: Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp index 8f8b617..e63ea29 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp @@ -50,7 +50,6 @@ #include "core/svg/SVGScriptElement.h" #include "platform/MIMETypeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" -#include "public/platform/WebFrameScheduler.h" #include "wtf/StdLibExtras.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/StringHash.h" @@ -260,7 +259,7 @@ bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, Legacy if (frame) { ScriptState* scriptState = ScriptState::forMainWorld(frame); if (scriptState->contextIsValid()) - ScriptStreamer::startStreaming(m_pendingScript, PendingScript::Async, frame->settings(), scriptState, frame->frameScheduler()->loadingTaskRunner()); + ScriptStreamer::startStreaming(m_pendingScript, PendingScript::Async, frame->settings(), scriptState); } contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRunner::ASYNC_EXECUTION); // Note that watchForLoad can immediately call notifyFinished. diff --git a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp index 68adfdf..f5cf582 100644 --- a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp @@ -72,7 +72,7 @@ public: explicit MockWebTaskRunner(Deque<OwnPtr<WebTaskRunner::Task>>* tasks) : m_tasks(tasks) { } ~MockWebTaskRunner() override { } - void postTask(const WebTraceLocation&, Task* task) override + virtual void postTask(const WebTraceLocation&, Task* task) { m_tasks->append(adoptPtr(task)); } @@ -82,12 +82,6 @@ public: ASSERT_NOT_REACHED(); } - WebTaskRunner* clone() override - { - ASSERT_NOT_REACHED(); - return nullptr; - } - Deque<OwnPtr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED }; diff --git a/third_party/WebKit/Source/core/fetch/FetchContext.h b/third_party/WebKit/Source/core/fetch/FetchContext.h index 243bf2b..dbcb39b 100644 --- a/third_party/WebKit/Source/core/fetch/FetchContext.h +++ b/third_party/WebKit/Source/core/fetch/FetchContext.h @@ -48,7 +48,6 @@ class ResourceLoader; class ResourceResponse; class ResourceRequest; class ResourceTimingInfo; -class WebTaskRunner; enum FetchResourceType { FetchMainResource, @@ -107,7 +106,6 @@ public: virtual bool fetchIncreasePriorities() const { return false; } virtual ResourceLoadPriority modifyPriorityForExperiments(ResourceLoadPriority priority, Resource::Type, const FetchRequest&) { return priority; } - virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } protected: FetchContext() { } diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp index bea44b3..8e09575 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp @@ -172,14 +172,6 @@ ResourceFetcher::~ResourceFetcher() #endif } -WebTaskRunner* ResourceFetcher::loadingTaskRunner() -{ - if (!m_context) - return nullptr; - - return m_context->loadingTaskRunner(); -} - Resource* ResourceFetcher::cachedResource(const KURL& resourceURL) const { KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(resourceURL); diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h index 26cdfdc..670f1ca 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h @@ -147,8 +147,6 @@ public: bool clientDefersImage(const KURL&) const; void determineRequestContext(ResourceRequest&, Resource::Type); - WebTaskRunner* loadingTaskRunner(); - private: friend class ResourceCacheValidationSuppressor; diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp index 2305adf..be3969e 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp +++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp @@ -142,7 +142,6 @@ void ResourceLoader::start() m_loader = adoptPtr(Platform::current()->createURLLoader()); ASSERT(m_loader); - m_loader->setLoadingTaskRunner(m_fetcher->loadingTaskRunner()); WrappedResourceRequest wrappedRequest(m_request); m_loader->loadAsynchronously(wrappedRequest, this); } diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp index e069d7b..3589b67 100644 --- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp @@ -33,7 +33,7 @@ #include "platform/Task.h" #include "platform/ThreadSafeFunctional.h" #include "public/platform/Platform.h" -#include "public/platform/WebTaskRunner.h" +#include "public/platform/WebScheduler.h" #include "wtf/text/TextPosition.h" namespace blink { @@ -81,9 +81,9 @@ static void checkThatXSSInfosAreSafeToSendToAnotherThread(const XSSInfoStream& i #endif -void BackgroundHTMLParser::start(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebTaskRunner* loadingTaskRunner) +void BackgroundHTMLParser::start(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebScheduler* scheduler) { - new BackgroundHTMLParser(reference, config, loadingTaskRunner); + new BackgroundHTMLParser(reference, config, scheduler); // Caller must free by calling stop(). } @@ -93,7 +93,7 @@ BackgroundHTMLParser::Configuration::Configuration() { } -BackgroundHTMLParser::BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebTaskRunner* loadingTaskRunner) +BackgroundHTMLParser::BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebScheduler* scheduler) : m_weakFactory(reference, this) , m_token(adoptPtr(new HTMLToken)) , m_tokenizer(HTMLTokenizer::create(config->options)) @@ -106,7 +106,7 @@ BackgroundHTMLParser::BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHT , m_xssAuditor(config->xssAuditor.release()) , m_preloadScanner(config->preloadScanner.release()) , m_decoder(config->decoder.release()) - , m_loadingTaskRunner(loadingTaskRunner) + , m_scheduler(scheduler) , m_startingScript(false) { ASSERT(m_outstandingTokenLimit > 0); @@ -157,7 +157,7 @@ void BackgroundHTMLParser::updateDocument(const String& decodedData) m_lastSeenEncodingData = encodingData; m_xssAuditor->setEncoding(encodingData.encoding()); - m_loadingTaskRunner->postTask( + m_scheduler->loadingTaskRunner()->postTask( FROM_HERE, threadSafeBind(&HTMLDocumentParser::didReceiveEncodingDataFromBackgroundParser, AllowCrossThreadAccess(m_parser), encodingData)); } @@ -291,7 +291,7 @@ void BackgroundHTMLParser::sendTokensToMainThread() chunk->startingScript = m_startingScript; m_startingScript = false; - m_loadingTaskRunner->postTask( + m_scheduler->loadingTaskRunner()->postTask( FROM_HERE, new Task(threadSafeBind(&HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser, AllowCrossThreadAccess(m_parser), chunk.release()))); diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h index 6430f31..6922c31 100644 --- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h +++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h @@ -42,7 +42,7 @@ namespace blink { class HTMLDocumentParser; class XSSAuditor; -class WebTaskRunner; +class WebScheduler; class BackgroundHTMLParser { WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser); @@ -63,7 +63,7 @@ public: size_t pendingTokenLimit; }; - static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebTaskRunner*); + static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*); struct Checkpoint { WTF_MAKE_FAST_ALLOCATED(CheckPoint); @@ -90,7 +90,7 @@ public: void forcePlaintextForTextDocument(); private: - BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebTaskRunner*); + BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*); ~BackgroundHTMLParser(); void appendDecodedBytes(const String&); @@ -118,7 +118,7 @@ private: OwnPtr<TokenPreloadScanner> m_preloadScanner; OwnPtr<TextResourceDecoder> m_decoder; DocumentEncodingData m_lastSeenEncodingData; - WebTaskRunner* m_loadingTaskRunner; // NOT OWNED, task runner will outlive BackgroundHTMLParserr + WebScheduler* m_scheduler; // NOT OWNED, scheduler will outlive BackgroundHTMLParser bool m_startingScript; }; diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp index 6a9670d..868e71e 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp @@ -50,7 +50,6 @@ #include "platform/TraceEvent.h" #include "platform/heap/Handle.h" #include "public/platform/Platform.h" -#include "public/platform/WebFrameScheduler.h" #include "public/platform/WebScheduler.h" #include "public/platform/WebThread.h" #include "wtf/RefCounted.h" @@ -144,8 +143,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors , m_tokenizer(syncPolicy == ForceSynchronousParsing ? HTMLTokenizer::create(m_options) : nullptr) , m_scriptRunner(HTMLScriptRunner::create(&document, this)) , m_treeBuilder(HTMLTreeBuilder::create(this, &document, parserContentPolicy(), reportErrors, m_options)) - , m_loadingTaskRunner(adoptPtr(document.loadingTaskRunner()->clone())) - , m_parserScheduler(HTMLParserScheduler::create(this, m_loadingTaskRunner.get())) + , m_parserScheduler(HTMLParserScheduler::create(this)) , m_xssAuditorDelegate(&document) , m_weakFactory(this) , m_preloader(HTMLResourcePreloader::create(document)) @@ -168,7 +166,6 @@ HTMLDocumentParser::HTMLDocumentParser(DocumentFragment* fragment, Element* cont , m_token(adoptPtr(new HTMLToken)) , m_tokenizer(HTMLTokenizer::create(m_options)) , m_treeBuilder(HTMLTreeBuilder::create(this, fragment, contextElement, this->parserContentPolicy(), m_options)) - , m_loadingTaskRunner(adoptPtr(fragment->document().loadingTaskRunner()->clone())) , m_xssAuditorDelegate(&fragment->document()) , m_weakFactory(this) , m_shouldUseThreading(false) @@ -804,7 +801,7 @@ void HTMLDocumentParser::startBackgroundParser() ASSERT(config->xssAuditor->isSafeToSendToAnotherThread()); ASSERT(config->preloadScanner->isSafeToSendToAnotherThread()); HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParser::start, reference.release(), config.release(), - AllowCrossThreadAccess(m_loadingTaskRunner.get()))); + AllowCrossThreadAccess(Platform::current()->currentThread()->scheduler()))); } void HTMLDocumentParser::stopBackgroundParser() diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h index f41d9b03..8fba554 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h @@ -187,7 +187,6 @@ private: OwnPtrWillBeMember<HTMLTreeBuilder> m_treeBuilder; OwnPtr<HTMLPreloadScanner> m_preloadScanner; OwnPtr<HTMLPreloadScanner> m_insertionPreloadScanner; - OwnPtr<WebTaskRunner> m_loadingTaskRunner; OwnPtr<HTMLParserScheduler> m_parserScheduler; HTMLSourceTracker m_sourceTracker; TextPosition m_textPosition; diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp index 58a3ded..c15e43b5 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp @@ -82,9 +82,9 @@ void SpeculationsPumpSession::addedElementTokens(size_t count) m_processedElementTokens += count; } -HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser, WebTaskRunner* loadingTaskRunner) +HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser) : m_parser(parser) - , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone())) + , m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()->loadingTaskRunner()) , m_cancellableContinueParse(CancellableTaskFactory::create(this, &HTMLParserScheduler::continueParsing)) , m_isSuspendedWithActiveTimer(false) { diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h index ad3ccaa..d7878db 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h @@ -36,7 +36,6 @@ namespace blink { class Document; class HTMLDocumentParser; -class WebTaskRunner; class ActiveParserSession : public NestingLevelIncrementer { STACK_ALLOCATED(); @@ -73,9 +72,9 @@ private: class HTMLParserScheduler { WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED(HTMLParserScheduler); public: - static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser, WebTaskRunner* loadingTaskRunner) + static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser) { - return adoptPtr(new HTMLParserScheduler(parser, loadingTaskRunner)); + return adoptPtr(new HTMLParserScheduler(parser)); } ~HTMLParserScheduler(); @@ -99,13 +98,13 @@ public: void detach(); // Clear active tasks if any. private: - HTMLParserScheduler(HTMLDocumentParser*, WebTaskRunner*); + explicit HTMLParserScheduler(HTMLDocumentParser*); bool shouldYield(const SpeculationsPumpSession&, bool startingScript) const; void continueParsing(); HTMLDocumentParser* m_parser; - OwnPtr<WebTaskRunner> m_loadingTaskRunner; + WebTaskRunner* m_loadingTaskRunner; // NOT OWNED OwnPtr<CancellableTaskFactory> m_cancellableContinueParse; bool m_isSuspendedWithActiveTimer; diff --git a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp index 35b1258..3d80848 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp @@ -40,7 +40,6 @@ #include "core/html/parser/NestingLevelIncrementer.h" #include "platform/NotImplemented.h" #include "public/platform/Platform.h" -#include "public/platform/WebFrameScheduler.h" namespace blink { @@ -288,7 +287,7 @@ void HTMLScriptRunner::requestParsingBlockingScript(Element* element) if (m_document->frame()) { ScriptState* scriptState = ScriptState::forMainWorld(m_document->frame()); if (scriptState->contextIsValid()) - ScriptStreamer::startStreaming(m_parserBlockingScript, PendingScript::ParsingBlocking, m_document->frame()->settings(), scriptState, m_document->loadingTaskRunner()); + ScriptStreamer::startStreaming(m_parserBlockingScript, PendingScript::ParsingBlocking, m_document->frame()->settings(), scriptState); } m_parserBlockingScript.watchForLoad(this); @@ -304,7 +303,7 @@ void HTMLScriptRunner::requestDeferredScript(Element* element) if (m_document->frame() && !pendingScript.isReady()) { ScriptState* scriptState = ScriptState::forMainWorld(m_document->frame()); if (scriptState->contextIsValid()) - ScriptStreamer::startStreaming(pendingScript, PendingScript::Deferred, m_document->frame()->settings(), scriptState, m_document->loadingTaskRunner()); + ScriptStreamer::startStreaming(pendingScript, PendingScript::Deferred, m_document->frame()->settings(), scriptState); } ASSERT(pendingScript.resource()); diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 5fb9d1e..527a8d1 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp @@ -64,7 +64,6 @@ #include "platform/network/ResourceTimingInfo.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityPolicy.h" -#include "public/platform/WebFrameScheduler.h" #include <algorithm> @@ -733,11 +732,6 @@ ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(ResourceLoa return static_cast<ResourceLoadPriority>(modifiedPriority); } -WebTaskRunner* FrameFetchContext::loadingTaskRunner() const -{ - return frame()->frameScheduler()->loadingTaskRunner(); -} - DEFINE_TRACE(FrameFetchContext) { visitor->trace(m_document); diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index a71afae..de5c516 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h @@ -109,8 +109,6 @@ public: void countClientHintsResourceWidth() override; void countClientHintsViewportWidth() override; - WebTaskRunner* loadingTaskRunner() const override; - DECLARE_VIRTUAL_TRACE(); private: diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index e25c9cb..05fe067 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp @@ -1072,8 +1072,7 @@ bool FrameLoader::prepareForCommit() if (m_frame->document()) m_frame->document()->detach(); m_documentLoader = m_provisionalDocumentLoader.release(); - m_frame->updateFrameSecurityOrigin(); - + return true; } diff --git a/third_party/WebKit/Source/platform/TimerTest.cpp b/third_party/WebKit/Source/platform/TimerTest.cpp index 6db91cb..9a0900c 100644 --- a/third_party/WebKit/Source/platform/TimerTest.cpp +++ b/third_party/WebKit/Source/platform/TimerTest.cpp @@ -77,7 +77,7 @@ public: explicit MockWebTaskRunner(std::priority_queue<DelayedTask>* timerTasks) : m_timerTasks(timerTasks) { } ~MockWebTaskRunner() override { } - void postTask(const WebTraceLocation&, Task* task) override + virtual void postTask(const WebTraceLocation&, Task* task) { m_timerTasks->push(DelayedTask(task, 0)); } @@ -87,12 +87,6 @@ public: m_timerTasks->push(DelayedTask(task, delayMs * 0.001)); } - WebTaskRunner* clone() override - { - ASSERT_NOT_REACHED(); - return nullptr; - } - std::priority_queue<DelayedTask>* m_timerTasks; // NOT OWNED }; diff --git a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp index abc94b7..8cf1c04 100644 --- a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp @@ -260,7 +260,7 @@ private: MockWebTaskRunner() : m_task(0) { } ~MockWebTaskRunner() override { } - void postTask(const WebTraceLocation&, Task* task) override + virtual void postTask(const WebTraceLocation&, Task* task) { EXPECT_EQ((Task*)0, m_task); m_task = task; @@ -268,12 +268,6 @@ private: void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) override { ASSERT_NOT_REACHED(); }; - WebTaskRunner* clone() override - { - ASSERT_NOT_REACHED(); - return nullptr; - } - Task* m_task; }; diff --git a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp index a167fc4..bd33455 100644 --- a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp +++ b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp @@ -383,9 +383,4 @@ void AssociatedURLLoader::setDefersLoading(bool defersLoading) m_loader->setDefersLoading(defersLoading); } -void AssociatedURLLoader::setLoadingTaskRunner(blink::WebTaskRunner*) -{ - // TODO(alexclarke): Maybe support this one day if it proves worthwhile. -} - } // namespace blink diff --git a/third_party/WebKit/Source/web/AssociatedURLLoader.h b/third_party/WebKit/Source/web/AssociatedURLLoader.h index 6dcd06e..41b0c26 100644 --- a/third_party/WebKit/Source/web/AssociatedURLLoader.h +++ b/third_party/WebKit/Source/web/AssociatedURLLoader.h @@ -54,7 +54,6 @@ public: void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*) override; void cancel() override; void setDefersLoading(bool) override; - void setLoadingTaskRunner(blink::WebTaskRunner*) override; private: diff --git a/third_party/WebKit/public/platform/WebTaskRunner.h b/third_party/WebKit/public/platform/WebTaskRunner.h index 6d12febc..4369ad9 100644 --- a/third_party/WebKit/public/platform/WebTaskRunner.h +++ b/third_party/WebKit/public/platform/WebTaskRunner.h @@ -28,14 +28,11 @@ public: // Schedule a task to be run on the the associated WebThread. // Takes ownership of |Task|. Can be called from any thread. - virtual void postTask(const WebTraceLocation&, Task*) = 0; + virtual void postTask(const WebTraceLocation&, Task*) {} // Schedule a task to be run after |delayMs| on the the associated WebThread. // Takes ownership of |Task|. Can be called from any thread. - virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) = 0; - - // Returns a clone of the WebTaskRunner. - virtual WebTaskRunner* clone() = 0; + virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) {} #ifdef INSIDE_BLINK // Helpers for posting bound functions as tasks. diff --git a/third_party/WebKit/public/platform/WebURLLoader.h b/third_party/WebKit/public/platform/WebURLLoader.h index 3a91423..eada222 100644 --- a/third_party/WebKit/public/platform/WebURLLoader.h +++ b/third_party/WebKit/public/platform/WebURLLoader.h @@ -37,7 +37,6 @@ namespace blink { class WebData; -class WebTaskRunner; class WebThreadedDataReceiver; class WebURLLoaderClient; class WebURLResponse; @@ -79,10 +78,6 @@ public: // of the data receiver is assumed by the WebURLLoader and the receiver should // be deleted on the main thread when no longer needed. virtual bool attachThreadedDataReceiver(WebThreadedDataReceiver*) { return false; } - - // Sets the task runner for which any loading tasks should be posted on. - // Takes ownership of the WebTaskRunner. - virtual void setLoadingTaskRunner(WebTaskRunner*) = 0; }; } // namespace blink |