dump aSpec(i.e., path) for SetSpec failure draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:00:36 +0900
changeset 81083 55623f80ea7a85be826669e1be306a30ea104402
parent 81082 cfb1929d58ea2de6bc4ac829a317c29e9098cc77
child 81084 0b813bcef405d04034e141d32c9ea54e4df0ed59
push id9744
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:01:06 +0000
treeherdertry-comm-central@56c83244ac0e [default view] [failures only]
dump aSpec(i.e., path) for SetSpec failure
mozilla-M-C-021-dump-mutator-failure-path.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-021-dump-mutator-failure-path.patch
@@ -0,0 +1,37 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  7141da73196f3917a0421ab0562750448989ccfe
+dump aSpec(i.e., path) for SetSpec failure
+
+diff --git a/netwerk/base/nsIURIMutator.idl b/netwerk/base/nsIURIMutator.idl
+--- a/netwerk/base/nsIURIMutator.idl
++++ b/netwerk/base/nsIURIMutator.idl
+@@ -354,16 +354,28 @@ public:
+   }
+ 
+   NS_MutateURI& SetSpec(const nsACString& aSpec)
+   {
+     if (NS_FAILED(mStatus)) {
+       return *this;
+     }
+     mStatus = mMutator->SetSpec(aSpec, nullptr);
++#if DEBUG
++    if (NS_FAILED(mStatus)) {
++      char *l_data;
++      char l_string[256];
++      int len = aSpec.Length();
++      int upper = len > 255 ? 255: len;
++      l_data =  ToNewCString(aSpec);
++      bcopy(l_data, l_string, upper);
++      l_string[upper] = '\0';
++      fprintf(stderr,"{debug} SetSpec failed : aSpec=%s\n", l_string);
++    }
++#endif
+     return *this;
+   }
+   NS_MutateURI& SetScheme(const nsACString& aScheme)
+   {
+     if (NS_FAILED(mStatus)) {
+       return *this;
+     }
+     mStatus = mMutator->SetScheme(aScheme, nullptr);