Refactoring: Unify WebMemoryAllocatorDump and WebMemoryAllocatorDumpImpl
Now that WebMemoryAllocatorDumpImpl has been moved from content/child to
platform, we can unify WebMemoryAllocatorDump and WebMemoryAllocatorDumpImpl
BUG=548254
4 years, 10 months ago
(2016-02-26 11:20:49 UTC)
#5
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc:64:
WebMemoryAllocatorDump* web_memory_allocator_dump_impl =
On 2016/02/26 11:06:00, hajimehoshi wrote:
> On 2016/02/25 14:38:55, haraken wrote:
> >
> > You should use OwnPtr<WebMemoryAllocatorDump>.
>
> I can do this, but memory_allocator_dumps_ takes the ownership soon.
The common pattern is:
OwnPtr<X> x = adoptPtr(new X);
passOwnership(x.release());
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54:
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
On 2016/02/26 11:06:00, hajimehoshi wrote:
> On 2016/02/25 14:38:55, haraken wrote:
> >
> > yutak@ has a plan to replace WTF_MAKE_NONCOPYABLE with
> DISALLOW_COPY_AND_ASSIGN.
> > Let's use WTF_MAKE_NONCOPYABLE for now. Then you don't need to include
> > base/macros.h.
>
> Is it allowed to use wtf/Noncopyable.h from public?
I think it's ok. public/platform/ already includes wtf/ stuff.
That said, no one uses WTF_MAKE_NONCOPYABLE or DISALLOW_COPY_AND_ASSIGN. I think
classes should have these macros, but that would be a separate issue -- so the
easiest fix would be just to not add the macro in this CL.
hajimehoshi
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right): https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h#newcode54 third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54: DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump); On 2016/02/26 11:20:49, haraken wrote: > On 2016/02/26 ...
4 years, 10 months ago
(2016-02-26 11:26:13 UTC)
#6
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54:
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
On 2016/02/26 11:20:49, haraken wrote:
> On 2016/02/26 11:06:00, hajimehoshi wrote:
> > On 2016/02/25 14:38:55, haraken wrote:
> > >
> > > yutak@ has a plan to replace WTF_MAKE_NONCOPYABLE with
> > DISALLOW_COPY_AND_ASSIGN.
> > > Let's use WTF_MAKE_NONCOPYABLE for now. Then you don't need to include
> > > base/macros.h.
> >
> > Is it allowed to use wtf/Noncopyable.h from public?
>
> I think it's ok. public/platform/ already includes wtf/ stuff.
>
> That said, no one uses WTF_MAKE_NONCOPYABLE or DISALLOW_COPY_AND_ASSIGN. I
think
> classes should have these macros, but that would be a separate issue -- so the
> easiest fix would be just to not add the macro in this CL.
As for headers in public/platform, they use INSIDE_BLINK when they include wtf.
This class is used from both Chromium and Blink so I think it's impossible to
use WTF_MAKE_NONCOPYABLE.
haraken
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right): https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h#newcode54 third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54: DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump); On 2016/02/26 11:26:13, hajimehoshi wrote: > On 2016/02/26 ...
4 years, 10 months ago
(2016-02-26 11:32:17 UTC)
#7
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54:
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
On 2016/02/26 11:26:13, hajimehoshi wrote:
> On 2016/02/26 11:20:49, haraken wrote:
> > On 2016/02/26 11:06:00, hajimehoshi wrote:
> > > On 2016/02/25 14:38:55, haraken wrote:
> > > >
> > > > yutak@ has a plan to replace WTF_MAKE_NONCOPYABLE with
> > > DISALLOW_COPY_AND_ASSIGN.
> > > > Let's use WTF_MAKE_NONCOPYABLE for now. Then you don't need to include
> > > > base/macros.h.
> > >
> > > Is it allowed to use wtf/Noncopyable.h from public?
> >
> > I think it's ok. public/platform/ already includes wtf/ stuff.
> >
> > That said, no one uses WTF_MAKE_NONCOPYABLE or DISALLOW_COPY_AND_ASSIGN. I
> think
> > classes should have these macros, but that would be a separate issue -- so
the
> > easiest fix would be just to not add the macro in this CL.
>
> As for headers in public/platform, they use INSIDE_BLINK when they include
wtf.
> This class is used from both Chromium and Blink so I think it's impossible to
> use WTF_MAKE_NONCOPYABLE.
No one in public/ is using DISALLOW_COPY_AND_ASSIGN. We might want to use it for
all classes at some point, but shall we defer it to a separate CL?
4 years, 10 months ago
(2016-02-26 12:04:51 UTC)
#8
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc:64:
WebMemoryAllocatorDump* web_memory_allocator_dump_impl =
On 2016/02/26 11:20:49, haraken wrote:
> On 2016/02/26 11:06:00, hajimehoshi wrote:
> > On 2016/02/25 14:38:55, haraken wrote:
> > >
> > > You should use OwnPtr<WebMemoryAllocatorDump>.
> >
> > I can do this, but memory_allocator_dumps_ takes the ownership soon.
>
> The common pattern is:
>
> OwnPtr<X> x = adoptPtr(new X);
> passOwnership(x.release());
>
Done.
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right):
https://codereview.chromium.org/1738843002/diff/1/third_party/WebKit/public/p...
third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:54:
DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
On 2016/02/26 11:32:17, haraken wrote:
> On 2016/02/26 11:26:13, hajimehoshi wrote:
> > On 2016/02/26 11:20:49, haraken wrote:
> > > On 2016/02/26 11:06:00, hajimehoshi wrote:
> > > > On 2016/02/25 14:38:55, haraken wrote:
> > > > >
> > > > > yutak@ has a plan to replace WTF_MAKE_NONCOPYABLE with
> > > > DISALLOW_COPY_AND_ASSIGN.
> > > > > Let's use WTF_MAKE_NONCOPYABLE for now. Then you don't need to include
> > > > > base/macros.h.
> > > >
> > > > Is it allowed to use wtf/Noncopyable.h from public?
> > >
> > > I think it's ok. public/platform/ already includes wtf/ stuff.
> > >
> > > That said, no one uses WTF_MAKE_NONCOPYABLE or DISALLOW_COPY_AND_ASSIGN. I
> > think
> > > classes should have these macros, but that would be a separate issue -- so
> the
> > > easiest fix would be just to not add the macro in this CL.
> >
> > As for headers in public/platform, they use INSIDE_BLINK when they include
> wtf.
> > This class is used from both Chromium and Blink so I think it's impossible
to
> > use WTF_MAKE_NONCOPYABLE.
>
> No one in public/ is using DISALLOW_COPY_AND_ASSIGN. We might want to use it
for
> all classes at some point, but shall we defer it to a separate CL?
Done.
haraken
LGTM https://codereview.chromium.org/1738843002/diff/40001/third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc File third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc (right): https://codereview.chromium.org/1738843002/diff/40001/third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc#newcode71 third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc:71: return memory_allocator_dumps_.get(memory_allocator_dump); It would be inefficient to call ...
4 years, 9 months ago
(2016-02-27 16:15:51 UTC)
#9
lgtm https://codereview.chromium.org/1738843002/diff/40001/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right): https://codereview.chromium.org/1738843002/diff/40001/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h#newcode11 third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:11: // TODO(hajimehoshi): WTF_MAKE_NONCOPYABLE works only in Blink side ...
4 years, 9 months ago
(2016-02-29 02:34:04 UTC)
#10
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1738843002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1738843002/60001
4 years, 9 months ago
(2016-02-29 06:48:49 UTC)
#13
Let's remove them TODO and macro and just use WebNoncopyable https://codereview.chromium.org/1738843002/diff/60001/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right): https://codereview.chromium.org/1738843002/diff/60001/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h#newcode33 ...
4 years, 9 months ago
(2016-02-29 06:51:20 UTC)
#14
4 years, 9 months ago
(2016-02-29 08:21:48 UTC)
#19
Thank you!
https://codereview.chromium.org/1738843002/diff/60001/third_party/WebKit/publ...
File third_party/WebKit/public/platform/WebMemoryAllocatorDump.h (right):
https://codereview.chromium.org/1738843002/diff/60001/third_party/WebKit/publ...
third_party/WebKit/public/platform/WebMemoryAllocatorDump.h:33:
WTF_MAKE_NONCOPYABLE(WebMemoryAllocatorDump);
On 2016/02/29 06:55:30, haraken wrote:
> On 2016/02/29 06:51:20, esprehn wrote:
> > Don't do this. Use WebNoncopyable which does what you want.
>
> So as tkent@ and I are saying in the above, I'd suggest simply removing
> NONCOPYABLE things from this CL. That's a separate issue and it should be
> addressed in a separate CL.
>
Done.
hajimehoshi
The CQ bit was checked by hajimehoshi@chromium.org
4 years, 9 months ago
(2016-03-01 02:14:00 UTC)
#20
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1738843002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1738843002/80001
4 years, 9 months ago
(2016-03-01 02:14:14 UTC)
#22
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/153006)
4 years, 9 months ago
(2016-03-01 03:43:38 UTC)
#24
Issue 1738843002: Refactoring: Unify WebMemoryAllocatorDump and WebMemoryAllocatorDumpImpl
Created 4 years, 10 months ago by hajimehoshi
Modified 4 years, 9 months ago
Reviewers: esprehn, haraken, tkent
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 15