Internal change

PiperOrigin-RevId: 128426957
Change-Id: Id2ba10dd8be961f7491ce229ac4205fbd69e69e7
diff --git a/README.google b/README.google
index f6a9a6a..58da5c1 100644
--- a/README.google
+++ b/README.google
@@ -1,5 +1,5 @@
-URL: https://chromium.googlesource.com/chromium/src.git/+archive/51.0.2704.63.tar.gz
-Version: commit 8726b6fe03a76ef686c9e1606e67169c177cb883 (matching Chromium 51.0.2704.63)
+URL: https://chromium.googlesource.com/chromium/src.git/+archive/52.0.2743.82.tar.gz
+Version: commit 4d38f441bb892fd40a85e19e2640516241a74162 (matching Chromium 52.0.2743.82)
 License: BSD, MPL, ICU (one source file under MPL, one source file under ICU)
 License File: LICENSE
 
diff --git a/src/base/strings/string_util.h b/src/base/strings/string_util.h
index 458d202..035179b 100644
--- a/src/base/strings/string_util.h
+++ b/src/base/strings/string_util.h
@@ -53,6 +53,15 @@
 BASE_EXPORT bool LowerCaseEqualsASCII(StringPiece16 str,
                                       StringPiece lowecase_ascii);
 
+template <typename Char>
+inline bool IsAsciiAlpha(Char c) {
+  return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
+}
+template <typename Char>
+inline bool IsAsciiLower(Char c) {
+  return c >= 'a' && c <= 'z';
+}
+
 }  // namespace base
 }  // namespace url
 
diff --git a/src/build/build_config.h b/src/build/build_config.h
index afde9c3..c6479b2 100644
--- a/src/build/build_config.h
+++ b/src/build/build_config.h
@@ -123,7 +123,7 @@
 #define ARCH_CPU_LITTLE_ENDIAN 1
 #elif defined(__MIPSEL__)
 #if defined(__LP64__)
-#define ARCH_CPU_MIPS64_FAMILY 1
+#define ARCH_CPU_MIPS_FAMILY 1
 #define ARCH_CPU_MIPS64EL 1
 #define ARCH_CPU_64_BITS 1
 #define ARCH_CPU_LITTLE_ENDIAN 1
diff --git a/src/url/gurl.cc b/src/url/gurl.cc
index b75c8f5..3dadacf 100644
--- a/src/url/gurl.cc
+++ b/src/url/gurl.cc
@@ -280,7 +280,8 @@
 
   output.Complete();
   if (result.is_valid_ && result.SchemeIsFileSystem()) {
-    result.inner_url_.reset(new GURL(spec_.data(), result.parsed_.Length(),
+    result.inner_url_.reset(new GURL(result.spec_.data(),
+                                     result.parsed_.Length(),
                                      *result.parsed_.inner_parsed(), true));
   }
   return result;
@@ -306,7 +307,8 @@
 
   output.Complete();
   if (result.is_valid_ && result.SchemeIsFileSystem()) {
-    result.inner_url_.reset(new GURL(spec_.data(), result.parsed_.Length(),
+    result.inner_url_.reset(new GURL(result.spec_.data(),
+                                     result.parsed_.Length(),
                                      *result.parsed_.inner_parsed(), true));
   }
   return result;
diff --git a/src/url/gurl.h b/src/url/gurl.h
index 70f70ec..3509247 100644
--- a/src/url/gurl.h
+++ b/src/url/gurl.h
@@ -394,6 +394,10 @@
 
   // Returns the inner URL of a nested URL (currently only non-null for
   // filesystem URLs).
+  //
+  // TODO(mmenke): inner_url().spec() currently returns the same value as
+  // caling spec() on the GURL itself. This should be fixed.
+  // See https://crbug.com/619596
   const GURL* inner_url() const {
     return inner_url_.get();
   }
diff --git a/src/url/gurl_unittest.cc b/src/url/gurl_unittest.cc
index 7b83468..cd680c2 100644
--- a/src/url/gurl_unittest.cc
+++ b/src/url/gurl_unittest.cc
@@ -401,13 +401,23 @@
     const char* ref;
     const char* expected;
   } replace_cases[] = {
-    {"http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL, NULL, "/", "", "", "http://www.google.com/"},
-    {"http://www.google.com/foo/bar.html?foo#bar", "javascript", "", "", "", "", "window.open('foo');", "", "", "javascript:window.open('foo');"},
-    {"file:///C:/foo/bar.txt", "http", NULL, NULL, "www.google.com", "99", "/foo", "search", "ref", "http://www.google.com:99/foo?search#ref"},
+      {"http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL,
+       NULL, "/", "", "", "http://www.google.com/"},
+      {"http://www.google.com/foo/bar.html?foo#bar", "javascript", "", "", "",
+       "", "window.open('foo');", "", "", "javascript:window.open('foo');"},
+      {"file:///C:/foo/bar.txt", "http", NULL, NULL, "www.google.com", "99",
+       "/foo", "search", "ref", "http://www.google.com:99/foo?search#ref"},
 #ifdef WIN32
-    {"http://www.google.com/foo/bar.html?foo#bar", "file", "", "", "", "", "c:\\", "", "", "file:///C:/"},
+      {"http://www.google.com/foo/bar.html?foo#bar", "file", "", "", "", "",
+       "c:\\", "", "", "file:///C:/"},
 #endif
-    {"filesystem:http://www.google.com/foo/bar.html?foo#bar", NULL, NULL, NULL, NULL, NULL, "/", "", "", "filesystem:http://www.google.com/foo/"},
+      {"filesystem:http://www.google.com/foo/bar.html?foo#bar", NULL, NULL,
+       NULL, NULL, NULL, "/", "", "", "filesystem:http://www.google.com/foo/"},
+      // Lengthen the URL instead of shortening it, to test creation of
+      // inner_url.
+      {"filesystem:http://www.google.com/foo/", NULL, NULL, NULL, NULL, NULL,
+       "bar.html", "foo", "bar",
+       "filesystem:http://www.google.com/foo/bar.html?foo#bar"},
   };
 
   for (size_t i = 0; i < arraysize(replace_cases); i++) {
@@ -425,7 +435,14 @@
     GURL output = url.ReplaceComponents(repl);
 
     EXPECT_EQ(replace_cases[i].expected, output.spec());
+
     EXPECT_EQ(output.SchemeIsFileSystem(), output.inner_url() != NULL);
+    if (output.SchemeIsFileSystem()) {
+      // TODO(mmenke): inner_url()->spec() is currently the same as the spec()
+      // for the GURL itself.  This should be fixed.
+      // See https://crbug.com/619596
+      EXPECT_EQ(replace_cases[i].expected, output.inner_url()->spec());
+    }
   }
 }
 
diff --git a/src/url/url_canon_fileurl.cc b/src/url/url_canon_fileurl.cc
index 6191f8f..6277289 100644
--- a/src/url/url_canon_fileurl.cc
+++ b/src/url/url_canon_fileurl.cc
@@ -4,6 +4,7 @@
 
 // Functions for canonicalizing "file:" URLs.
 
+#include "base/strings/string_util.h"
 #include "url/url_canon.h"
 #include "url/url_canon_internal.h"
 #include "url/url_file.h"
@@ -39,7 +40,7 @@
   // and that it is followed by a colon/pipe.
 
   // Normalize Windows drive letters to uppercase
-  if (spec[after_slashes] >= 'a' && spec[after_slashes] <= 'z')
+  if (base::IsAsciiLower(spec[after_slashes]))
     output->push_back(static_cast<char>(spec[after_slashes] - 'a' + 'A'));
   else
     output->push_back(static_cast<char>(spec[after_slashes]));
diff --git a/src/url/url_canon_internal_file.h b/src/url/url_canon_internal_file.h
index 26a3eae..61b99cc 100644
--- a/src/url/url_canon_internal_file.h
+++ b/src/url/url_canon_internal_file.h
@@ -14,7 +14,7 @@
 // *** This file must be included after url_canon_internal as we depend on some
 // functions in it. ***
 
-
+#include "base/strings/string_util.h"
 #include "url/url_file.h"
 #include "url/url_parse_internal.h"
 
@@ -40,7 +40,7 @@
   // and that it is followed by a colon/pipe.
 
   // Normalize Windows drive letters to uppercase
-  if (spec[after_slashes] >= 'a' && spec[after_slashes] <= 'z')
+  if (base::IsAsciiLower(spec[after_slashes]))
     output->push_back(spec[after_slashes] - 'a' + 'A');
   else
     output->push_back(static_cast<char>(spec[after_slashes]));
diff --git a/src/url/url_file.h b/src/url/url_file.h
index 540cb25..796d12c 100644
--- a/src/url/url_file.h
+++ b/src/url/url_file.h
@@ -8,6 +8,7 @@
 // Provides shared functions used by the internals of the parser and
 // canonicalizer for file URLs. Do not use outside of these modules.
 
+#include "base/strings/string_util.h"
 #include "url/url_parse_internal.h"
 
 namespace url {
@@ -18,9 +19,6 @@
 inline bool IsWindowsDriveSeparator(base::char16 ch) {
   return ch == ':' || ch == '|';
 }
-inline bool IsWindowsDriveLetter(base::char16 ch) {
-  return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
-}
 
 #endif  // WIN32
 
@@ -48,7 +46,7 @@
   int remaining_len = spec_len - start_offset;
   if (remaining_len < 2)
     return false;  // Not enough room.
-  if (!IsWindowsDriveLetter(spec[start_offset]))
+  if (!base::IsAsciiAlpha(spec[start_offset]))
     return false;  // Doesn't start with a valid drive letter.
   if (!IsWindowsDriveSeparator(spec[start_offset + 1]))
     return false;  // Isn't followed with a drive separator.