Bug 1035125 Part 7: Remove unused functions in security/sandbox/chromium/base/time/time.h to avoid nspr dependency. r=aklotz
authorBob Owen <bobowencode@gmail.com>
Sun, 15 May 2016 16:23:57 +0100
changeset 297625 477b991bf6fa7b4511768649c9bf37c7275d30d9
parent 297624 89c0989d9cf96e6e1462174c9941d5aea66156f9
child 297626 da96cd1bf70c748bc59219677262530639a5e32b
push id76830
push userbobowencode@gmail.com
push dateTue, 17 May 2016 07:42:57 +0000
treeherdermozilla-inbound@a416c55e6648 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1035125
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1035125 Part 7: Remove unused functions in security/sandbox/chromium/base/time/time.h to avoid nspr dependency. r=aklotz MozReview-Commit-ID: 4TwVMQGTXUU
security/sandbox/chromium/base/time/time.cc
security/sandbox/chromium/base/time/time.h
security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
--- a/security/sandbox/chromium/base/time/time.cc
+++ b/security/sandbox/chromium/base/time/time.cc
@@ -211,16 +211,17 @@ Time Time::LocalMidnight() const {
   LocalExplode(&exploded);
   exploded.hour = 0;
   exploded.minute = 0;
   exploded.second = 0;
   exploded.millisecond = 0;
   return FromLocalExploded(exploded);
 }
 
+#if !defined(MOZ_SANDBOX)
 // static
 bool Time::FromStringInternal(const char* time_string,
                               bool is_local,
                               Time* parsed_time) {
   DCHECK((time_string != NULL) && (parsed_time != NULL));
 
   if (time_string[0] == '\0')
     return false;
@@ -231,16 +232,17 @@ bool Time::FromStringInternal(const char
                                        &result_time);
   if (PR_SUCCESS != result)
     return false;
 
   result_time += kTimeTToMicrosecondsOffset;
   *parsed_time = Time(result_time);
   return true;
 }
+#endif
 
 std::ostream& operator<<(std::ostream& os, Time time) {
   Time::Exploded exploded;
   time.UTCExplode(&exploded);
   // Use StringPrintf because iostreams formatting is painful.
   return os << StringPrintf("%04d-%02d-%02d %02d:%02d:%02d.%03d UTC",
                             exploded.year,
                             exploded.month,
--- a/security/sandbox/chromium/base/time/time.h
+++ b/security/sandbox/chromium/base/time/time.h
@@ -383,30 +383,32 @@ class BASE_EXPORT Time {
   // Converts an integer value representing Time to a class. This is used
   // when deserializing a |Time| structure, using a value known to be
   // compatible. It is not provided as a constructor because the integer type
   // may be unclear from the perspective of a caller.
   static Time FromInternalValue(int64 us) {
     return Time(us);
   }
 
+#if !defined(MOZ_SANDBOX)
   // Converts a string representation of time to a Time object.
   // An example of a time string which is converted is as below:-
   // "Tue, 15 Nov 1994 12:45:26 GMT". If the timezone is not specified
   // in the input string, FromString assumes local time and FromUTCString
   // assumes UTC. A timezone that cannot be parsed (e.g. "UTC" which is not
   // specified in RFC822) is treated as if the timezone is not specified.
   // TODO(iyengar) Move the FromString/FromTimeT/ToTimeT/FromFileTime to
   // a new time converter class.
   static bool FromString(const char* time_string, Time* parsed_time) {
     return FromStringInternal(time_string, true, parsed_time);
   }
   static bool FromUTCString(const char* time_string, Time* parsed_time) {
     return FromStringInternal(time_string, false, parsed_time);
   }
+#endif
 
   // For serializing, use FromInternalValue to reconstitute. Please don't use
   // this and do arithmetic on it, as it is more error prone than using the
   // provided operators.
   int64 ToInternalValue() const {
     return us_;
   }
 
@@ -480,26 +482,28 @@ class BASE_EXPORT Time {
   // Explodes the given time to either local time |is_local = true| or UTC
   // |is_local = false|.
   void Explode(bool is_local, Exploded* exploded) const;
 
   // Unexplodes a given time assuming the source is either local time
   // |is_local = true| or UTC |is_local = false|.
   static Time FromExploded(bool is_local, const Exploded& exploded);
 
+#if !defined(MOZ_SANDBOX)
   // Converts a string representation of time to a Time object.
   // An example of a time string which is converted is as below:-
   // "Tue, 15 Nov 1994 12:45:26 GMT". If the timezone is not specified
   // in the input string, local time |is_local = true| or
   // UTC |is_local = false| is assumed. A timezone that cannot be parsed
   // (e.g. "UTC" which is not specified in RFC822) is treated as if the
   // timezone is not specified.
   static bool FromStringInternal(const char* time_string,
                                  bool is_local,
                                  Time* parsed_time);
+#endif
 
   // Time in microseconds in UTC.
   int64 us_;
 };
 
 // Inline the TimeDelta factory methods, for fast TimeDelta construction.
 
 // static
--- a/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
+++ b/security/sandbox/modifications-to-chromium-to-reapply-after-upstream-merge.txt
@@ -1,9 +1,10 @@
 Please add a link to the bugzilla bug and patch name that should be re-applied.
 Also, please update any existing links to their actual mozilla-central changeset.
 
 https://hg.mozilla.org/mozilla-central/rev/efa7518e43b0
 https://hg.mozilla.org/mozilla-central/rev/421446ab2347
 https://hg.mozilla.org/mozilla-central/rev/beb74056ac2d
 https://hg.mozilla.org/mozilla-central/rev/7df8d6639971
 https://hg.mozilla.org/mozilla-central/rev/1178c11561bc
-https://bugzilla.mozilla.org/show_bug.cgi?id=1173371 bug1173371part2.patch
+https://hg.mozilla.org/mozilla-central/rev/afa4f68de47c
+https://bugzilla.mozilla.org/show_bug.cgi?id=1035125 bug1035125part7.patch