New issue
Advanced search Search tips

Issue 789697 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Remove WTF::WeakPtr and replace it with base::WeakPtr

Project Member Reported by slangley@chromium.org, Nov 29 2017

Issue description

WTF::WeakPtr is already an alias for base::WeakPtr, we just need to fix up a few WeakPtrFactory methods that have different names from base:: to WTF::.
 
Cc: dcheng@chromium.org
Owner: slangley@chromium.org
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9709c486a33ea3c5c831e3216310259fb9bbba4

commit c9709c486a33ea3c5c831e3216310259fb9bbba4
Author: Stuart Langley <slangley@chromium.org>
Date: Fri Dec 01 18:25:00 2017

Start the replacement of WTF::WeakPtr with base::WeakPtr.

This CL lays the groundwork for removing WFT::WeakPtr and
replacing it with base::WeakPtr.

Note: WTF::WeakPtr is already just an alias for base::WeakPtr,
so there is no change in functionality. WTF::WeakPtrFactory
wraps base::WeakPtrFactory and is using "USING_FAST_MALLOC"
but I don't see this type being explicitly new'd up, so I don't
think changing to base::WeakPtrFactory is of any consequence.

Changes in the CL:

- Update presubmit script to allow base::WeakPtr &
  base::WeakPtrFactory from blink code.
- Update all the DEPS files to allow "base/memory/weak_ptr.h"
  to be used from blink code.
- Make changes to some files in (core|modules|platform) to use
  base::WeakPtr(Factory) to validate above changes.
- In places remove "platform/wtf/WeakPtr.h" where it's no longer
  used in the file.
- In places where base::WeakPtr was already being used but it
  was transitively included, fix the includes.
- Where we are now using base::WeakPtr(Factory) use base:: to
  lookup the right WeakPtr.

The subsequent CL will remove WTF::WeakPtr. I was going to try and
do it all in 1 CL but it got too big to review.

Bug:  789697 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ifce07560e5da85b007696989c50229134458f4ea
Reviewed-on: https://chromium-review.googlesource.com/801410
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dimitri Glazkov <dglazkov@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520989}
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/DEPS
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/core/loader/ImageLoader.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/core/loader/ImageLoader.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/core/workers/DedicatedWorkerObjectProxy.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/accessibility/AXRelationCache.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/mediacapturefromelement/OnRequestCanvasDrawListener.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/mediacapturefromelement/OnRequestCanvasDrawListener.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/mediacapturefromelement/TimedCanvasDrawListener.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/mediacapturefromelement/TimedCanvasDrawListener.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/CrossThreadCopier.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/Timer.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/Timer.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/WebTaskRunner.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/WebTaskRunner.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/fonts/FontFallbackList.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/loader/fetch/RawResource.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/base/task_queue.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/child/idle_canceled_delayed_task_sweeper.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/child/idle_helper.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/scheduler/test/test_task_queue.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/Tools/Scripts/audit-non-blink-usage.py
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/public/platform/DEPS
[modify] https://crrev.com/c9709c486a33ea3c5c831e3216310259fb9bbba4/third_party/WebKit/public/platform/scheduler/child/single_thread_idle_task_runner.h

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85cb2f71a50dd7da960d31cd599df1cd9d6487b9

commit 85cb2f71a50dd7da960d31cd599df1cd9d6487b9
Author: Stuart Langley <slangley@chromium.org>
Date: Sat Dec 02 15:26:15 2017

Remove WTF::WeakPtr entirely and replace it with base::WeakPtr.

This CL deletes platform/wtf/WeakPtr.h and replaces and code
that was still using it in WebKit/ with base::WeakPtr(Factory).

In some cases the file was included but was not needed, so
we just delete the header.

Bug:  789697 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I60409333fb2cc49be475521b51b65c76824811d9
Reviewed-on: https://chromium-review.googlesource.com/798810
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521213}
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/canvas/CanvasDrawListener.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/canvas/CanvasDrawListener.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/BitmapImage.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/CanvasResource.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/Image.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/MailboxTextureHolder.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/MailboxTextureHolder.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/SkiaTextureHolder.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/SkiaTextureHolder.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/TextureHolder.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/VideoFrameResourceProvider.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/VideoFrameResourceProvider.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/VideoFrameSubmitter.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/WebGraphicsContext3DProviderWrapper.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/GraphicsContext3DUtils.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/GraphicsContext3DUtils.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContextTest.cpp
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/wtf/BUILD.gn
[modify] https://crrev.com/85cb2f71a50dd7da960d31cd599df1cd9d6487b9/third_party/WebKit/Source/platform/wtf/FunctionalTest.cpp
[delete] https://crrev.com/5ae6c5cdd3e0c61f06dcd2ff2dc73f81fe44c71e/third_party/WebKit/Source/platform/wtf/WeakPtr.h

Status: Fixed (was: Started)

Sign in to add a comment