Bug 26238 - Move DateMath into WTF namespace
Summary: Move DateMath into WTF namespace
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Dimitri Glazkov (Google)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-06 22:20 PDT by Dimitri Glazkov (Google)
Modified: 2009-06-08 15:38 PDT (History)
3 users (show)

See Also:


Attachments
Introduce DateExtras, v1. (99.62 KB, patch)
2009-06-06 22:29 PDT, Dimitri Glazkov (Google)
no flags Details | Formatted Diff | Diff
Move DateMath to WTF namespace, v2. (167.59 KB, patch)
2009-06-08 13:20 PDT, Dimitri Glazkov (Google)
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2009-06-06 22:20:09 PDT
In order to eliminate the leakage of JSC into WebCore, introduced inhttp://trac.webkit.org/changeset/44452, move most of DateMath funcs into wtf/DateExtras. The remaining conversion funcs stay in DateConversion.
Comment 1 Dimitri Glazkov (Google) 2009-06-06 22:29:18 PDT
Created attachment 31031 [details]
Introduce DateExtras, v1.

 JavaScriptCore/AllInOneFile.cpp                    |    2 +-
 JavaScriptCore/ChangeLog                           |   32 +
 JavaScriptCore/GNUmakefile.am                      |    6 +-
 JavaScriptCore/JavaScriptCore.exp                  |    2 +-
 JavaScriptCore/JavaScriptCore.pri                  |    3 +-
 .../JavaScriptCore/JavaScriptCore.vcproj           |    4 +-
 .../JavaScriptCore.vcproj/WTF/WTF.vcproj           |    8 +
 .../JavaScriptCore.xcodeproj/project.pbxproj       |   20 +-
 JavaScriptCore/JavaScriptCoreSources.bkl           |    3 +-
 JavaScriptCore/pcre/pcre_exec.cpp                  |    2 +-
 JavaScriptCore/profiler/ProfileNode.cpp            |    4 +-
 JavaScriptCore/runtime/DateConstructor.cpp         |    5 +-
 JavaScriptCore/runtime/DateConversion.cpp          |   98 ++
 JavaScriptCore/runtime/DateConversion.h            |   63 ++
 JavaScriptCore/runtime/DateInstance.cpp            |    6 +-
 JavaScriptCore/runtime/DateInstance.h              |   12 +-
 JavaScriptCore/runtime/DateMath.cpp                |  935 --------------------
 JavaScriptCore/runtime/DateMath.h                  |  191 ----
 JavaScriptCore/runtime/DatePrototype.cpp           |    3 +-
 JavaScriptCore/runtime/InitializeThreading.cpp     |    4 +-
 JavaScriptCore/wtf/DateExtras.cpp                  |  891 +++++++++++++++++++
 JavaScriptCore/wtf/DateExtras.h                    |  188 ++++
 WebCore/ChangeLog                                  |   17 +
 WebCore/ForwardingHeaders/runtime/DateMath.h       |    4 -
 WebCore/ForwardingHeaders/wtf/DateExtras.h         |    4 +
 WebCore/platform/network/HTTPParsers.cpp           |    9 +
 WebCore/platform/network/HTTPParsers.h             |    1 +
 WebCore/platform/network/ResourceResponseBase.cpp  |    4 +-
 28 files changed, 1360 insertions(+), 1161 deletions(-)
Comment 2 Sam Weinig 2009-06-06 22:37:21 PDT
You should probably use svn copy to preserve history for these moves.
Comment 3 David Kilzer (:ddkilzer) 2009-06-06 23:24:06 PDT
(In reply to comment #0)
> In order to eliminate the leakage of JSC into WebCore, introduced
> in <http://trac.webkit.org/changeset/44452>, move most of DateMath funcs into
> wtf/DateExtras. The remaining conversion funcs stay in DateConversion.
Comment 4 Dimitri Glazkov (Google) 2009-06-07 11:05:19 PDT
(In reply to comment #2)
> You should probably use svn copy to preserve history for these moves.
> 

I am not 100% sure, but I think git does this right when it commits. I'll research. 
Comment 5 David Kilzer (:ddkilzer) 2009-06-07 14:25:51 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > You should probably use svn copy to preserve history for these moves.
> 
> I am not 100% sure, but I think git does this right when it commits. I'll
> research. 

git tries to get it right, but it uses a fuzzy algorithm rather than an absolute connection (as in svn).  Most of the time it gets it wrong if it's a small file, e.g., where the license header is as-long-as or longer than the actual source.  Then it thinks the new file is copied from a nonsensical original.

You're *probably* okay with using git in this case, but I'd strongly suggest using svn to make sure that the history is preserved.
Comment 6 Darin Adler 2009-06-07 17:59:42 PDT
Comment on attachment 31031 [details]
Introduce DateExtras, v1.

The other Extras.h headers are mostly to fill in holes in standard library implementations to smooth over platform differences. This seems a bit different in that it implements original functions that don't exist on any platform, so perhaps it should have a different name.

So I'm not sure I like the new name.
Comment 7 Dimitri Glazkov (Google) 2009-06-07 19:24:42 PDT
I can make it wtf/DateMath, if that's preferred, I have no opinion here. Let me know, and I'll make it happen. Would really like to land this soon -- we have fixes after this patch that we really would like to have without branching out.
Comment 8 Dimitri Glazkov (Google) 2009-06-08 13:03:29 PDT
I reworked the patch to:

* use svn cp (darn it! I don't like to admit when git is inferior)
* change DateExtras.h to wtf/DateMath.h

r* pls?
Comment 9 Dimitri Glazkov (Google) 2009-06-08 13:20:14 PDT
Created attachment 31058 [details]
Move DateMath to WTF namespace, v2.
Comment 10 Eric Seidel (no email) 2009-06-08 15:31:21 PDT
Comment on attachment 31058 [details]
Move DateMath to WTF namespace, v2.

rs=me if you're just moving code and you promise to watch the bots! :)
Comment 11 Dimitri Glazkov (Google) 2009-06-08 15:38:17 PDT
http://trac.webkit.org/changeset/44508