[LSC] Replace base::string16 with std::u16string in //{chrome*,content}

This change replaces base::string16 with std::u16string in //chrome,
//chromecast, //chromeos and //content.

Reproduction steps:
$ git grep -lw 'base::string16' chrome* content | \
      xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format

Bug: 1184339
Change-Id: I8fae0ab25b5d9bf1cb416ae5f47d7f680fb8f3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752229
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Commit-Queue: Daniel Cheng <[email protected]>
Owners-Override: Daniel Cheng <[email protected]>
Auto-Submit: Jan Wilken Dörrie <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#862152}
diff --git a/content/browser/renderer_host/clipboard_host_impl.cc b/content/browser/renderer_host/clipboard_host_impl.cc
index ec32b6d..1730d68 100644
--- a/content/browser/renderer_host/clipboard_host_impl.cc
+++ b/content/browser/renderer_host/clipboard_host_impl.cc
@@ -155,7 +155,7 @@
 void ClipboardHostImpl::ReadAvailableTypes(
     ui::ClipboardBuffer clipboard_buffer,
     ReadAvailableTypesCallback callback) {
-  std::vector<base::string16> types;
+  std::vector<std::u16string> types;
   clipboard_->ReadAvailableTypes(clipboard_buffer, CreateDataEndpoint().get(),
                                  &types);
   std::move(callback).Run(types);
@@ -203,10 +203,10 @@
 void ClipboardHostImpl::ReadText(ui::ClipboardBuffer clipboard_buffer,
                                  ReadTextCallback callback) {
   if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
-    std::move(callback).Run(base::string16());
+    std::move(callback).Run(std::u16string());
     return;
   }
-  base::string16 result;
+  std::u16string result;
   auto data_dst = CreateDataEndpoint();
   if (clipboard_->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(),
                                     clipboard_buffer, data_dst.get())) {
@@ -228,7 +228,7 @@
                        ui::ClipboardFormatType::GetPlainTextType(),
                        std::move(data),
                        base::BindOnce(
-                           [](base::string16 result, ReadTextCallback callback,
+                           [](std::u16string result, ReadTextCallback callback,
                               ClipboardPasteContentAllowed allowed) {
                              if (!allowed)
                                result.clear();
@@ -240,10 +240,10 @@
 void ClipboardHostImpl::ReadHtml(ui::ClipboardBuffer clipboard_buffer,
                                  ReadHtmlCallback callback) {
   if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
-    std::move(callback).Run(base::string16(), GURL(), 0, 0);
+    std::move(callback).Run(std::u16string(), GURL(), 0, 0);
     return;
   }
-  base::string16 markup;
+  std::u16string markup;
   std::string src_url_str;
   uint32_t fragment_start = 0;
   uint32_t fragment_end = 0;
@@ -255,7 +255,7 @@
   PasteIfPolicyAllowed(
       clipboard_buffer, ui::ClipboardFormatType::GetHtmlType(), std::move(data),
       base::BindOnce(
-          [](base::string16 markup, std::string src_url_str,
+          [](std::u16string markup, std::string src_url_str,
              uint32_t fragment_start, uint32_t fragment_end,
              ReadHtmlCallback callback, ClipboardPasteContentAllowed allowed) {
             if (!allowed)
@@ -270,17 +270,17 @@
 void ClipboardHostImpl::ReadSvg(ui::ClipboardBuffer clipboard_buffer,
                                 ReadSvgCallback callback) {
   if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
-    std::move(callback).Run(base::string16());
+    std::move(callback).Run(std::u16string());
     return;
   }
-  base::string16 markup;
+  std::u16string markup;
   clipboard_->ReadSvg(clipboard_buffer, /*data_dst=*/nullptr, &markup);
 
   std::string data = base::UTF16ToUTF8(markup);
   PasteIfPolicyAllowed(clipboard_buffer, ui::ClipboardFormatType::GetSvgType(),
                        std::move(data),
                        base::BindOnce(
-                           [](base::string16 markup, ReadSvgCallback callback,
+                           [](std::u16string markup, ReadSvgCallback callback,
                               ClipboardPasteContentAllowed allowed) {
                              if (!allowed)
                                markup.clear();
@@ -400,13 +400,13 @@
 }
 
 void ClipboardHostImpl::ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
-                                       const base::string16& type,
+                                       const std::u16string& type,
                                        ReadCustomDataCallback callback) {
   if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
-    std::move(callback).Run(base::string16());
+    std::move(callback).Run(std::u16string());
     return;
   }
-  base::string16 result;
+  std::u16string result;
   auto data_dst = CreateDataEndpoint();
   clipboard_->ReadCustomData(clipboard_buffer, type, data_dst.get(), &result);
 
@@ -415,7 +415,7 @@
       clipboard_buffer, ui::ClipboardFormatType::GetWebCustomDataType(),
       std::move(data),
       base::BindOnce(
-          [](base::string16 result, ReadCustomDataCallback callback,
+          [](std::u16string result, ReadCustomDataCallback callback,
              ClipboardPasteContentAllowed allowed) {
             if (!allowed)
               result.clear();
@@ -424,16 +424,16 @@
           std::move(result), std::move(callback)));
 }
 
-void ClipboardHostImpl::WriteText(const base::string16& text) {
+void ClipboardHostImpl::WriteText(const std::u16string& text) {
   clipboard_writer_->WriteText(text);
 }
 
-void ClipboardHostImpl::WriteHtml(const base::string16& markup,
+void ClipboardHostImpl::WriteHtml(const std::u16string& markup,
                                   const GURL& url) {
   clipboard_writer_->WriteHTML(markup, url.spec());
 }
 
-void ClipboardHostImpl::WriteSvg(const base::string16& markup) {
+void ClipboardHostImpl::WriteSvg(const std::u16string& markup) {
   clipboard_writer_->WriteSvg(markup);
 }
 
@@ -442,7 +442,7 @@
 }
 
 void ClipboardHostImpl::WriteCustomData(
-    const base::flat_map<base::string16, base::string16>& data) {
+    const base::flat_map<std::u16string, std::u16string>& data) {
   base::Pickle pickle;
   ui::WriteCustomDataToPickle(data, &pickle);
   clipboard_writer_->WritePickledData(
@@ -450,7 +450,7 @@
 }
 
 void ClipboardHostImpl::WriteBookmark(const std::string& url,
-                                      const base::string16& title) {
+                                      const std::u16string& title) {
   clipboard_writer_->WriteBookmark(title, url);
 }
 
diff --git a/content/browser/renderer_host/clipboard_host_impl.h b/content/browser/renderer_host/clipboard_host_impl.h
index 66d6804..fd36e65 100644
--- a/content/browser/renderer_host/clipboard_host_impl.h
+++ b/content/browser/renderer_host/clipboard_host_impl.h
@@ -164,20 +164,20 @@
   void ReadFiles(ui::ClipboardBuffer clipboard_buffer,
                  ReadFilesCallback callback) override;
   void ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
-                      const base::string16& type,
+                      const std::u16string& type,
                       ReadCustomDataCallback callback) override;
-  void WriteText(const base::string16& text) override;
-  void WriteHtml(const base::string16& markup, const GURL& url) override;
-  void WriteSvg(const base::string16& markup) override;
+  void WriteText(const std::u16string& text) override;
+  void WriteHtml(const std::u16string& markup, const GURL& url) override;
+  void WriteSvg(const std::u16string& markup) override;
   void WriteSmartPasteMarker() override;
   void WriteCustomData(
-      const base::flat_map<base::string16, base::string16>& data) override;
+      const base::flat_map<std::u16string, std::u16string>& data) override;
   void WriteBookmark(const std::string& url,
-                     const base::string16& title) override;
+                     const std::u16string& title) override;
   void WriteImage(const SkBitmap& unsafe_bitmap) override;
   void CommitWrite() override;
 #if defined(OS_MAC)
-  void WriteStringToFindPboard(const base::string16& text) override;
+  void WriteStringToFindPboard(const std::u16string& text) override;
 #endif
 
   // Called by PerformPasteIfContentAllowed() when an is allowed request is
diff --git a/content/browser/renderer_host/clipboard_host_impl_mac.mm b/content/browser/renderer_host/clipboard_host_impl_mac.mm
index f333293a..7d472909 100644
--- a/content/browser/renderer_host/clipboard_host_impl_mac.mm
+++ b/content/browser/renderer_host/clipboard_host_impl_mac.mm
@@ -25,7 +25,7 @@
 
 }  // namespace
 
-void ClipboardHostImpl::WriteStringToFindPboard(const base::string16& text) {
+void ClipboardHostImpl::WriteStringToFindPboard(const std::u16string& text) {
   if (text.length() <= kMaxFindPboardStringLength) {
     NSString* nsText = base::SysUTF16ToNSString(text);
     if (nsText) {
diff --git a/content/browser/renderer_host/cursor_manager.cc b/content/browser/renderer_host/cursor_manager.cc
index e339bc85..66fedcb 100644
--- a/content/browser/renderer_host/cursor_manager.cc
+++ b/content/browser/renderer_host/cursor_manager.cc
@@ -23,7 +23,7 @@
 }
 
 void CursorManager::SetTooltipTextForView(const RenderWidgetHostViewBase* view,
-                                          const base::string16& tooltip_text) {
+                                          const std::u16string& tooltip_text) {
   if (view == view_under_cursor_) {
     root_view_->DisplayTooltipText(tooltip_text);
     if (tooltip_observer_for_testing_ && view) {
@@ -42,7 +42,7 @@
   // though this is only guaranteed if the view's tooltip is non-empty, so
   // clearing here is important. Tooltips sent from the previous view will be
   // ignored.
-  SetTooltipTextForView(view_under_cursor_, base::string16());
+  SetTooltipTextForView(view_under_cursor_, std::u16string());
   view_under_cursor_ = view;
   WebCursor cursor(ui::mojom::CursorType::kPointer);
 
diff --git a/content/browser/renderer_host/cursor_manager.h b/content/browser/renderer_host/cursor_manager.h
index a835fdd..18e746d 100644
--- a/content/browser/renderer_host/cursor_manager.h
+++ b/content/browser/renderer_host/cursor_manager.h
@@ -27,7 +27,7 @@
 
     virtual void OnSetTooltipTextForView(
         const RenderWidgetHostViewBase* view,
-        const base::string16& tooltip_text) = 0;
+        const std::u16string& tooltip_text) = 0;
   };
 
   CursorManager(RenderWidgetHostViewBase* root);
@@ -43,7 +43,7 @@
   // Accepts TooltipText updates from views, but only updates what's displayed
   // if the requesting view is currently under the mouse cursor.
   void SetTooltipTextForView(const RenderWidgetHostViewBase* view,
-                             const base::string16& tooltip_text);
+                             const std::u16string& tooltip_text);
 
   // Notification of a RenderWidgetHostView being destroyed, so that its
   // cursor map entry can be removed if it has one. If it is the current
diff --git a/content/browser/renderer_host/data_transfer_util.cc b/content/browser/renderer_host/data_transfer_util.cc
index 32c36d8..c1da59c 100644
--- a/content/browser/renderer_host/data_transfer_util.cc
+++ b/content/browser/renderer_host/data_transfer_util.cc
@@ -118,7 +118,7 @@
     item->file_system_id = file_system_file.filesystem_id;
     items.push_back(blink::mojom::DragItem::NewFileSystemFile(std::move(item)));
   }
-  for (const std::pair<base::string16, base::string16> data :
+  for (const std::pair<std::u16string, std::u16string> data :
        drop_data.custom_data) {
     blink::mojom::DragItemStringPtr item = blink::mojom::DragItemString::New();
     item->string_type = base::UTF16ToUTF8(data.first);
diff --git a/content/browser/renderer_host/dwrite_font_file_util_win.cc b/content/browser/renderer_host/dwrite_font_file_util_win.cc
index 6958f633..9158e74 100644
--- a/content/browser/renderer_host/dwrite_font_file_util_win.cc
+++ b/content/browser/renderer_host/dwrite_font_file_util_win.cc
@@ -124,7 +124,7 @@
     LogMessageFilterError(MessageFilterError::ADD_LOCAL_FILE_GET_PATH_FAILED);
     return hr;
   }
-  // No need for the null-terminator in base::string16.
+  // No need for the null-terminator in std::u16string.
   retrieve_file_path.resize(--path_length);
 
   uint32_t retrieve_ttc_index = font_face->GetIndex();
@@ -139,7 +139,7 @@
 }
 
 HRESULT AddFilesForFont(IDWriteFont* font,
-                        const base::string16& windows_fonts_path,
+                        const std::u16string& windows_fonts_path,
                         std::set<std::wstring>* path_set,
                         std::set<std::wstring>* custom_font_path_set,
                         uint32_t* ttc_index) {
@@ -149,7 +149,7 @@
     return hr;
   }
 
-  base::string16 file_path_folded =
+  std::u16string file_path_folded =
       base::i18n::FoldCase(base::WideToUTF16(file_path));
 
   if (!file_path_folded.size())
@@ -166,7 +166,7 @@
   return S_OK;
 }
 
-base::string16 GetWindowsFontsPath() {
+std::u16string GetWindowsFontsPath() {
   std::vector<wchar_t> font_path_chars;
   // SHGetSpecialFolderPath requires at least MAX_PATH characters.
   font_path_chars.resize(MAX_PATH);
diff --git a/content/browser/renderer_host/dwrite_font_file_util_win.h b/content/browser/renderer_host/dwrite_font_file_util_win.h
index f4f7031..ce7df8dd 100644
--- a/content/browser/renderer_host/dwrite_font_file_util_win.h
+++ b/content/browser/renderer_host/dwrite_font_file_util_win.h
@@ -30,12 +30,12 @@
                                 std::wstring& file_path,
                                 uint32_t& ttc_index);
 HRESULT AddFilesForFont(IDWriteFont* font,
-                        const base::string16& windows_fonts_path,
+                        const std::u16string& windows_fonts_path,
                         std::set<std::wstring>* path_set,
                         std::set<std::wstring>* custom_font_path_set,
                         uint32_t* ttc_index);
 
-base::string16 GetWindowsFontsPath();
+std::u16string GetWindowsFontsPath();
 
 }  // namespace content
 
diff --git a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
index 3b3913c..4989b3a 100644
--- a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
+++ b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
@@ -451,7 +451,7 @@
   TRACE_EVENT0("dwrite,fonts",
                "DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily");
 
-  static base::NoDestructor<base::string16> windows_fonts_path(
+  static base::NoDestructor<std::u16string> windows_fonts_path(
       GetWindowsFontsPath());
 
   DWriteFontLookupTableBuilder::FamilyResult family_result;
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc b/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
index 19c6585..bd15bf3 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
@@ -77,7 +77,7 @@
 // That results in a poor user experience because websites that use those fonts
 // usually expect them to be rendered in the regular variant.
 bool CheckRequiredStylesPresent(IDWriteFontCollection* collection,
-                                const base::string16& family_name,
+                                const std::u16string& family_name,
                                 uint32_t family_index) {
   for (const auto& font_style : kRequiredStyles) {
     if (base::EqualsCaseInsensitiveASCII(family_name, font_style.family_name)) {
@@ -126,11 +126,11 @@
                               std::move(receiver));
 }
 
-void DWriteFontProxyImpl::SetWindowsFontsPathForTesting(base::string16 path) {
+void DWriteFontProxyImpl::SetWindowsFontsPathForTesting(std::u16string path) {
   windows_fonts_path_.swap(path);
 }
 
-void DWriteFontProxyImpl::FindFamily(const base::string16& family_name,
+void DWriteFontProxyImpl::FindFamily(const std::u16string& family_name,
                                      FindFamilyCallback callback) {
   InitializeDirectWrite();
   TRACE_EVENT0("dwrite,fonts", "FontProxyHost::OnFindFamily");
@@ -286,11 +286,11 @@
 }
 
 void DWriteFontProxyImpl::MapCharacters(
-    const base::string16& text,
+    const std::u16string& text,
     blink::mojom::DWriteFontStylePtr font_style,
-    const base::string16& locale_name,
+    const std::u16string& locale_name,
     uint32_t reading_direction,
-    const base::string16& base_family_name,
+    const std::u16string& base_family_name,
     MapCharactersCallback callback) {
   InitializeDirectWrite();
   callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
@@ -408,7 +408,7 @@
 }
 
 void DWriteFontProxyImpl::MatchUniqueFont(
-    const base::string16& unique_font_name,
+    const std::u16string& unique_font_name,
     MatchUniqueFontCallback callback) {
   TRACE_EVENT0("dwrite,fonts", "DWriteFontProxyImpl::MatchUniqueFont");
 
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win.h b/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
index 09e4491..337e771d 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
@@ -38,24 +38,24 @@
   static void Create(
       mojo::PendingReceiver<blink::mojom::DWriteFontProxy> receiver);
 
-  void SetWindowsFontsPathForTesting(base::string16 path);
+  void SetWindowsFontsPathForTesting(std::u16string path);
 
  protected:
   // blink::mojom::DWriteFontProxy:
-  void FindFamily(const base::string16& family_name,
+  void FindFamily(const std::u16string& family_name,
                   FindFamilyCallback callback) override;
   void GetFamilyCount(GetFamilyCountCallback callback) override;
   void GetFamilyNames(uint32_t family_index,
                       GetFamilyNamesCallback callback) override;
   void GetFontFiles(uint32_t family_index,
                     GetFontFilesCallback callback) override;
-  void MapCharacters(const base::string16& text,
+  void MapCharacters(const std::u16string& text,
                      blink::mojom::DWriteFontStylePtr font_style,
-                     const base::string16& locale_name,
+                     const std::u16string& locale_name,
                      uint32_t reading_direction,
-                     const base::string16& base_family_name,
+                     const std::u16string& base_family_name,
                      MapCharactersCallback callback) override;
-  void MatchUniqueFont(const base::string16& unique_font_name,
+  void MatchUniqueFont(const std::u16string& unique_font_name,
                        MatchUniqueFontCallback callback) override;
   void GetUniqueFontLookupMode(
       GetUniqueFontLookupModeCallback callback) override;
@@ -84,7 +84,7 @@
   Microsoft::WRL::ComPtr<IDWriteFactory2> factory2_;
   Microsoft::WRL::ComPtr<IDWriteFactory3> factory3_;
   Microsoft::WRL::ComPtr<IDWriteFontFallback> font_fallback_;
-  base::string16 windows_fonts_path_;
+  std::u16string windows_fonts_path_;
   base::MappedReadOnlyRegion font_unique_name_table_memory_;
 
   // Temp code to help track down crbug.com/561873
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc b/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
index 275406ff..72cc421c 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
@@ -194,11 +194,11 @@
       blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
                                          DWRITE_FONT_STYLE_NORMAL,
                                          DWRITE_FONT_STRETCH_NORMAL),
-      base::string16(), DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
-      base::string16(), &result);
+      std::u16string(), DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
+      std::u16string(), &result);
 
   EXPECT_NE(UINT32_MAX, result->family_index);
-  EXPECT_NE(base::string16(), result->family_name);
+  EXPECT_NE(std::u16string(), result->family_name);
   EXPECT_EQ(3u, result->mapped_length);
   EXPECT_NE(0.0, result->scale);
   EXPECT_NE(0, result->font_style->font_weight);
@@ -216,11 +216,11 @@
       blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
                                          DWRITE_FONT_STYLE_NORMAL,
                                          DWRITE_FONT_STRETCH_NORMAL),
-      u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, base::string16(),
+      u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, std::u16string(),
       &result);
 
   EXPECT_EQ(UINT32_MAX, result->family_index);
-  EXPECT_EQ(base::string16(), result->family_name);
+  EXPECT_EQ(std::u16string(), result->family_name);
   EXPECT_EQ(2u, result->mapped_length);
 }
 
@@ -234,11 +234,11 @@
       blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
                                          DWRITE_FONT_STYLE_NORMAL,
                                          DWRITE_FONT_STRETCH_NORMAL),
-      u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, base::string16(),
+      u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, std::u16string(),
       &result);
 
   EXPECT_NE(UINT32_MAX, result->family_index);
-  EXPECT_NE(base::string16(), result->family_name);
+  EXPECT_NE(std::u16string(), result->family_name);
   EXPECT_EQ(3u, result->mapped_length);
   EXPECT_NE(0.0, result->scale);
   EXPECT_NE(0, result->font_style->font_weight);
diff --git a/content/browser/renderer_host/frame_navigation_entry.cc b/content/browser/renderer_host/frame_navigation_entry.cc
index 90f85f2..6388603 100644
--- a/content/browser/renderer_host/frame_navigation_entry.cc
+++ b/content/browser/renderer_host/frame_navigation_entry.cc
@@ -164,7 +164,7 @@
 
   *content_type = base::UTF16ToASCII(
       exploded_state.top.http_body.http_content_type.value_or(
-          base::string16()));
+          std::u16string()));
   return exploded_state.top.http_body.request_body;
 }
 
diff --git a/content/browser/renderer_host/input/autoscroll_browsertest.cc b/content/browser/renderer_host/input/autoscroll_browsertest.cc
index 6421959..413e8f96 100644
--- a/content/browser/renderer_host/input/autoscroll_browsertest.cc
+++ b/content/browser/renderer_host/input/autoscroll_browsertest.cc
@@ -112,7 +112,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
index c2aff4c..6eab5dd 100644
--- a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
+++ b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
@@ -100,7 +100,7 @@
     HitTestRegionObserver observer(GetWidgetHost()->GetFrameSinkId());
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc b/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
index f5df211..28b6c9aa 100644
--- a/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
+++ b/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
@@ -130,7 +130,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/fling_browsertest.cc b/content/browser/renderer_host/input/fling_browsertest.cc
index e74cba6..b86f3d2 100644
--- a/content/browser/renderer_host/input/fling_browsertest.cc
+++ b/content/browser/renderer_host/input/fling_browsertest.cc
@@ -95,7 +95,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
     SynchronizeThreads();
diff --git a/content/browser/renderer_host/input/input_event_browsertest.cc b/content/browser/renderer_host/input/input_event_browsertest.cc
index 9819845..539995a 100644
--- a/content/browser/renderer_host/input/input_event_browsertest.cc
+++ b/content/browser/renderer_host/input/input_event_browsertest.cc
@@ -89,7 +89,7 @@
         host->render_frame_metadata_provider());
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
@@ -108,9 +108,9 @@
   }
 
   bool URLLoaded() {
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
-    const base::string16 title = watcher.WaitAndGetTitle();
+    const std::u16string title = watcher.WaitAndGetTitle();
     return title == ready_title;
   }
 
diff --git a/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc b/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
index 33525ffd0..9ffb543 100644
--- a/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
+++ b/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
@@ -40,7 +40,7 @@
   rvhi->OnHardwareConfigurationChanged();
 
   GURL test_url = GetTestUrl("", "interaction-mq-dynamic.html");
-  const base::string16 kSuccessTitle(base::ASCIIToUTF16("SUCCESS"));
+  const std::u16string kSuccessTitle(base::ASCIIToUTF16("SUCCESS"));
   TitleWatcher title_watcher(shell()->web_contents(), kSuccessTitle);
   EXPECT_TRUE(NavigateToURL(shell(), test_url));
 
diff --git a/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc b/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
index 744fa90..6694d4a1 100644
--- a/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
+++ b/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
@@ -97,7 +97,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/scroll_behavior_browsertest.cc b/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
index b0014f3..5c3e3062 100644
--- a/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
+++ b/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
@@ -152,7 +152,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/synthetic_input_browsertest.cc b/content/browser/renderer_host/input/synthetic_input_browsertest.cc
index 0f024afc..54f00c65 100644
--- a/content/browser/renderer_host/input/synthetic_input_browsertest.cc
+++ b/content/browser/renderer_host/input/synthetic_input_browsertest.cc
@@ -53,7 +53,7 @@
     HitTestRegionObserver observer(GetRenderWidgetHost()->GetFrameSinkId());
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc
index 790a112..9f3b3bd 100644
--- a/content/browser/renderer_host/input/touch_action_browsertest.cc
+++ b/content/browser/renderer_host/input/touch_action_browsertest.cc
@@ -164,7 +164,7 @@
         host->render_frame_metadata_provider());
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
@@ -219,9 +219,9 @@
   }
 
   bool URLLoaded() {
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
-    const base::string16 title = watcher.WaitAndGetTitle();
+    const std::u16string title = watcher.WaitAndGetTitle();
     return title == ready_title;
   }
 
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc b/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
index afb65cc..10ef2b2 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
@@ -441,7 +441,7 @@
     case ui::TouchEditable::kCopy:
       return readable && has_selection;
     case ui::TouchEditable::kPaste: {
-      base::string16 result;
+      std::u16string result;
       ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint(
           ui::EndpointType::kDefault, /*notify_if_restricted=*/false);
       ui::Clipboard::GetForCurrentThread()->ReadText(
@@ -496,7 +496,7 @@
          !handle_drag_in_progress_ && IsQuickMenuAvailable();
 }
 
-base::string16 TouchSelectionControllerClientAura::GetSelectedText() {
+std::u16string TouchSelectionControllerClientAura::GetSelectedText() {
   return rwhva_->GetSelectedText();
 }
 
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura.h b/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
index 80ff5cd..f7551e7c 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
@@ -95,7 +95,7 @@
   void ExecuteCommand(int command_id, int event_flags) override;
   void RunContextMenu() override;
   bool ShouldShowQuickMenu() override;
-  base::string16 GetSelectedText() override;
+  std::u16string GetSelectedText() override;
 
   // Not owned, non-null for the lifetime of this object.
   RenderWidgetHostViewAura* rwhva_;
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
index 822b3817..bd10d2a3 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
@@ -166,7 +166,7 @@
     case ui::TouchEditable::kCopy:
       return readable && has_selection;
     case ui::TouchEditable::kPaste: {
-      base::string16 result;
+      std::u16string result;
       ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint(
           ui::EndpointType::kDefault, /*notify_if_restricted=*/false);
       ui::Clipboard::GetForCurrentThread()->ReadText(
@@ -224,7 +224,7 @@
   return true;
 }
 
-base::string16 TouchSelectionControllerClientChildFrame::GetSelectedText() {
+std::u16string TouchSelectionControllerClientChildFrame::GetSelectedText() {
   return rwhv_->GetSelectedText();
 }
 
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
index cb1cc12b..d1bc279 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
@@ -60,7 +60,7 @@
   void ExecuteCommand(int command_id, int event_flags) override;
   void RunContextMenu() override;
   bool ShouldShowQuickMenu() override;
-  base::string16 GetSelectedText() override;
+  std::u16string GetSelectedText() override;
 
   gfx::Point ConvertFromRoot(const gfx::PointF& point) const;
 
diff --git a/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc b/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
index 83a49ec..2e3713e 100644
--- a/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
+++ b/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
@@ -71,7 +71,7 @@
     RenderWidgetHostImpl* host = GetWidgetHost();
     host->GetView()->SetSize(gfx::Size(400, 400));
 
-    base::string16 ready_title(base::ASCIIToUTF16("ready"));
+    std::u16string ready_title(base::ASCIIToUTF16("ready"));
     TitleWatcher watcher(shell()->web_contents(), ready_title);
     ignore_result(watcher.WaitAndGetTitle());
 
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 0610e5a3..6812d1f5 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -86,7 +86,7 @@
 
   // Reset tooltips when parent changed; otherwise tooltips could stay open as
   // the former parent wouldn't be forwarded any mouse leave messages.
-  host_->DisplayTooltipText(base::string16());
+  host_->DisplayTooltipText(std::u16string());
 }
 
 HWND LegacyRenderWidgetHostHWND::GetParent() {
diff --git a/content/browser/renderer_host/modal_close_listener_host_browsertest.cc b/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
index 43c8306..e2c8408 100644
--- a/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
+++ b/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
@@ -44,7 +44,7 @@
                     render_frame_host_impl)
                     ->SignalIfActive());
 
-    const base::string16 signaled_title = base::ASCIIToUTF16("SUCCESS");
+    const std::u16string signaled_title = base::ASCIIToUTF16("SUCCESS");
     TitleWatcher watcher(web_contents(), signaled_title);
     watcher.AlsoWaitForTitle(signaled_title);
     EXPECT_EQ(signaled_title, watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/navigation_controller_android.cc b/content/browser/renderer_host/navigation_controller_android.cc
index 40a84aa..e4024ce0 100644
--- a/content/browser/renderer_host/navigation_controller_android.cc
+++ b/content/browser/renderer_host/navigation_controller_android.cc
@@ -95,7 +95,7 @@
     return map_data;
   }
 
-  base::flat_map<std::string, base::string16>& map() { return map_; }
+  base::flat_map<std::string, std::u16string>& map() { return map_; }
 
   // base::SupportsUserData::Data:
   std::unique_ptr<Data> Clone() override {
@@ -105,7 +105,7 @@
   }
 
  private:
-  base::flat_map<std::string, base::string16> map_;
+  base::flat_map<std::string, std::u16string> map_;
 
   DISALLOW_COPY_AND_ASSIGN(MapData);
 };
@@ -448,7 +448,7 @@
       MapData::Get(navigation_controller_->GetEntryAtIndex(index));
   auto iter = map_data->map().find(key);
   return ConvertUTF16ToJavaString(
-      env, iter == map_data->map().end() ? base::string16() : iter->second);
+      env, iter == map_data->map().end() ? std::u16string() : iter->second);
 }
 
 void NavigationControllerAndroid::SetEntryExtraData(
@@ -461,7 +461,7 @@
     return;
 
   std::string key = base::android::ConvertJavaStringToUTF8(env, jkey);
-  base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue);
+  std::u16string value = base::android::ConvertJavaStringToUTF16(env, jvalue);
   MapData* map_data =
       MapData::Get(navigation_controller_->GetEntryAtIndex(index));
   map_data->map()[key] = value;
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index 9af368c..2160142 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -561,7 +561,7 @@
   auto entry = std::make_unique<NavigationEntryImpl>(
       nullptr,  // The site instance for tabs is sent on navigation
                 // (WebContents::GetSiteInstance).
-      url_to_load, referrer, initiator_origin, base::string16(), transition,
+      url_to_load, referrer, initiator_origin, std::u16string(), transition,
       is_renderer_initiated, blob_url_loader_factory);
   entry->SetVirtualURL(virtual_url);
   entry->set_user_typed_url(virtual_url);
@@ -1549,7 +1549,7 @@
     new_entry = std::make_unique<NavigationEntryImpl>(
         rfh->GetSiteInstance(), params.url, Referrer(*params.referrer),
         initiator_origin,
-        base::string16(),  // title
+        std::u16string(),  // title
         params.transition, request->IsRendererInitiated(),
         nullptr);  // blob_url_loader_factory
 
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
index e645c97..940ab5f 100644
--- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -185,7 +185,7 @@
       shell()->LoadDataWithBaseURL(history_url, data, base_url);
     }
     same_tab_observer.Wait();
-    base::string16 actual_title = title_watcher.WaitAndGetTitle();
+    std::u16string actual_title = title_watcher.WaitAndGetTitle();
     EXPECT_EQ(title, base::UTF16ToUTF8(actual_title));
   }
 
@@ -7870,10 +7870,10 @@
   EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
                                      &exploded_state));
   EXPECT_EQ(url_a,
-            GURL(exploded_state.top.url_string.value_or(base::string16())));
+            GURL(exploded_state.top.url_string.value_or(std::u16string())));
   EXPECT_EQ(frame_url_a2,
             GURL(exploded_state.top.children.at(0).url_string.value_or(
-                base::string16())));
+                std::u16string())));
 }
 
 // Start a provisional navigation, but abort it by going back before it commits.
@@ -7994,7 +7994,7 @@
   EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
                                      &exploded_state));
   EXPECT_EQ(url_b,
-            GURL(exploded_state.top.url_string.value_or(base::string16())));
+            GURL(exploded_state.top.url_string.value_or(std::u16string())));
   EXPECT_EQ(0U, exploded_state.top.children.size());
 
   // Go back and then forward to see if the PageState loads correctly.
@@ -8088,7 +8088,7 @@
   EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
                                      &exploded_state));
   EXPECT_EQ(url_b,
-            GURL(exploded_state.top.url_string.value_or(base::string16())));
+            GURL(exploded_state.top.url_string.value_or(std::u16string())));
 
   // Go back and then forward to see if the PageState loads correctly.
   controller.GoBack();
@@ -9058,7 +9058,7 @@
     return render_frame_host_;
   }
 
-  void RunModalAlertDialog(const base::string16& alert_message,
+  void RunModalAlertDialog(const std::u16string& alert_message,
                            RunModalAlertDialogCallback callback) override {
     alert_callback_ = std::move(callback);
     alert_message_ = alert_message;
@@ -9074,7 +9074,7 @@
 
  private:
   RenderFrameHostImpl* render_frame_host_;
-  base::string16 alert_message_;
+  std::u16string alert_message_;
   RunModalAlertDialogCallback alert_callback_;
   bool has_called_callback_ = false;
 };
@@ -9430,7 +9430,7 @@
       "/navigation_controller/simple_page_1.html"));
   GURL intermediate_url(embedded_test_server()->GetURL(
       "/navigation_controller/simple_page_2.html"));
-  base::string16 title = base::UTF8ToUTF16("title");
+  std::u16string title = base::UTF8ToUTF16("title");
 
   // Reload from the browser side.
   {
@@ -12250,7 +12250,7 @@
   // Navigate to a valid page.
   EXPECT_TRUE(NavigateToURL(shell(), url));
   int initial_entry_id = controller.GetLastCommittedEntry()->GetUniqueID();
-  base::string16 initial_title = controller.GetLastCommittedEntry()->GetTitle();
+  std::u16string initial_title = controller.GetLastCommittedEntry()->GetTitle();
   // Trigger a post-commit error page navigation.
   TestNavigationObserver error_observer(shell()->web_contents());
   controller.LoadPostCommitErrorPage(shell()->web_contents()->GetMainFrame(),
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
index 62d2732..0b7766b 100644
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -3077,7 +3077,7 @@
   NavigationControllerImpl& controller = controller_impl();
   const GURL url1("http://foo1");
   const GURL url2("http://foo2");
-  const base::string16 title(base::ASCIIToUTF16("Title"));
+  const std::u16string title(base::ASCIIToUTF16("Title"));
 
   NavigateAndCommit(url1);
   controller.GetVisibleEntry()->SetTitle(title);
@@ -3102,7 +3102,7 @@
   NavigationControllerImpl& controller = controller_impl();
   const GURL url1("http://foo1");
   const GURL url2("http://foo2");
-  const base::string16 title(base::ASCIIToUTF16("Title"));
+  const std::u16string title(base::ASCIIToUTF16("Title"));
 
   NavigateAndCommit(url1);
   controller.GetVisibleEntry()->SetTitle(title);
@@ -4098,7 +4098,7 @@
                                                      main_test_rfh());
 
   // Set title and favicon.
-  base::string16 title(base::ASCIIToUTF16("Title"));
+  std::u16string title(base::ASCIIToUTF16("Title"));
   FaviconStatus favicon;
   favicon.valid = true;
   favicon.url = GURL("http://foo/favicon.ico");
@@ -4118,7 +4118,7 @@
   main_test_rfh()->SendNavigateWithParams(std::move(params), true);
 
   // The title should immediately be visible on the new NavigationEntry.
-  base::string16 new_title =
+  std::u16string new_title =
       controller().GetLastCommittedEntry()->GetTitleForDisplay();
   EXPECT_EQ(title, new_title);
   FaviconStatus new_favicon =
diff --git a/content/browser/renderer_host/navigation_entry_impl.cc b/content/browser/renderer_host/navigation_entry_impl.cc
index 3054d10..a9a1080 100644
--- a/content/browser/renderer_host/navigation_entry_impl.cc
+++ b/content/browser/renderer_host/navigation_entry_impl.cc
@@ -53,7 +53,7 @@
 
 void RecursivelyGenerateFrameEntries(
     const blink::ExplodedFrameState& state,
-    const std::vector<base::Optional<base::string16>>& referenced_files,
+    const std::vector<base::Optional<std::u16string>>& referenced_files,
     NavigationEntryImpl::TreeNode* node) {
   // Set a single-frame PageState on the entry.
   blink::ExplodedPageState page_state;
@@ -72,13 +72,13 @@
   DCHECK(!data.empty()) << "Shouldn't generate an empty PageState.";
 
   node->frame_entry = base::MakeRefCounted<FrameNavigationEntry>(
-      UTF16ToUTF8(state.target.value_or(base::string16())),
+      UTF16ToUTF8(state.target.value_or(std::u16string())),
       state.item_sequence_number, state.document_sequence_number, nullptr,
-      nullptr, GURL(state.url_string.value_or(base::string16())),
+      nullptr, GURL(state.url_string.value_or(std::u16string())),
       // TODO(nasko): Supply valid origin once the value is persisted across
       // session restore.
       nullptr /* origin */,
-      Referrer(GURL(state.referrer.value_or(base::string16())),
+      Referrer(GURL(state.referrer.value_or(std::u16string())),
                state.referrer_policy),
       state.initiator_origin, std::vector<GURL>(),
       blink::PageState::CreateFromEncodedData(data), "GET", -1,
@@ -92,7 +92,7 @@
   // Don't pass the file list to subframes, since that would result in multiple
   // copies of it ending up in the combined list in GetPageState (via
   // RecursivelyGenerateFrameState).
-  std::vector<base::Optional<base::string16>> empty_file_list;
+  std::vector<base::Optional<std::u16string>> empty_file_list;
 
   for (const blink::ExplodedFrameState& child_state : state.children) {
     node->children.push_back(
@@ -102,7 +102,7 @@
   }
 }
 
-base::Optional<base::string16> UrlToOptionalString16(const GURL& url) {
+base::Optional<std::u16string> UrlToOptionalString16(const GURL& url) {
   if (!url.is_valid())
     return base::nullopt;
   return base::UTF8ToUTF16(url.spec());
@@ -111,7 +111,7 @@
 void RecursivelyGenerateFrameState(
     NavigationEntryImpl::TreeNode* node,
     blink::ExplodedFrameState* state,
-    std::vector<base::Optional<base::string16>>* referenced_files) {
+    std::vector<base::Optional<std::u16string>>* referenced_files) {
   // The FrameNavigationEntry's PageState contains just the ExplodedFrameState
   // for that particular frame.
   blink::ExplodedPageState exploded_page_state;
@@ -310,7 +310,7 @@
                           GURL(),
                           Referrer(),
                           base::nullopt,
-                          base::string16(),
+                          std::u16string(),
                           ui::PAGE_TRANSITION_LINK,
                           false,
                           nullptr) {}
@@ -320,7 +320,7 @@
     const GURL& url,
     const Referrer& referrer,
     const base::Optional<url::Origin>& initiator_origin,
-    const base::string16& title,
+    const std::u16string& title,
     ui::PageTransition transition_type,
     bool is_renderer_initiated,
     scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory)
@@ -424,12 +424,12 @@
   return virtual_url_.is_empty() ? GetURL() : virtual_url_;
 }
 
-void NavigationEntryImpl::SetTitle(const base::string16& title) {
+void NavigationEntryImpl::SetTitle(const std::u16string& title) {
   title_ = title;
   cached_display_title_.clear();
 }
 
-const base::string16& NavigationEntryImpl::GetTitle() {
+const std::u16string& NavigationEntryImpl::GetTitle() {
   return title_;
 }
 
@@ -478,7 +478,7 @@
   frame_tree_->frame_entry->set_site_instance(std::move(site_instance));
 }
 
-const base::string16& NavigationEntryImpl::GetTitleForDisplay() {
+const std::u16string& NavigationEntryImpl::GetTitleForDisplay() {
   // Most pages have real titles. Don't even bother caching anything if this is
   // the case.
   if (!title_.empty())
@@ -490,7 +490,7 @@
     return cached_display_title_;
 
   // Use the virtual URL first if any, and fall back on using the real URL.
-  base::string16 title;
+  std::u16string title;
   if (!virtual_url_.is_empty()) {
     title = url_formatter::FormatUrl(virtual_url_);
   } else if (!GetURL().is_empty()) {
@@ -502,22 +502,22 @@
     // It is necessary to ignore the reference and query parameters or else
     // looking for slashes might accidentally return one of those values. See
     // https://crbug.com/503003.
-    base::string16::size_type refpos = title.find('#');
-    base::string16::size_type querypos = title.find('?');
-    base::string16::size_type lastpos;
-    if (refpos == base::string16::npos)
+    std::u16string::size_type refpos = title.find('#');
+    std::u16string::size_type querypos = title.find('?');
+    std::u16string::size_type lastpos;
+    if (refpos == std::u16string::npos)
       lastpos = querypos;
-    else if (querypos == base::string16::npos)
+    else if (querypos == std::u16string::npos)
       lastpos = refpos;
     else
       lastpos = (refpos < querypos) ? refpos : querypos;
-    base::string16::size_type slashpos = title.rfind('/', lastpos);
-    if (slashpos != base::string16::npos)
+    std::u16string::size_type slashpos = title.rfind('/', lastpos);
+    if (slashpos != std::u16string::npos)
       title = title.substr(slashpos + 1);
 
   } else if (GetURL().SchemeIs(kChromeUIUntrustedScheme)) {
     // For chrome-untrusted:// URLs, leave title blank until the page loads.
-    title = base::string16();
+    title = std::u16string();
 
   } else if (base::i18n::StringContainsStrongRTLChars(title)) {
     // Wrap the URL in an LTR embedding for proper handling of RTL characters.
@@ -529,7 +529,7 @@
 
 #if defined(OS_ANDROID)
   if (GetURL().SchemeIs(url::kContentScheme)) {
-    base::string16 file_display_name;
+    std::u16string file_display_name;
     if (base::MaybeGetFileDisplayName(base::FilePath(GetURL().spec()),
                                       &file_display_name)) {
       title = file_display_name;
@@ -969,7 +969,7 @@
               child->frame_entry->page_state().ToEncodedData(),
               &exploded_page_state)) {
         blink::ExplodedFrameState frame_state = exploded_page_state.top;
-        if (UTF16ToUTF8(frame_state.url_string.value_or(base::string16())) ==
+        if (UTF16ToUTF8(frame_state.url_string.value_or(std::u16string())) ==
             url::kAboutBlankURL)
           is_about_blank = true;
       }
diff --git a/content/browser/renderer_host/navigation_entry_impl.h b/content/browser/renderer_host/navigation_entry_impl.h
index ea57929..3f1f36b 100644
--- a/content/browser/renderer_host/navigation_entry_impl.h
+++ b/content/browser/renderer_host/navigation_entry_impl.h
@@ -90,7 +90,7 @@
       const GURL& url,
       const Referrer& referrer,
       const base::Optional<url::Origin>& initiator_origin,
-      const base::string16& title,
+      const std::u16string& title,
       ui::PageTransition transition_type,
       bool is_renderer_initiated,
       scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory);
@@ -113,11 +113,11 @@
   const Referrer& GetReferrer() override;
   void SetVirtualURL(const GURL& url) override;
   const GURL& GetVirtualURL() override;
-  void SetTitle(const base::string16& title) override;
-  const base::string16& GetTitle() override;
+  void SetTitle(const std::u16string& title) override;
+  const std::u16string& GetTitle() override;
   void SetPageState(const blink::PageState& state) override;
   blink::PageState GetPageState() override;
-  const base::string16& GetTitleForDisplay() override;
+  const std::u16string& GetTitleForDisplay() override;
   bool IsViewSourceMode() override;
   void SetTransitionType(ui::PageTransition transition_type) override;
   ui::PageTransition GetTransitionType() override;
@@ -431,7 +431,7 @@
   PageType page_type_;
   GURL virtual_url_;
   bool update_virtual_url_with_url_;
-  base::string16 title_;
+  std::u16string title_;
   FaviconStatus favicon_;
   SSLStatus ssl_;
   ui::PageTransition transition_type_;
@@ -470,7 +470,7 @@
   // us from having to do URL formatting on the URL every time the title is
   // displayed. When the URL, virtual URL, or title is set, this should be
   // cleared to force a refresh.
-  mutable base::string16 cached_display_title_;
+  mutable std::u16string cached_display_title_;
 
   // This is set to true when this entry is being reloaded and due to changes in
   // the state of the URL, it has to be reloaded in a different site instance.
diff --git a/content/browser/renderer_host/navigation_entry_impl_unittest.cc b/content/browser/renderer_host/navigation_entry_impl_unittest.cc
index 532fe98e..3007051 100644
--- a/content/browser/renderer_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_entry_impl_unittest.cc
@@ -161,7 +161,7 @@
 
   // For chrome-untrusted:// URLs, title is blank.
   entry1_->SetURL(GURL("chrome-untrusted://terminal/html/terminal.html"));
-  EXPECT_EQ(base::string16(), entry1_->GetTitleForDisplay());
+  EXPECT_EQ(std::u16string(), entry1_->GetTitleForDisplay());
 
   // Title affects GetTitleForDisplay
   entry1_->SetTitle(ASCIIToUTF16("Google"));
@@ -242,7 +242,7 @@
   EXPECT_EQ(GURL("from2"), entry2_->GetReferrer().url);
 
   // Title
-  EXPECT_EQ(base::string16(), entry1_->GetTitle());
+  EXPECT_EQ(std::u16string(), entry1_->GetTitle());
   EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitle());
   entry2_->SetTitle(ASCIIToUTF16("title2"));
   EXPECT_EQ(ASCIIToUTF16("title2"), entry2_->GetTitle());
diff --git a/content/browser/renderer_host/raw_clipboard_host_impl.cc b/content/browser/renderer_host/raw_clipboard_host_impl.cc
index 8a219b9..2c965cb 100644
--- a/content/browser/renderer_host/raw_clipboard_host_impl.cc
+++ b/content/browser/renderer_host/raw_clipboard_host_impl.cc
@@ -88,13 +88,13 @@
     ReadAvailableFormatNamesCallback callback) {
   if (!HasTransientUserActivation())
     return;
-  std::vector<base::string16> raw_types =
+  std::vector<std::u16string> raw_types =
       clipboard_->ReadAvailablePlatformSpecificFormatNames(
           ui::ClipboardBuffer::kCopyPaste, CreateDataEndpoint().get());
   std::move(callback).Run(raw_types);
 }
 
-void RawClipboardHostImpl::Read(const base::string16& format,
+void RawClipboardHostImpl::Read(const std::u16string& format,
                                 ReadCallback callback) {
   if (!HasTransientUserActivation())
     return;
@@ -113,7 +113,7 @@
   std::move(callback).Run(std::move(buffer));
 }
 
-void RawClipboardHostImpl::Write(const base::string16& format,
+void RawClipboardHostImpl::Write(const std::u16string& format,
                                  mojo_base::BigBuffer data) {
   if (!HasTransientUserActivation())
     return;
@@ -140,7 +140,7 @@
   // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclipboardformata
   static constexpr int kMaxWindowsClipboardFormats = 0x4000;
   static constexpr int kMaxRegisteredFormats = kMaxWindowsClipboardFormats / 4;
-  static base::NoDestructor<std::set<base::string16>> registered_formats;
+  static base::NoDestructor<std::set<std::u16string>> registered_formats;
   if (!base::Contains(*registered_formats, format)) {
     if (registered_formats->size() >= kMaxRegisteredFormats)
       return;
diff --git a/content/browser/renderer_host/raw_clipboard_host_impl.h b/content/browser/renderer_host/raw_clipboard_host_impl.h
index d5816c03..a4d7a47 100644
--- a/content/browser/renderer_host/raw_clipboard_host_impl.h
+++ b/content/browser/renderer_host/raw_clipboard_host_impl.h
@@ -38,8 +38,8 @@
   // mojom::RawClipboardHost.
   void ReadAvailableFormatNames(
       ReadAvailableFormatNamesCallback callback) override;
-  void Read(const base::string16& format, ReadCallback callback) override;
-  void Write(const base::string16& format, mojo_base::BigBuffer data) override;
+  void Read(const std::u16string& format, ReadCallback callback) override;
+  void Write(const std::u16string& format, mojo_base::BigBuffer data) override;
   void CommitWrite() override;
 
   std::unique_ptr<ui::DataTransferEndpoint> CreateDataEndpoint();
diff --git a/content/browser/renderer_host/render_frame_host_delegate.cc b/content/browser/renderer_host/render_frame_host_delegate.cc
index 190a88d..bf430a4 100644
--- a/content/browser/renderer_host/render_frame_host_delegate.cc
+++ b/content/browser/renderer_host/render_frame_host_delegate.cc
@@ -34,10 +34,10 @@
 bool RenderFrameHostDelegate::DidAddMessageToConsole(
     RenderFrameHostImpl* source_frame,
     blink::mojom::ConsoleMessageLevel log_level,
-    const base::string16& message,
+    const std::u16string& message,
     int32_t line_no,
-    const base::string16& source_id,
-    const base::Optional<base::string16>& untrusted_stack_trace) {
+    const std::u16string& source_id,
+    const base::Optional<std::u16string>& untrusted_stack_trace) {
   return false;
 }
 
diff --git a/content/browser/renderer_host/render_frame_host_delegate.h b/content/browser/renderer_host/render_frame_host_delegate.h
index cfeaea1..86f12284 100644
--- a/content/browser/renderer_host/render_frame_host_delegate.h
+++ b/content/browser/renderer_host/render_frame_host_delegate.h
@@ -158,10 +158,10 @@
   virtual bool DidAddMessageToConsole(
       RenderFrameHostImpl* source_frame,
       blink::mojom::ConsoleMessageLevel log_level,
-      const base::string16& message,
+      const std::u16string& message,
       int32_t line_no,
-      const base::string16& source_id,
-      const base::Optional<base::string16>& untrusted_stack_trace);
+      const std::u16string& source_id,
+      const base::Optional<std::u16string>& untrusted_stack_trace);
 
   // Called when a RenderFrame for |render_frame_host| is created in the
   // renderer process. Use |RenderFrameDeleted| to listen for when this
@@ -183,8 +183,8 @@
 
   // A JavaScript alert, confirmation or prompt dialog should be shown.
   virtual void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host,
-                                   const base::string16& message,
-                                   const base::string16& default_prompt,
+                                   const std::u16string& message,
+                                   const std::u16string& default_prompt,
                                    JavaScriptDialogType type,
                                    JavaScriptDialogCallback callback) {}
 
@@ -227,7 +227,7 @@
   // The page's title was changed and should be updated. Only called for the
   // top-level frame.
   virtual void UpdateTitle(RenderFrameHostImpl* render_frame_host,
-                           const base::string16& title,
+                           const std::u16string& title,
                            base::i18n::TextDirection title_direction) {}
 
   // The destination URL has changed and should be updated.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 1305d74..dacea0f 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1835,8 +1835,8 @@
 }
 
 void RenderFrameHostImpl::ExecuteJavaScriptMethod(
-    const base::string16& object_name,
-    const base::string16& method_name,
+    const std::u16string& object_name,
+    const std::u16string& method_name,
     base::Value arguments,
     JavaScriptResultCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1849,7 +1849,7 @@
       std::move(callback));
 }
 
-void RenderFrameHostImpl::ExecuteJavaScript(const base::string16& javascript,
+void RenderFrameHostImpl::ExecuteJavaScript(const std::u16string& javascript,
                                             JavaScriptResultCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   CHECK(CanExecuteJavaScript());
@@ -1860,7 +1860,7 @@
 }
 
 void RenderFrameHostImpl::ExecuteJavaScriptInIsolatedWorld(
-    const base::string16& javascript,
+    const std::u16string& javascript,
     JavaScriptResultCallback callback,
     int32_t world_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1873,7 +1873,7 @@
 }
 
 void RenderFrameHostImpl::ExecuteJavaScriptForTests(
-    const base::string16& javascript,
+    const std::u16string& javascript,
     JavaScriptResultCallback callback,
     int32_t world_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1886,7 +1886,7 @@
 }
 
 void RenderFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
-    const base::string16& javascript,
+    const std::u16string& javascript,
     int32_t world_id) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
@@ -2220,7 +2220,7 @@
            iter(&smart_clip_callbacks_);
        !iter.IsAtEnd(); iter.Advance()) {
     std::move(*iter.GetCurrentValue())
-        .Run(base::string16(), base::string16(), gfx::Rect());
+        .Run(std::u16string(), std::u16string(), gfx::Rect());
   }
   smart_clip_callbacks_.Clear();
 #endif  // defined(OS_ANDROID)
@@ -2639,11 +2639,11 @@
 
 void RenderFrameHostImpl::DidAddMessageToConsole(
     blink::mojom::ConsoleMessageLevel log_level,
-    const base::string16& message,
+    const std::u16string& message,
     int32_t line_no,
-    const base::Optional<base::string16>& source_id,
-    const base::Optional<base::string16>& untrusted_stack_trace) {
-  base::string16 updated_source_id;
+    const base::Optional<std::u16string>& source_id,
+    const base::Optional<std::u16string>& untrusted_stack_trace) {
+  std::u16string updated_source_id;
   if (source_id.has_value())
     updated_source_id = *source_id;
   if (delegate_->DidAddMessageToConsole(this, log_level, message, line_no,
@@ -3582,8 +3582,8 @@
 }
 
 void RenderFrameHostImpl::OnSmartClipDataExtracted(int32_t callback_id,
-                                                   const base::string16& text,
-                                                   const base::string16& html,
+                                                   const std::u16string& text,
+                                                   const std::u16string& html,
                                                    const gfx::Rect& clip_rect) {
   std::move(*smart_clip_callbacks_.Lookup(callback_id))
       .Run(text, html, clip_rect);
@@ -3592,40 +3592,40 @@
 #endif  // defined(OS_ANDROID)
 
 void RenderFrameHostImpl::RunModalAlertDialog(
-    const base::string16& alert_message,
+    const std::u16string& alert_message,
     RunModalAlertDialogCallback response_callback) {
   auto dialog_closed_callback = base::BindOnce(
       [](RunModalAlertDialogCallback response_callback, bool success,
-         const base::string16& response) {
+         const std::u16string& response) {
         // The response string is unused but we use a generic mechanism for
         // closing the javascript dialog that returns two arguments.
         std::move(response_callback).Run();
       },
       std::move(response_callback));
-  RunJavaScriptDialog(alert_message, base::string16(),
+  RunJavaScriptDialog(alert_message, std::u16string(),
                       JAVASCRIPT_DIALOG_TYPE_ALERT,
                       std::move(dialog_closed_callback));
 }
 
 void RenderFrameHostImpl::RunModalConfirmDialog(
-    const base::string16& alert_message,
+    const std::u16string& alert_message,
     RunModalConfirmDialogCallback response_callback) {
   auto dialog_closed_callback = base::BindOnce(
       [](RunModalConfirmDialogCallback response_callback, bool success,
-         const base::string16& response) {
+         const std::u16string& response) {
         // The response string is unused but we use a generic mechanism for
         // closing the javascript dialog that returns two arguments.
         std::move(response_callback).Run(success);
       },
       std::move(response_callback));
-  RunJavaScriptDialog(alert_message, base::string16(),
+  RunJavaScriptDialog(alert_message, std::u16string(),
                       JAVASCRIPT_DIALOG_TYPE_CONFIRM,
                       std::move(dialog_closed_callback));
 }
 
 void RenderFrameHostImpl::RunModalPromptDialog(
-    const base::string16& alert_message,
-    const base::string16& default_value,
+    const std::u16string& alert_message,
+    const std::u16string& default_value,
     RunModalPromptDialogCallback response_callback) {
   RunJavaScriptDialog(alert_message, default_value,
                       JAVASCRIPT_DIALOG_TYPE_PROMPT,
@@ -3633,15 +3633,15 @@
 }
 
 void RenderFrameHostImpl::RunJavaScriptDialog(
-    const base::string16& message,
-    const base::string16& default_prompt,
+    const std::u16string& message,
+    const std::u16string& default_prompt,
     JavaScriptDialogType dialog_type,
     JavaScriptDialogCallback ipc_response_callback) {
   // Don't show the dialog if it's triggered on a non-active RenderFrameHost.
   // This happens when the RenderFrameHost is pending deletion or in the
   // back-forward cache.
   if (lifecycle_state_ != LifecycleState::kActive) {
-    std::move(ipc_response_callback).Run(true, base::string16());
+    std::move(ipc_response_callback).Run(true, std::u16string());
     return;
   }
 
@@ -3707,7 +3707,7 @@
 
   auto ipc_callback_wrapper = base::BindOnce(
       [](RunBeforeUnloadConfirmCallback response_callback, bool success,
-         const base::string16& response) {
+         const std::u16string& response) {
         // The response string is unused but we use a generic mechanism for
         // closing the javascript dialog that returns two arguments.
         std::move(response_callback).Run(success);
@@ -3828,7 +3828,7 @@
                                           traffic_annotation));
   parameters->set_content_initiated(!blink_parameters->is_context_menu_save);
   parameters->set_suggested_name(
-      blink_parameters->suggested_name.value_or(base::string16()));
+      blink_parameters->suggested_name.value_or(std::u16string()));
   parameters->set_prompt(blink_parameters->is_context_menu_save);
   parameters->set_cross_origin_redirects(
       blink_parameters->cross_origin_redirects);
@@ -4187,13 +4187,13 @@
 }
 
 void RenderFrameHostImpl::UpdateTitle(
-    const base::Optional<::base::string16>& title,
+    const base::Optional<::std::u16string>& title,
     base::i18n::TextDirection title_direction) {
   // This message should only be sent for top-level frames.
   if (!is_main_frame())
     return;
 
-  base::string16 received_title;
+  std::u16string received_title;
   if (title.has_value())
     received_title = title.value();
 
@@ -4869,7 +4869,7 @@
       focus_type);
 }
 
-void RenderFrameHostImpl::TextSelectionChanged(const base::string16& text,
+void RenderFrameHostImpl::TextSelectionChanged(const std::u16string& text,
                                                uint32_t offset,
                                                const gfx::Range& range) {
   has_selection_ = !text.empty();
@@ -6303,7 +6303,7 @@
 void RenderFrameHostImpl::JavaScriptDialogClosed(
     JavaScriptDialogCallback dialog_closed_callback,
     bool success,
-    const base::string16& user_input) {
+    const std::u16string& user_input) {
   GetProcess()->SetBlocked(false);
   std::move(dialog_closed_callback).Run(success, user_input);
   // If executing as part of beforeunload event handling, there may have been
@@ -9549,8 +9549,8 @@
 
 void RenderFrameHostImpl::PostMessageEvent(
     const base::Optional<blink::RemoteFrameToken>& source_token,
-    const base::string16& source_origin,
-    const base::string16& target_origin,
+    const std::u16string& source_origin,
+    const std::u16string& target_origin,
     blink::TransferableMessage message) {
   DCHECK(is_render_frame_created());
 
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 10d14bbe11a..2dd48f8 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -339,21 +339,21 @@
   gfx::NativeView GetNativeView() override;
   void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level,
                            const std::string& message) override;
-  void ExecuteJavaScriptMethod(const base::string16& object_name,
-                               const base::string16& method_name,
+  void ExecuteJavaScriptMethod(const std::u16string& object_name,
+                               const std::u16string& method_name,
                                base::Value arguments,
                                JavaScriptResultCallback callback) override;
-  void ExecuteJavaScript(const base::string16& javascript,
+  void ExecuteJavaScript(const std::u16string& javascript,
                          JavaScriptResultCallback callback) override;
-  void ExecuteJavaScriptInIsolatedWorld(const base::string16& javascript,
+  void ExecuteJavaScriptInIsolatedWorld(const std::u16string& javascript,
                                         JavaScriptResultCallback callback,
                                         int32_t world_id) override;
   void ExecuteJavaScriptForTests(
-      const base::string16& javascript,
+      const std::u16string& javascript,
       JavaScriptResultCallback callback,
       int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) override;
   void ExecuteJavaScriptWithUserGestureForTests(
-      const base::string16& javascript,
+      const std::u16string& javascript,
       int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) override;
   void ActivateFindInPageResultForAccessibility(int request_id) override;
   void InsertVisualStateCallback(VisualStateCallback callback) override;
@@ -943,14 +943,14 @@
 #if defined(OS_ANDROID)
   // Samsung Galaxy Note-specific "smart clip" stylus text getter.
   using ExtractSmartClipDataCallback = base::OnceCallback<
-      void(const base::string16&, const base::string16&, const gfx::Rect&)>;
+      void(const std::u16string&, const std::u16string&, const gfx::Rect&)>;
 
   void RequestSmartClipExtract(ExtractSmartClipDataCallback callback,
                                gfx::Rect rect);
 
   void OnSmartClipDataExtracted(int32_t callback_id,
-                                const base::string16& text,
-                                const base::string16& html,
+                                const std::u16string& text,
+                                const std::u16string& html,
                                 const gfx::Rect& clip_rect);
 #endif  // defined(OS_ANDROID)
 
@@ -1345,8 +1345,8 @@
   // Posts a message from a frame in another process to the current renderer.
   void PostMessageEvent(
       const base::Optional<blink::RemoteFrameToken>& source_token,
-      const base::string16& source_origin,
-      const base::string16& target_origin,
+      const std::u16string& source_origin,
+      const std::u16string& target_origin,
       blink::TransferableMessage message);
 
   // Requests to swap the current frame into the frame tree, replacing the
@@ -1738,7 +1738,7 @@
   void DispatchLoad() override;
   void GoToEntryAtOffset(int32_t offset, bool has_user_gesture) override;
   void RenderFallbackContentInParentProcess() override;
-  void UpdateTitle(const base::Optional<::base::string16>& title,
+  void UpdateTitle(const base::Optional<::std::u16string>& title,
                    base::i18n::TextDirection title_direction) override;
   void UpdateUserActivationState(
       blink::mojom::UserActivationUpdateType update_type,
@@ -1750,12 +1750,12 @@
   void ForwardResourceTimingToParent(
       blink::mojom::ResourceTimingInfoPtr timing) override;
   void DidFinishDocumentLoad() override;
-  void RunModalAlertDialog(const base::string16& alert_message,
+  void RunModalAlertDialog(const std::u16string& alert_message,
                            RunModalAlertDialogCallback callback) override;
-  void RunModalConfirmDialog(const base::string16& alert_message,
+  void RunModalConfirmDialog(const std::u16string& alert_message,
                              RunModalConfirmDialogCallback callback) override;
-  void RunModalPromptDialog(const base::string16& alert_message,
-                            const base::string16& default_value,
+  void RunModalPromptDialog(const std::u16string& alert_message,
+                            const std::u16string& default_value,
                             RunModalPromptDialogCallback callback) override;
   void RunBeforeUnloadConfirm(bool is_reload,
                               RunBeforeUnloadConfirmCallback callback) override;
@@ -1765,7 +1765,7 @@
   void FocusedElementChanged(bool is_editable_element,
                              const gfx::Rect& bounds_in_frame_widget,
                              blink::mojom::FocusType focus_type) override;
-  void TextSelectionChanged(const base::string16& text,
+  void TextSelectionChanged(const std::u16string& text,
                             uint32_t offset,
                             const gfx::Range& range) override;
   void ShowPopupMenu(
@@ -1804,10 +1804,10 @@
   void Detach() override;
   void DidAddMessageToConsole(
       blink::mojom::ConsoleMessageLevel log_level,
-      const base::string16& message,
+      const std::u16string& message,
       int32_t line_no,
-      const base::Optional<base::string16>& source_id,
-      const base::Optional<base::string16>& untrusted_stack_trace) override;
+      const base::Optional<std::u16string>& source_id,
+      const base::Optional<std::u16string>& untrusted_stack_trace) override;
   void FrameSizeChanged(const gfx::Size& frame_size) override;
 
   // blink::LocalMainFrameHost overrides:
@@ -2681,8 +2681,8 @@
   // Common handler for displaying a javascript dialog from the Run*Dialog
   // mojo handlers. This method sets up some initial state before asking the
   // delegate to create a dialog.
-  void RunJavaScriptDialog(const base::string16& message,
-                           const base::string16& default_prompt,
+  void RunJavaScriptDialog(const std::u16string& message,
+                           const std::u16string& default_prompt,
                            JavaScriptDialogType dialog_type,
                            JavaScriptDialogCallback callback);
 
@@ -2691,7 +2691,7 @@
   // callback when done.
   void JavaScriptDialogClosed(JavaScriptDialogCallback response_callback,
                               bool success,
-                              const base::string16& user_input);
+                              const std::u16string& user_input);
 
   // See |SetIsXrOverlaySetup()|
   bool HasSeenRecentXrOverlaySetup();
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
index c355e88..e8a114a6 100644
--- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
+++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -422,7 +422,7 @@
   }
 
   // Runs the dialog callback.
-  void Run(bool success, const base::string16& user_input) {
+  void Run(bool success, const std::u16string& user_input) {
     std::move(callback_).Run(success, user_input);
   }
 
@@ -450,8 +450,8 @@
   void RunJavaScriptDialog(WebContents* web_contents,
                            RenderFrameHost* render_frame_host,
                            JavaScriptDialogType dialog_type,
-                           const base::string16& message_text,
-                           const base::string16& default_prompt_text,
+                           const std::u16string& message_text,
+                           const std::u16string& default_prompt_text,
                            DialogClosedCallback callback,
                            bool* did_suppress_message) override {
     callback_ = std::move(callback);
@@ -469,7 +469,7 @@
 
   bool HandleJavaScriptDialog(WebContents* web_contents,
                               bool accept,
-                              const base::string16* prompt_override) override {
+                              const std::u16string* prompt_override) override {
     return true;
   }
 
@@ -576,7 +576,7 @@
   EXPECT_TRUE(WaitForLoadStop(web_contents()));
   // JavaScript onbeforeunload dialogs require a user gesture.
   for (auto* frame : web_contents()->GetAllFrames())
-    frame->ExecuteJavaScriptWithUserGestureForTests(base::string16());
+    frame->ExecuteJavaScriptWithUserGestureForTests(std::u16string());
 
   // Force a process switch by going to a privileged page. The beforeunload
   // timer will be started on the top-level frame but will be paused while the
@@ -590,7 +590,7 @@
   EXPECT_TRUE(main_frame->is_waiting_for_beforeunload_completion());
 
   // Answer the dialog.
-  dialog_manager.Run(true, base::string16());
+  dialog_manager.Run(true, std::u16string());
 
   // There will be no beforeunload completion callback invocation, so if the
   // beforeunload completion callback timer isn't functioning then the
@@ -624,12 +624,12 @@
   // Give the page a user gesture and try reloading again. This time there
   // should be a dialog. If there is no dialog, the call to Wait will hang.
   web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
-      base::string16());
+      std::u16string());
   web_contents()->GetController().Reload(ReloadType::NORMAL, false);
   dialog_manager.Wait();
 
   // Answer the dialog.
-  dialog_manager.Run(true, base::string16());
+  dialog_manager.Run(true, std::u16string());
   EXPECT_TRUE(WaitForLoadStop(web_contents()));
 
   // The reload should have cleared the user gesture bit, so upon leaving again
@@ -659,7 +659,7 @@
 
   // Cancel the dialog.
   dialog_manager.reset_url_invalidate_count();
-  dialog_manager.Run(false, base::string16());
+  dialog_manager.Run(false, std::u16string());
   EXPECT_FALSE(web_contents()->IsLoading());
 
   // Verify there are no pending history items after the dialog is cancelled.
@@ -694,12 +694,12 @@
 
   void CloseDialogAndProceed() {
     dialog_manager_->Run(true /* navigation should proceed */,
-                         base::string16());
+                         std::u16string());
   }
 
   void CloseDialogAndCancel() {
     dialog_manager_->Run(false /* navigation should proceed */,
-                         base::string16());
+                         std::u16string());
   }
 
   // Installs a beforeunload handler in the given frame.
@@ -1501,7 +1501,7 @@
   // NavigationHandleGrabber::SendingNavigationCommitted(). The navigation
   // should get aborted because of the document.open() in the navigating RFH.
   NavigationHandleGrabber observer(web_contents());
-  const base::string16 title = base::ASCIIToUTF16("done");
+  const std::u16string title = base::ASCIIToUTF16("done");
   EXPECT_TRUE(
       ExecuteScript(web_contents(), "window.location.href='/https/chromium.googlesource.com/title2.html'"));
   observer.WaitForTitle2();
@@ -1590,8 +1590,8 @@
   xhr_response.Done();
 
   // 4) Wait for the XHR request to complete.
-  const base::string16 xhr_aborted_title = base::ASCIIToUTF16("xhr aborted");
-  const base::string16 xhr_loaded_title = base::ASCIIToUTF16("xhr loaded");
+  const std::u16string xhr_aborted_title = base::ASCIIToUTF16("xhr aborted");
+  const std::u16string xhr_loaded_title = base::ASCIIToUTF16("xhr loaded");
   TitleWatcher watcher(shell()->web_contents(), xhr_loaded_title);
   watcher.AlsoWaitForTitle(xhr_aborted_title);
 
@@ -1644,7 +1644,7 @@
   // 3) The end of the response is issued. The renderer must be able to receive
   //    it.
   {
-    const base::string16 document_loaded_title =
+    const std::u16string document_loaded_title =
         base::ASCIIToUTF16("document loaded");
     TitleWatcher watcher(shell()->web_contents(), document_loaded_title);
     main_document_response.Send(
@@ -2639,7 +2639,7 @@
   // dispatch a before unload with discard as a reason. This should return
   // without any dialog being seen.
   web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
-      base::string16());
+      std::u16string());
   web_contents()->GetMainFrame()->DispatchBeforeUnload(
       RenderFrameHostImpl::BeforeUnloadType::DISCARD, false);
   dialog_manager.Wait();
@@ -2666,7 +2666,7 @@
   // dispatch a before unload with discard as a reason. This should return
   // without any dialog being seen.
   web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
-      base::string16());
+      std::u16string());
 
   // Launch an alert javascript dialog. This pending dialog should block a
   // subsequent discarding before unload request.
@@ -2688,7 +2688,7 @@
 
   // Clear the existing javascript dialog so that the associated IPC message
   // doesn't leak.
-  dialog_manager.Run(true, base::string16());
+  dialog_manager.Run(true, std::u16string());
 
   web_contents()->SetDelegate(nullptr);
   web_contents()->SetJavaScriptDialogManagerForTesting(nullptr);
diff --git a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
index 09a117f94..cc7dc47 100644
--- a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
@@ -1108,7 +1108,7 @@
 
   // 3) Post a message from the foo window to the opener.  The opener will
   // reply, causing the foo window to update its own title.
-  base::string16 expected_title = ASCIIToUTF16("msg");
+  std::u16string expected_title = ASCIIToUTF16("msg");
   TitleWatcher title_watcher(foo_contents, expected_title);
   EXPECT_TRUE(ExecuteScriptAndExtractBool(
       foo_contents,
@@ -1215,7 +1215,7 @@
   // 2) Post a message containing a MessagePort from opener to the the foo
   // window. The foo window will reply via the passed port, causing the opener
   // to update its own title.
-  base::string16 expected_title = ASCIIToUTF16("msg-back-via-port");
+  std::u16string expected_title = ASCIIToUTF16("msg-back-via-port");
   TitleWatcher title_observer(opener_contents, expected_title);
   EXPECT_TRUE(ExecuteScriptAndExtractBool(
       opener_contents,
@@ -1445,7 +1445,7 @@
       shell()->web_contents()->GetController().GetLastCommittedEntry());
 
   // Renderer-initiated navigations should work.
-  base::string16 expected_title = ASCIIToUTF16("Title Of Awesomeness");
+  std::u16string expected_title = ASCIIToUTF16("Title Of Awesomeness");
   TitleWatcher title_watcher(shell()->web_contents(), expected_title);
   GURL url = embedded_test_server()->GetURL("/title2.html");
   EXPECT_TRUE(ExecuteScript(
@@ -1555,7 +1555,7 @@
   // Now get another reference to the window object, but don't otherwise access
   // it. This is to ensure that DidAccessInitialDocument() notifications are not
   // incorrectly generated when nothing is modified.
-  base::string16 expected_title = ASCIIToUTF16("Modified Title");
+  std::u16string expected_title = ASCIIToUTF16("Modified Title");
   TitleWatcher title_watcher(orig_contents, expected_title);
   ExecuteScript(orig_contents, "getNewWindowReference();");
   ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1610,7 +1610,7 @@
 
   // Now modify the contents of the new window from the opener.  This will also
   // modify the title of the document to give us something to listen for.
-  base::string16 expected_title = ASCIIToUTF16("Modified Title");
+  std::u16string expected_title = ASCIIToUTF16("Modified Title");
   TitleWatcher title_watcher(orig_contents, expected_title);
   ExecuteScript(orig_contents, "modifyNewWindow();");
   ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1668,7 +1668,7 @@
 
   // Now modify the contents of the new window from the opener.  This will also
   // modify the title of the document to give us something to listen for.
-  base::string16 expected_title = ASCIIToUTF16("Modified Title");
+  std::u16string expected_title = ASCIIToUTF16("Modified Title");
   TitleWatcher title_watcher(orig_contents, expected_title);
   ExecuteScript(orig_contents, "modifyNewWindow();");
   ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1719,7 +1719,7 @@
 
   // Now modify the contents of the new window from the opener.  This will also
   // modify the title of the document to give us something to listen for.
-  base::string16 expected_title = ASCIIToUTF16("Modified Title");
+  std::u16string expected_title = ASCIIToUTF16("Modified Title");
   TitleWatcher title_watcher(orig_contents, expected_title);
   ExecuteScript(orig_contents, "modifyNewWindowWithDocumentOpen();");
   ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -2436,7 +2436,7 @@
   EXPECT_TRUE(NavigateToURL(shell(), view_source_url));
 
   // Check that javascript: URLs work.
-  base::string16 expected_title = ASCIIToUTF16("msg");
+  std::u16string expected_title = ASCIIToUTF16("msg");
   TitleWatcher title_watcher(shell()->web_contents(), expected_title);
   shell()->LoadURL(GURL("javascript:document.title='msg'"));
   ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -3232,7 +3232,7 @@
 
   // Check that foo's opener was updated in foo's process. Send a postMessage
   // to the opener and check that the right window (bar_shell) receives it.
-  base::string16 expected_title = ASCIIToUTF16("opener-msg");
+  std::u16string expected_title = ASCIIToUTF16("opener-msg");
   TitleWatcher title_watcher(bar_shell->web_contents(), expected_title);
   success = false;
   EXPECT_TRUE(ExecuteScriptAndExtractBool(
@@ -3733,7 +3733,7 @@
                             "window.onunload=function(e){"
                             "history.pushState({}, 'foo', 'foo');"
                             "document.title='foo'; };\n"));
-  base::string16 title = web_contents->GetTitle();
+  std::u16string title = web_contents->GetTitle();
   NavigationEntryImpl* entry = web_contents->GetController().GetEntryAtIndex(0);
 
   // Navigate the first tab to a different site and wait for the old process to
diff --git a/content/browser/renderer_host/render_frame_host_manager_unittest.cc b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
index 00b20f9..77fef86 100644
--- a/content/browser/renderer_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
@@ -889,7 +889,7 @@
   const GURL kUrl1("http://www.google.com/");
   NavigationEntryImpl entry1(
       nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host = NavigateToEntry(manager, &entry1);
 
@@ -914,7 +914,7 @@
   NavigationEntryImpl entry2(
       nullptr /* instance */, kUrl2,
       Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault),
-      kInitiatorOrigin, base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      kInitiatorOrigin, std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host = NavigateToEntry(manager, &entry2);
 
@@ -937,7 +937,7 @@
   NavigationEntryImpl entry3(
       nullptr /* instance */, kUrl3,
       Referrer(kUrl2, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host = NavigateToEntry(manager, &entry3);
 
@@ -980,7 +980,7 @@
   const GURL kUrl(GetWebUIURL("foo"));
   NavigationEntryImpl entry(
       nullptr /* instance */, kUrl, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host = NavigateToEntry(manager, &entry);
 
@@ -1031,7 +1031,7 @@
   const GURL kUrl1(GetWebUIURL("foo"));
   NavigationEntryImpl entry1(
       nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host1 = NavigateToEntry(manager1, &entry1);
 
@@ -1063,7 +1063,7 @@
       url::Origin::Create(GURL("https://initiator.example.com"));
   NavigationEntryImpl entry2(
       nullptr /* instance */, kUrl2, Referrer(), kInitiatorOrigin,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host2 = NavigateToEntry(manager2, &entry2);
 
@@ -1438,7 +1438,7 @@
   const GURL kUrl1("http://www.google.com/");
   NavigationEntryImpl entry1(
       nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host = NavigateToEntry(manager, &entry1);
 
@@ -1462,7 +1462,7 @@
   NavigationEntryImpl entry2(
       nullptr /* instance */, kUrl2,
       Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault),
-      kInitiatorOrigin, base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      kInitiatorOrigin, std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host = NavigateToEntry(manager, &entry2);
 
@@ -1514,7 +1514,7 @@
   const GURL kUrl1("http://www.google.com/");
   NavigationEntryImpl entry1(
       nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host = NavigateToEntry(manager, &entry1);
 
@@ -1537,7 +1537,7 @@
   const GURL kUrl2("http://www.example.com");
   NavigationEntryImpl entry2(
       nullptr /* instance */, kUrl2, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host2 = NavigateToEntry(manager, &entry2);
 
@@ -1838,7 +1838,7 @@
   // 1) The first navigation.
   NavigationEntryImpl entryA(
       nullptr /* instance */, kUrlA, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* host1 = NavigateToEntry(iframe1, &entryA);
 
@@ -1857,7 +1857,7 @@
   NavigationEntryImpl entryB(
       nullptr /* instance */, kUrlB,
       Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   host1 = NavigateToEntry(iframe1, &entryB);
   RenderFrameHostImpl* host2 = NavigateToEntry(iframe2, &entryB);
@@ -1992,7 +1992,7 @@
   NavigationEntryImpl entry(
       nullptr /* instance */, kUrl2,
       Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, &entry);
   DidNavigateFrame(iframe, cross_site);
@@ -2047,7 +2047,7 @@
   const GURL kWebUIUrl(GetWebUIURL("foo"));
   NavigationEntryImpl webui_entry(
       nullptr /* instance */, kWebUIUrl, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostManager* main_rfhm = contents()->GetRenderManagerForTesting();
   RenderFrameHostImpl* webui_rfh = NavigateToEntry(main_rfhm, &webui_entry);
@@ -2059,7 +2059,7 @@
   const GURL kSubframeUrl("http://bar.com");
   NavigationEntryImpl subframe_entry(
       nullptr /* instance */, kSubframeUrl, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   RenderFrameHostImpl* bar_rfh =
       NavigateToEntry(subframe_rfhm, &subframe_entry);
@@ -2399,7 +2399,7 @@
   NavigationEntryImpl entryB(
       nullptr /* instance */, kUrlB,
       Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   TestRenderFrameHost* host1 =
       static_cast<TestRenderFrameHost*>(NavigateToEntry(child1, &entryB));
@@ -2422,7 +2422,7 @@
   NavigationEntryImpl entryC(
       nullptr /* instance */, kUrlC,
       Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   TestRenderFrameHost* host3 =
       static_cast<TestRenderFrameHost*>(NavigateToEntry(child3, &entryC));
@@ -2505,7 +2505,7 @@
   NavigationEntryImpl entryB(
       nullptr /* instance */, kUrlB,
       Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   TestRenderFrameHost* hostB =
       static_cast<TestRenderFrameHost*>(NavigateToEntry(child, &entryB));
@@ -2521,7 +2521,7 @@
   NavigationEntryImpl entryC(
       nullptr /* instance */, kUrlC,
       Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   TestRenderFrameHost* hostC =
       static_cast<TestRenderFrameHost*>(NavigateToEntry(child, &entryC));
@@ -2575,7 +2575,7 @@
   // Navigation request to an entry from a previous browsing session.
   NavigationEntryImpl entry(
       nullptr /* instance */, kInitUrl, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_RELOAD,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_RELOAD,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   entry.set_restore_type(RestoreType::kRestored);
   NavigateToEntry(manager, &entry);
@@ -2869,7 +2869,7 @@
   const GURL kUrl(GetWebUIURL("foo"));
   NavigationEntryImpl entry(
       nullptr /* instance */, kUrl, Referrer(), base::nullopt,
-      base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+      std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
       false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
   FrameNavigationEntry* frame_entry = entry.root_node()->frame_entry.get();
   FrameTreeNode* frame_tree_node =
diff --git a/content/browser/renderer_host/render_frame_proxy_host.cc b/content/browser/renderer_host/render_frame_proxy_host.cc
index f282baa..1df6108 100644
--- a/content/browser/renderer_host/render_frame_proxy_host.cc
+++ b/content/browser/renderer_host/render_frame_proxy_host.cc
@@ -520,8 +520,8 @@
 
 void RenderFrameProxyHost::RouteMessageEvent(
     const base::Optional<blink::LocalFrameToken>& source_frame_token,
-    const base::string16& source_origin,
-    const base::string16& target_origin,
+    const std::u16string& source_origin,
+    const std::u16string& target_origin,
     blink::TransferableMessage message) {
   RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host();
   if (!target_rfh->IsRenderFrameLive()) {
diff --git a/content/browser/renderer_host/render_frame_proxy_host.h b/content/browser/renderer_host/render_frame_proxy_host.h
index c6f75257..65979fc9 100644
--- a/content/browser/renderer_host/render_frame_proxy_host.h
+++ b/content/browser/renderer_host/render_frame_proxy_host.h
@@ -178,8 +178,8 @@
                     const blink::LocalFrameToken& source_frame_token) override;
   void RouteMessageEvent(
       const base::Optional<blink::LocalFrameToken>& source_frame_token,
-      const base::string16& source_origin,
-      const base::string16& target_origin,
+      const std::u16string& source_origin,
+      const std::u16string& target_origin,
       blink::TransferableMessage message) override;
   void PrintCrossProcessSubframe(const gfx::Rect& rect,
                                  int document_cookie) override;
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc
index bb8e318..783aaf3 100644
--- a/content/browser/renderer_host/render_process_host_browsertest.cc
+++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -1209,8 +1209,8 @@
       base::MakeRefCounted<DelayedHttpResponseWithResolver::Resolver>();
   embedded_test_server()->RegisterRequestHandler(
       base::BindRepeating(HandleHungBeaconWithResolver, resolver));
-  const base::string16 title = base::ASCIIToUTF16("Resolved");
-  const base::string16 waiting = base::ASCIIToUTF16("Waiting");
+  const std::u16string title = base::ASCIIToUTF16("Resolved");
+  const std::u16string waiting = base::ASCIIToUTF16("Waiting");
 
   ASSERT_TRUE(embedded_test_server()->Start());
   EXPECT_TRUE(NavigateToURL(
@@ -1235,7 +1235,7 @@
   embedded_test_server()->RegisterRequestHandler(
       base::BindRepeating(HandleHungBeacon, base::RepeatingClosure()));
   ASSERT_TRUE(embedded_test_server()->Start());
-  const base::string16 title = base::ASCIIToUTF16("Rejected");
+  const std::u16string title = base::ASCIIToUTF16("Rejected");
 
   TitleWatcher watcher(shell()->web_contents(), title);
 
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 517ee0e4..a0dc55dc 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -135,7 +135,7 @@
 #if defined(OS_WIN)
 // Fetches the name and font size of a particular Windows system font.
 void GetFontInfo(gfx::win::SystemFont system_font,
-                 base::string16* name,
+                 std::u16string* name,
                  int32_t* size) {
   const gfx::Font& font = gfx::win::GetSystemFont(system_font);
   *name = base::UTF8ToUTF16(font.GetFontName());
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index c8d56e9..eeef190 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -126,7 +126,7 @@
   DropData drop_data;
   // If `html` is not populated, `html_base_url` won't be populated when
   // converting to `DragData` with `DropDataToDragData`.
-  drop_data.html = base::string16();
+  drop_data.html = std::u16string();
 
   GURL blocked_url = GURL(kBlockedURL);
   GURL file_url = GURL("file:///home/user/secrets.txt");
diff --git a/content/browser/renderer_host/render_widget_host_browsertest.cc b/content/browser/renderer_host/render_widget_host_browsertest.cc
index cdcdf57..7573d08 100644
--- a/content/browser/renderer_host/render_widget_host_browsertest.cc
+++ b/content/browser/renderer_host/render_widget_host_browsertest.cc
@@ -631,7 +631,7 @@
     }
     // Ensure the renderer didn't explode :).
     {
-      base::string16 title_when_done[] = {base::UTF8ToUTF16("done 0"),
+      std::u16string title_when_done[] = {base::UTF8ToUTF16("done 0"),
                                           base::UTF8ToUTF16("done 1")};
       TitleWatcher title_watcher(shell()->web_contents(), title_when_done[i]);
       EXPECT_TRUE(ExecuteScript(root_frame_host,
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index e3fe7f3..4a60eef 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -136,7 +136,7 @@
   // Send OS Cut/Copy/Paste actions to the focused frame.
   virtual void ExecuteEditCommand(
       const std::string& command,
-      const base::Optional<base::string16>& value) = 0;
+      const base::Optional<std::u16string>& value) = 0;
   virtual void Undo() = 0;
   virtual void Redo() = 0;
   virtual void Cut() = 0;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index ee6cb14..20c2816 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -267,14 +267,14 @@
   void CursorVisibilityChanged(bool visible) override {
     DLOG(WARNING) << "Input request on unbound interface";
   }
-  void ImeSetComposition(const base::string16& text,
+  void ImeSetComposition(const std::u16string& text,
                          const std::vector<ui::ImeTextSpan>& ime_text_spans,
                          const gfx::Range& range,
                          int32_t start,
                          int32_t end) override {
     DLOG(WARNING) << "Input request on unbound interface";
   }
-  void ImeCommitText(const base::string16& text,
+  void ImeCommitText(const std::u16string& text,
                      const std::vector<ui::ImeTextSpan>& ime_text_spans,
                      const gfx::Range& range,
                      int32_t relative_cursor_position,
@@ -2014,7 +2014,7 @@
   RequestForceRedraw(snapshot_id);
 }
 
-void RenderWidgetHostImpl::SelectionChanged(const base::string16& text,
+void RenderWidgetHostImpl::SelectionChanged(const std::u16string& text,
                                             uint32_t offset,
                                             const gfx::Range& range) {
   if (view_)
@@ -2109,7 +2109,7 @@
 }
 
 void RenderWidgetHostImpl::ImeSetComposition(
-    const base::string16& text,
+    const std::u16string& text,
     const std::vector<ui::ImeTextSpan>& ime_text_spans,
     const gfx::Range& replacement_range,
     int selection_start,
@@ -2124,7 +2124,7 @@
 }
 
 void RenderWidgetHostImpl::ImeCommitText(
-    const base::string16& text,
+    const std::u16string& text,
     const std::vector<ui::ImeTextSpan>& ime_text_spans,
     const gfx::Range& replacement_range,
     int relative_cursor_pos) {
@@ -2148,7 +2148,7 @@
 }
 
 void RenderWidgetHostImpl::ImeCancelComposition() {
-  GetWidgetInputHandler()->ImeSetComposition(base::string16(),
+  GetWidgetInputHandler()->ImeSetComposition(std::u16string(),
                                              std::vector<ui::ImeTextSpan>(),
                                              gfx::Range::InvalidRange(), 0, 0);
 }
@@ -2349,7 +2349,7 @@
 }
 
 void RenderWidgetHostImpl::SetToolTipText(
-    const base::string16& tooltip_text,
+    const std::u16string& tooltip_text,
     base::i18n::TextDirection text_direction_hint) {
   if (!GetView())
     return;
@@ -2367,7 +2367,7 @@
   // trying to detect the directionality from the tooltip text rather than the
   // element direction.  One could argue that would be a preferable solution
   // but we use the current approach to match Fx & IE's behavior.
-  base::string16 wrapped_tooltip_text = tooltip_text;
+  std::u16string wrapped_tooltip_text = tooltip_text;
   if (!tooltip_text.empty()) {
     if (text_direction_hint == base::i18n::LEFT_TO_RIGHT) {
       // Force the tooltip to have LTR directionality.
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 25b10d1d..36994e35 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -288,7 +288,7 @@
                            const ChildProcessTerminationInfo& info) override;
 
   // blink::mojom::WidgetHost implementation.
-  void SetToolTipText(const base::string16& tooltip_text,
+  void SetToolTipText(const std::u16string& tooltip_text,
                       base::i18n::TextDirection text_direction_hint) override;
   void TextInputStateChanged(ui::mojom::TextInputStatePtr state) override;
   void SelectionBoundsChanged(const gfx::Rect& anchor_rect,
@@ -542,7 +542,7 @@
   //   (on Windows);
   // * when it receives a "preedit_changed" signal of GtkIMContext (on Linux);
   // * when markedText of NSTextInput is called (on Mac).
-  void ImeSetComposition(const base::string16& text,
+  void ImeSetComposition(const std::u16string& text,
                          const std::vector<ui::ImeTextSpan>& ime_text_spans,
                          const gfx::Range& replacement_range,
                          int selection_start,
@@ -555,7 +555,7 @@
   //   (on Windows);
   // * when it receives a "commit" signal of GtkIMContext (on Linux);
   // * when insertText of NSTextInput is called (on Mac).
-  void ImeCommitText(const base::string16& text,
+  void ImeCommitText(const std::u16string& text,
                      const std::vector<ui::ImeTextSpan>& ime_text_spans,
                      const gfx::Range& replacement_range,
                      int relative_cursor_pos);
@@ -676,7 +676,7 @@
   void RendererExited();
 
   // Called from a RenderFrameHost when the text selection has changed.
-  void SelectionChanged(const base::string16& text,
+  void SelectionChanged(const std::u16string& text,
                         uint32_t offset,
                         const gfx::Range& range);
 
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index fa03518..4942f85 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -310,9 +310,9 @@
  public:
   MOCK_METHOD1(OnInputEvent, void(const blink::WebInputEvent&));
 #if defined(OS_ANDROID)
-  MOCK_METHOD1(OnImeTextCommittedEvent, void(const base::string16& text_str));
+  MOCK_METHOD1(OnImeTextCommittedEvent, void(const std::u16string& text_str));
   MOCK_METHOD1(OnImeSetComposingTextEvent,
-               void(const base::string16& text_str));
+               void(const std::u16string& text_str));
   MOCK_METHOD0(OnImeFinishComposingTextEvent, void());
 #endif
 };
@@ -445,7 +445,7 @@
 
   void ExecuteEditCommand(
       const std::string& command,
-      const base::Optional<base::string16>& value) override {}
+      const base::Optional<std::u16string>& value) override {}
 
   void Undo() override {}
   void Redo() override {}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index e92cfe0..f970514 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1063,7 +1063,7 @@
 }
 
 void RenderWidgetHostViewAndroid::SetTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   // Tooltips don't makes sense on Android.
 }
 
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 7c61325..b580c46 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -126,7 +126,7 @@
                           const gfx::Rect& node_bounds_in_screen) override;
   void RenderProcessGone() override;
   void Destroy() override;
-  void SetTooltipText(const base::string16& tooltip_text) override;
+  void SetTooltipText(const std::u16string& tooltip_text) override;
   void TransformPointToRootSurface(gfx::PointF* point) override;
   gfx::Rect GetBoundsInRootWindow() override;
   void ProcessAckedTouchEvent(
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 351e15a..5cf2e4ec 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -758,12 +758,12 @@
 }
 
 void RenderWidgetHostViewAura::SetTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   GetCursorManager()->SetTooltipTextForView(this, tooltip_text);
 }
 
 void RenderWidgetHostViewAura::DisplayTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   tooltip_ = tooltip_text;
   aura::Window* root_window = window_->GetRootWindow();
   wm::TooltipClient* tooltip_client = wm::GetTooltipClient(root_window);
@@ -1155,7 +1155,7 @@
 }
 
 void RenderWidgetHostViewAura::InsertText(
-    const base::string16& text,
+    const std::u16string& text,
     InsertTextCursorBehavior cursor_behavior) {
   DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE);
 
@@ -1359,9 +1359,8 @@
   return false;
 }
 
-bool RenderWidgetHostViewAura::GetTextFromRange(
-    const gfx::Range& range,
-    base::string16* text) const {
+bool RenderWidgetHostViewAura::GetTextFromRange(const gfx::Range& range,
+                                                std::u16string* text) const {
   if (!text_input_manager_ || !GetFocusedWidget())
     return false;
 
@@ -1569,7 +1568,7 @@
 
 void RenderWidgetHostViewAura::SetActiveCompositionForAccessibility(
     const gfx::Range& range,
-    const base::string16& active_composition_text,
+    const std::u16string& active_composition_text,
     bool is_composition_committed) {
   BrowserAccessibilityManager* manager =
       host()->GetRootBrowserAccessibilityManager();
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index c7cde56a..c41cc40 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -129,8 +129,8 @@
   void RenderProcessGone() override;
   void ShowWithVisibility(Visibility web_contents_visibility) override;
   void Destroy() override;
-  void SetTooltipText(const base::string16& tooltip_text) override;
-  void DisplayTooltipText(const base::string16& tooltip_text) override;
+  void SetTooltipText(const std::u16string& tooltip_text) override;
+  void DisplayTooltipText(const std::u16string& tooltip_text) override;
   uint32_t GetCaptureSequenceNumber() const override;
   bool IsSurfaceAvailableForCopy() override;
   void CopyFromSurface(
@@ -197,7 +197,7 @@
   void SetCompositionText(const ui::CompositionText& composition) override;
   uint32_t ConfirmCompositionText(bool keep_selection) override;
   void ClearCompositionText() override;
-  void InsertText(const base::string16& text,
+  void InsertText(const std::u16string& text,
                   InsertTextCursorBehavior cursor_behavior) override;
   void InsertChar(const ui::KeyEvent& event) override;
   ui::TextInputType GetTextInputType() const override;
@@ -216,7 +216,7 @@
   bool SetEditableSelectionRange(const gfx::Range& range) override;
   bool DeleteRange(const gfx::Range& range) override;
   bool GetTextFromRange(const gfx::Range& range,
-                        base::string16* text) const override;
+                        std::u16string* text) const override;
   void OnInputMethodChanged() override;
   bool ChangeTextDirectionAndLayoutAlignment(
       base::i18n::TextDirection direction) override;
@@ -252,7 +252,7 @@
   // composition has been committed or not.
   void SetActiveCompositionForAccessibility(
       const gfx::Range& range,
-      const base::string16& active_composition_text,
+      const std::u16string& active_composition_text,
       bool is_composition_committed) override;
 #endif
 
@@ -629,7 +629,7 @@
   bool has_composition_text_;
 
   // Current tooltip text.
-  base::string16 tooltip_;
+  std::u16string tooltip_;
 
   // Whether or not a frame observer has been added.
   bool added_frame_observer_;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 8f25d17e..af318630 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -5367,7 +5367,7 @@
   EXPECT_TRUE(view_->UsesNativeWindowFrame());
 
   // Simulate a tooltip.
-  base::string16 tooltip_text(base::ASCIIToUTF16("The tooltip!"));
+  std::u16string tooltip_text(base::ASCIIToUTF16("The tooltip!"));
   view_->SetTooltipText(tooltip_text);
   EXPECT_FALSE(widget_host_->is_hidden());
   EXPECT_EQ(tooltip_text, view_->tooltip_);
@@ -5375,7 +5375,7 @@
   // Simulate occlusion, which should clear the tooltip.
   view_->WasOccluded();
   EXPECT_TRUE(widget_host_->is_hidden());
-  EXPECT_EQ(base::string16(), view_->tooltip_);
+  EXPECT_EQ(std::u16string(), view_->tooltip_);
 }
 #endif
 
@@ -6049,7 +6049,7 @@
 TEST_F(InputMethodResultAuraTest, FinishComposingText) {
   base::RepeatingClosure ime_call = base::BindRepeating(
       &ui::TextInputClient::InsertText, base::Unretained(text_input_client()),
-      base::string16(),
+      std::u16string(),
       ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
   for (auto index : active_view_sequence_) {
     ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6222,7 +6222,7 @@
 
 // This test is for selected text.
 TEST_F(InputMethodStateAuraTest, GetSelectedText) {
-  base::string16 text = base::ASCIIToUTF16("some text of length 22");
+  std::u16string text = base::ASCIIToUTF16("some text of length 22");
   size_t offset = 0U;
   gfx::Range selection_range(20, 21);
 
@@ -6230,7 +6230,7 @@
     render_widget_host_delegate()->set_focused_widget(
         RenderWidgetHostImpl::From(views_[index]->GetRenderWidgetHost()));
     views_[index]->SelectionChanged(text, offset, selection_range);
-    base::string16 expected_text = text.substr(
+    std::u16string expected_text = text.substr(
         selection_range.GetMin() - offset, selection_range.length());
 
     EXPECT_EQ(expected_text, views_[index]->GetSelectedText());
@@ -6243,7 +6243,7 @@
 
 // This test is for text range.
 TEST_F(InputMethodStateAuraTest, GetTextRange) {
-  const base::string16 text = base::ASCIIToUTF16("some text of length 22");
+  const std::u16string text = base::ASCIIToUTF16("some text of length 22");
 
   for (auto index : active_view_sequence_) {
     ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6305,7 +6305,7 @@
 }
 
 TEST_F(InputMethodStateAuraTest, GetTextFromRange) {
-  const base::string16 text = base::ASCIIToUTF16("some text of length 22");
+  const std::u16string text = base::ASCIIToUTF16("some text of length 22");
 
   for (auto index : active_view_sequence_) {
     ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6316,7 +6316,7 @@
 
     gfx::Range request_range(std::min(index, text.length() - 1),
                              std::min(index + 3, text.length() - 1));
-    base::string16 result;
+    std::u16string result;
     EXPECT_TRUE(text_input_client()->GetTextFromRange(request_range, &result));
     EXPECT_EQ(text.substr(request_range.start(), request_range.length()),
               result);
@@ -6344,11 +6344,11 @@
 
     // Change the selection of the currently focused widget. It suffices to just
     // call the method on the view.
-    base::string16 expected_text = base::ASCIIToUTF16(texts[index]);
+    std::u16string expected_text = base::ASCIIToUTF16(texts[index]);
     views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5));
 
     // Retrieve the selected text from clipboard and verify it is as expected.
-    base::string16 result_text;
+    std::u16string result_text;
     clipboard->ReadText(ui::ClipboardBuffer::kSelection,
                         /* data_dst = */ nullptr, &result_text);
     EXPECT_EQ(expected_text, result_text);
@@ -6505,7 +6505,7 @@
   input_method->SetFocusedTextInputClient(parent_view_);
   input_method->AddObserver(this);
 
-  parent_view_->SelectionChanged(base::string16(), 0, gfx::Range());
+  parent_view_->SelectionChanged(std::u16string(), 0, gfx::Range());
   EXPECT_EQ(parent_view_, text_input_client_);
 
   text_input_client_ = nullptr;
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index da0698c..fd202aa 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -145,7 +145,7 @@
   return this;
 }
 
-void RenderWidgetHostViewBase::SelectionChanged(const base::string16& text,
+void RenderWidgetHostViewBase::SelectionChanged(const std::u16string& text,
                                                 size_t offset,
                                                 const gfx::Range& range) {
   if (GetTextInputManager())
@@ -280,9 +280,9 @@
   return video_capturer;
 }
 
-base::string16 RenderWidgetHostViewBase::GetSelectedText() {
+std::u16string RenderWidgetHostViewBase::GetSelectedText() {
   if (!GetTextInputManager())
-    return base::string16();
+    return std::u16string();
   return GetTextInputManager()->GetTextSelection(this)->selected_text();
 }
 
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index e06a30a..868c5030 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -92,7 +92,7 @@
   void WasUnOccluded() override {}
   void WasOccluded() override {}
   void SetIsInVR(bool is_in_vr) override;
-  base::string16 GetSelectedText() override;
+  std::u16string GetSelectedText() override;
   bool IsMouseLocked() override;
   bool GetIsMouseLockedUnadjustedMovementForTesting() override;
   bool LockKeyboard(base::Optional<base::flat_set<ui::DomCode>> codes) override;
@@ -185,7 +185,7 @@
   virtual RenderWidgetHostViewBase* GetRootView();
 
   // Notifies the View that the renderer text selection has changed.
-  virtual void SelectionChanged(const base::string16& text,
+  virtual void SelectionChanged(const std::u16string& text,
                                 size_t offset,
                                 const gfx::Range& range);
 
@@ -432,10 +432,10 @@
 
   // Tells the View that the tooltip text for the current mouse position over
   // the page has changed.
-  virtual void SetTooltipText(const base::string16& tooltip_text) = 0;
+  virtual void SetTooltipText(const std::u16string& tooltip_text) = 0;
 
   // Displays the requested tooltip on the screen.
-  virtual void DisplayTooltipText(const base::string16& tooltip_text) {}
+  virtual void DisplayTooltipText(const std::u16string& tooltip_text) {}
 
   // Transforms |point| to be in the coordinate space of browser compositor's
   // surface. This is in DIP.
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index aadc80f2..5142d903 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -396,7 +396,7 @@
 }
 
 void RenderWidgetHostViewChildFrame::SetTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   if (!frame_connector_)
     return;
 
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h
index ce88e0d..a92c2fa 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.h
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -101,7 +101,7 @@
   void SetIsLoading(bool is_loading) override;
   void RenderProcessGone() override;
   void Destroy() override;
-  void SetTooltipText(const base::string16& tooltip_text) override;
+  void SetTooltipText(const std::u16string& tooltip_text) override;
   void GestureEventAck(const blink::WebGestureEvent& event,
                        blink::mojom::InputEventResultState ack_result) override;
   // Since the URL of content rendered by this class is not displayed in
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 9997e703..dee1fd0 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -129,8 +129,8 @@
   void SetIsLoading(bool is_loading) override;
   void RenderProcessGone() override;
   void Destroy() override;
-  void SetTooltipText(const base::string16& tooltip_text) override;
-  void DisplayTooltipText(const base::string16& tooltip_text) override;
+  void SetTooltipText(const std::u16string& tooltip_text) override;
+  void DisplayTooltipText(const std::u16string& tooltip_text) override;
   gfx::Size GetRequestedRendererSize() override;
   uint32_t GetCaptureSequenceNumber() const override;
   bool IsSurfaceAvailableForCopy() override;
@@ -359,12 +359,12 @@
       std::unique_ptr<blink::WebCoalescedInputEvent> event) override;
   void SmartMagnify(
       std::unique_ptr<blink::WebCoalescedInputEvent> event) override;
-  void ImeSetComposition(const base::string16& text,
+  void ImeSetComposition(const std::u16string& text,
                          const std::vector<ui::ImeTextSpan>& ime_text_spans,
                          const gfx::Range& replacement_range,
                          int selection_start,
                          int selection_end) override;
-  void ImeCommitText(const base::string16& text,
+  void ImeCommitText(const std::u16string& text,
                      const gfx::Range& replacement_range) override;
   void ImeFinishComposingText() override;
   void ImeCancelCompositionFromCocoa() override;
@@ -517,7 +517,7 @@
 
   // Gets a textual view of the page's contents, and passes it to the callback
   // provided.
-  using SpeechCallback = base::OnceCallback<void(const base::string16&)>;
+  using SpeechCallback = base::OnceCallback<void(const std::u16string&)>;
   void GetPageTextForSpeech(SpeechCallback callback);
 
   // Interface through which the NSView is to be manipulated. This points either
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 44a682e..dcde5665 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -730,12 +730,12 @@
 }
 
 void RenderWidgetHostViewMac::SetTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   GetCursorManager()->SetTooltipTextForView(this, tooltip_text);
 }
 
 void RenderWidgetHostViewMac::DisplayTooltipText(
-    const base::string16& tooltip_text) {
+    const std::u16string& tooltip_text) {
   ns_view_->SetTooltipText(tooltip_text);
 }
 
@@ -765,7 +765,7 @@
 // and needs to be recursive, and that's crazy difficult to do with a lambda.
 // TODO(avi): Move this to be a lambda when P0839R0 lands in C++.
 void AddTextNodesToVector(const ui::AXNode* node,
-                          std::vector<base::string16>* strings) {
+                          std::vector<std::u16string>* strings) {
   const ui::AXNodeData& node_data = node->data();
 
   if (node_data.role == ax::mojom::Role::kStaticText) {
@@ -780,10 +780,10 @@
     AddTextNodesToVector(child, strings);
 }
 
-using SpeechCallback = base::OnceCallback<void(const base::string16&)>;
+using SpeechCallback = base::OnceCallback<void(const std::u16string&)>;
 void CombineTextNodesAndMakeCallback(SpeechCallback callback,
                                      const ui::AXTreeUpdate& update) {
-  std::vector<base::string16> text_node_contents;
+  std::vector<std::u16string> text_node_contents;
   text_node_contents.reserve(update.nodes.size());
 
   ui::AXTree tree(update);
@@ -1117,7 +1117,7 @@
   ns_view_->SetCursorLocked(true);
 
   // Clear the tooltip window.
-  ns_view_->SetTooltipText(base::string16());
+  ns_view_->SetTooltipText(std::u16string());
 
   return blink::mojom::PointerLockResult::kSuccess;
 }
@@ -1611,7 +1611,7 @@
     host()->ForwardMouseEvent(web_event);
 
   if (web_event.GetType() == WebInputEvent::Type::kMouseLeave)
-    ns_view_->SetTooltipText(base::string16());
+    ns_view_->SetTooltipText(std::u16string());
 }
 
 void RenderWidgetHostViewMac::ForwardWheelEvent(
@@ -1683,7 +1683,7 @@
 }
 
 void RenderWidgetHostViewMac::ImeSetComposition(
-    const base::string16& text,
+    const std::u16string& text,
     const std::vector<ui::ImeTextSpan>& ime_text_spans,
     const gfx::Range& replacement_range,
     int selection_start,
@@ -1695,7 +1695,7 @@
 }
 
 void RenderWidgetHostViewMac::ImeCommitText(
-    const base::string16& text,
+    const std::u16string& text,
     const gfx::Range& replacement_range) {
   if (auto* widget_host = GetWidgetForIme()) {
     widget_host->ImeCommitText(text, std::vector<ui::ImeTextSpan>(),
@@ -2082,7 +2082,7 @@
     // selected.
     // https://crbug.com/830906
     if (auto* selection = GetTextSelection()) {
-      const base::string16& selected_text = selection->selected_text();
+      const std::u16string& selected_text = selection->selected_text();
       NSString* ns_selected_text = base::SysUTF16ToNSString(selected_text);
       if ([ns_selected_text length] == 0)
         return;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm b/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
index c6913619..fb7eeb52 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
@@ -75,15 +75,15 @@
 
   void Wait() { run_loop_.Run(); }
 
-  const base::string16& text() const { return text_; }
+  const std::u16string& text() const { return text_; }
 
-  void GetText(const base::string16& text) {
+  void GetText(const std::u16string& text) {
     text_ = text;
     run_loop_.Quit();
   }
 
  private:
-  base::string16 text_;
+  std::u16string text_;
   base::RunLoop run_loop_;
 
   DISALLOW_COPY_AND_ASSIGN(TextCallbackWaiter);
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index fbf0507..f1fb41b3 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -88,7 +88,7 @@
  private:
   void ExecuteEditCommand(
       const std::string& command,
-      const base::Optional<base::string16>& value) override {
+      const base::Optional<std::u16string>& value) override {
     edit_command_message_count_++;
   }
   void Undo() override {}
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index f0e82049..650aa00 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -649,7 +649,7 @@
 }
 
 TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) {
-  const base::string16 kDummyString = base::UTF8ToUTF16("hogehoge");
+  const std::u16string kDummyString = base::UTF8ToUTF16("hogehoge");
   const size_t kDummyOffset = 0;
 
   gfx::Rect caret_rect(10, 11, 0, 10);
@@ -1714,7 +1714,7 @@
 // This test verifies that |selected_text_| is updated accordingly with
 // different variations of RWHVMac::SelectChanged updates.
 TEST_F(RenderWidgetHostViewMacTest, SelectedText) {
-  base::string16 sample_text;
+  std::u16string sample_text;
   base::UTF8ToUTF16("hello world!", 12, &sample_text);
   gfx::Range range(6, 11);
 
@@ -2092,7 +2092,7 @@
         [FakeTextCheckingResult resultWithRange:NSMakeRange(0, 3)
                               replacementString:@"foo"];
 
-    const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+    const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
 
     // Change the selection once; requests completions from the spell checker.
     tab_view()->SelectionChanged(kOriginalString, 3, gfx::Range(3, 3));
@@ -2148,7 +2148,7 @@
     EXPECT_NSNE(nil, candidate_list_item());
     candidate_list_item().allowsCollapsing = NO;
 
-    const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+    const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
 
     // Change the selection once; completions should *not* be requested.
     tab_view()->SelectionChanged(kOriginalString, 3, gfx::Range(3, 3));
@@ -2180,7 +2180,7 @@
         [FakeTextCheckingResult resultWithRange:NSMakeRange(0, 3)
                               replacementString:@"foo"];
 
-    const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+    const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
 
     tab_view()->SelectionChanged(kOriginalString, 3,
                                  gfx::Range::InvalidRange());
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
index 26bc56f..e593ab5a 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -282,7 +282,7 @@
 }
 
 void TextInputManager::SelectionChanged(RenderWidgetHostViewBase* view,
-                                        const base::string16& text,
+                                        const std::u16string& text,
                                         size_t offset,
                                         const gfx::Range& range) {
   DCHECK(IsRegistered(view));
@@ -373,7 +373,7 @@
 
 TextInputManager::TextSelection::~TextSelection() {}
 
-void TextInputManager::TextSelection::SetSelection(const base::string16& text,
+void TextInputManager::TextSelection::SetSelection(const std::u16string& text,
                                                    size_t offset,
                                                    const gfx::Range& range) {
   text_ = text;
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h
index 11949b3..c3de53c 100644
--- a/content/browser/renderer_host/text_input_manager.h
+++ b/content/browser/renderer_host/text_input_manager.h
@@ -103,14 +103,14 @@
     TextSelection(const TextSelection& other);
     ~TextSelection();
 
-    void SetSelection(const base::string16& text,
+    void SetSelection(const std::u16string& text,
                       size_t offset,
                       const gfx::Range& range);
 
-    const base::string16& selected_text() const { return selected_text_; }
+    const std::u16string& selected_text() const { return selected_text_; }
     size_t offset() const { return offset_; }
     const gfx::Range& range() const { return range_; }
-    const base::string16& text() const { return text_; }
+    const std::u16string& text() const { return text_; }
 
    private:
     // The offset of the text stored in |text| relative to the start of the web
@@ -124,11 +124,11 @@
     // and |range_|. It will be an empty string if either |text_| or |range_|
     // are empty of this selection information is invalid (i.e., |range_| does
     // not cover any of |text_|.
-    base::string16 selected_text_;
+    std::u16string selected_text_;
 
     // Part of the text on the page which includes the highlighted text plus
     // possibly several characters before and after it.
-    base::string16 text_;
+    std::u16string text_;
   };
 
   explicit TextInputManager(bool should_do_learning);
@@ -204,7 +204,7 @@
 
   // Updates the new text selection information for the |view|.
   void SelectionChanged(RenderWidgetHostViewBase* view,
-                        const base::string16& text,
+                        const std::u16string& text,
                         size_t offset,
                         const gfx::Range& range);