WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
140983
Rename pageCache() to PageCache::shared() and return a reference
https://bugs.webkit.org/show_bug.cgi?id=140983
Summary
Rename pageCache() to PageCache::shared() and return a reference
Chris Dumez
Reported
2015-01-27 20:31:42 PST
Rename pageCache() to PageCache::shared() as this is a singleton class and have it return a reference instead of a pointer.
Attachments
Patch
(32.69 KB, patch)
2015-01-27 21:04 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(32.68 KB, patch)
2015-01-28 00:48 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2015-01-27 21:04:18 PST
Created
attachment 245515
[details]
Patch
Andreas Kling
Comment 2
2015-01-27 21:41:44 PST
Comment on
attachment 245515
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=245515&action=review
r=me
> Source/WebCore/history/PageCache.h:81 > + PageCache(); // Use instance() instead.
You mean use shared() instead :-)
Chris Dumez
Comment 3
2015-01-28 00:48:26 PST
Created
attachment 245522
[details]
Patch
WebKit Commit Bot
Comment 4
2015-01-28 01:33:55 PST
Comment on
attachment 245522
[details]
Patch Clearing flags on attachment: 245522 Committed
r179247
: <
http://trac.webkit.org/changeset/179247
>
WebKit Commit Bot
Comment 5
2015-01-28 01:33:58 PST
All reviewed patches have been landed. Closing bug.
Csaba Osztrogonác
Comment 6
2015-01-28 03:23:03 PST
(In reply to
comment #4
)
> Comment on
attachment 245522
[details]
> Patch > > Clearing flags on attachment: 245522 > > Committed
r179247
: <
http://trac.webkit.org/changeset/179247
>
It broke the Windows build, as the EWS noticed it in time. 1>C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\Release\include\private\wtf/NeverDestroyed.h(53): error C2248: 'WebCore::PageCache::PageCache' : cannot access private member declared in class 'WebCore::PageCache' (..\history\PageCache.cpp) c:\cygwin\home\buildbot\slave\win-release\build\source\webcore\history\PageCache.h(81) : see declaration of 'WebCore::PageCache::PageCache' c:\cygwin\home\buildbot\slave\win-release\build\source\webcore\history\PageCache.h(43) : see declaration of 'WebCore::PageCache' ..\history\PageCache.cpp(297) : see reference to function template instantiation 'WTF::NeverDestroyed<WebCore::PageCache>::NeverDestroyed<>(void)' being compiled ..\history\PageCache.cpp(297) : see reference to function template instantiation 'WTF::NeverDestroyed<WebCore::PageCache>::NeverDestroyed<>(void)' being compiled
Darin Adler
Comment 7
2015-01-28 07:27:40 PST
Changing to a reference is fantastic. However, changing from a free function to a member function isn’t something I’m so happy about. I don’t think that PageCache::shared() is a better name than pageCache(), and generally I don’t think that singletons need to use member functions.
Chris Dumez
Comment 8
2015-01-28 08:47:10 PST
(In reply to
comment #7
)
> Changing to a reference is fantastic. However, changing from a free function > to a member function isn’t something I’m so happy about. I don’t think that > PageCache::shared() is a better name than pageCache(), and generally I don’t > think that singletons need to use member functions.
Ok, I have no strong feelings about this. I made this change because I think this is more consistent with our recent code (e.g. In WK2). I'll upload a partial revert today.
Darin Adler
Comment 9
2015-01-28 09:08:12 PST
(In reply to
comment #8
)
> (In reply to
comment #7
) > > Changing to a reference is fantastic. However, changing from a free function > > to a member function isn’t something I’m so happy about. I don’t think that > > PageCache::shared() is a better name than pageCache(), and generally I don’t > > think that singletons need to use member functions. > > Ok, I have no strong feelings about this. I made this change because I think > this is more consistent with our recent code (e.g. In WK2). I'll upload a > partial revert today.
If we are starting to go a particular direction with this, my personal taste alone should not be the driver. Maybe we should have a brief discussion. More urgently, though, the Windows build is still broken!
Darin Adler
Comment 10
2015-01-28 09:08:29 PST
Brief discussion would be maybe on webkit-dev?
Brent Fulgham
Comment 11
2015-01-28 09:14:35 PST
This seems like a race between commit-queue and ews. The Windows bot was about 15 minutes slower than the mac ews. Once the reviewer marked it as cq+, it got applied and by the time the Windows ews noted the problem we were already sunk.
Csaba Osztrogonác
Comment 12
2015-01-28 09:20:59 PST
(In reply to
comment #11
)
> This seems like a race between commit-queue and ews. The Windows bot was > about 15 minutes slower than the mac ews. Once the reviewer marked it as > cq+, it got applied and by the time the Windows ews noted the problem we > were already sunk.
That's why it was good to let the EWS set cq- and comment bug on failure. But unfortunately it was stated SPAMs and disabled long time ago. :( Now the only way to be informed about failures is polling bugzilla manually ...
Csaba Osztrogonác
Comment 13
2015-01-28 09:23:01 PST
I meant this thread:
https://lists.webkit.org/pipermail/webkit-dev/2014-January/026068.html
and
bug127079
.
Brent Fulgham
Comment 14
2015-01-28 09:24:10 PST
Windows build fix landed in
r179255
. <
http://trac.webkit.org/changeset/179255
>
Chris Dumez
Comment 15
2015-01-28 09:43:48 PST
(In reply to
comment #14
)
> Windows build fix landed in
r179255
. > <
http://trac.webkit.org/changeset/179255
>
My patch already marked NeverDestroyed<PageCache> as a friend class of PageCache. Now you added it again so it is marked twice?
Chris Dumez
Comment 16
2015-01-28 09:55:22 PST
(In reply to
comment #15
)
> (In reply to
comment #14
) > > Windows build fix landed in
r179255
. > > <
http://trac.webkit.org/changeset/179255
> > > My patch already marked NeverDestroyed<PageCache> as a friend class of > PageCache. Now you added it again so it is marked twice?
- Mine is public, yours is private. AFAIK, this doesn't matter for friend class statements. - Your specifies WTF:: explicitly but this shouldn't matter either. StringImpl has the following statement for e.g. "friend class NeverDestroyed<StringImpl>;", and it builds fine on Windows. I am not quite sure what's going on.
Brent Fulgham
Comment 17
2015-01-28 09:55:36 PST
(In reply to
comment #15
)
> (In reply to
comment #14
) > > Windows build fix landed in
r179255
. > > <
http://trac.webkit.org/changeset/179255
> > > My patch already marked NeverDestroyed<PageCache> as a friend class of > PageCache. Now you added it again so it is marked twice?
Oh! The problem must have been namespacing. You declared "WebCore::NeverDestroyed<PageCache>" as a friend, which is a nonexistent class. It needed to be declared as "WTF::NeverDestroyed<PageCache>". Can you delete the original incorrect declaration?
Brent Fulgham
Comment 18
2015-01-28 09:56:18 PST
(In reply to
comment #16
)
> (In reply to
comment #15
) > > (In reply to
comment #14
) > > > Windows build fix landed in
r179255
. > > > <
http://trac.webkit.org/changeset/179255
> > > > > My patch already marked NeverDestroyed<PageCache> as a friend class of > > PageCache. Now you added it again so it is marked twice? > > - Mine is public, yours is private. AFAIK, this doesn't matter for friend > class statements. > - Your specifies WTF:: explicitly but this shouldn't matter either. > StringImpl has the following statement for e.g. "friend class > NeverDestroyed<StringImpl>;", and it builds fine on Windows.
StringImpl is in namespace WTF.
Chris Dumez
Comment 19
2015-01-28 09:58:30 PST
(In reply to
comment #18
)
> (In reply to
comment #16
) > > (In reply to
comment #15
) > > > (In reply to
comment #14
) > > > > Windows build fix landed in
r179255
. > > > > <
http://trac.webkit.org/changeset/179255
> > > > > > > My patch already marked NeverDestroyed<PageCache> as a friend class of > > > PageCache. Now you added it again so it is marked twice? > > > > - Mine is public, yours is private. AFAIK, this doesn't matter for friend > > class statements. > > - Your specifies WTF:: explicitly but this shouldn't matter either. > > StringImpl has the following statement for e.g. "friend class > > NeverDestroyed<StringImpl>;", and it builds fine on Windows. > > StringImpl is in namespace WTF.
There are examples outside WTF namespace: Source/WebKit2/NetworkProcess/NetworkProcess.h: friend class NeverDestroyed<NetworkProcess>; Maybe this works if wtf/NeverDestroyed.h is included in the header.
Brent Fulgham
Comment 20
2015-01-28 10:01:21 PST
(In reply to
comment #19
)
> > > > StringImpl is in namespace WTF. > > There are examples outside WTF namespace: > Source/WebKit2/NetworkProcess/NetworkProcess.h: friend class > NeverDestroyed<NetworkProcess>; > > Maybe this works if wtf/NeverDestroyed.h is included in the header.
Right. Because wtf/NeverDestroyed.h provides a using declaration: } // namespace WTF; using WTF::LazyNeverDestroyed; using WTF::NeverDestroyed; #endif // NeverDestroyed_h So anyone including this header can just say NeverDestroyed, just like you don't have to say "std::string" everywhere if you say "using std::string".
Chris Dumez
Comment 21
2015-01-28 10:02:54 PST
(In reply to
comment #17
)
> (In reply to
comment #15
) > > (In reply to
comment #14
) > > > Windows build fix landed in
r179255
. > > > <
http://trac.webkit.org/changeset/179255
> > > > > My patch already marked NeverDestroyed<PageCache> as a friend class of > > PageCache. Now you added it again so it is marked twice? > > Oh! The problem must have been namespacing. You declared > "WebCore::NeverDestroyed<PageCache>" as a friend, which is a nonexistent > class. > > It needed to be declared as "WTF::NeverDestroyed<PageCache>". > > Can you delete the original incorrect declaration?
Done, <
http://trac.webkit.org/changeset/179262
>.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug