Move WebRequest to the UI thread

Now that network service is launched, there is no reason to have
WebRequest run on the IO thread. This moves all WebRequest code and
the WebRequestProxyingURLLoaderFactory to the UI thread, which
eliminates thread hops. For more info, see the Chrome IO Thread
Simplification: Planning doc:
https://docs.google.com/document/d/1fowGQ8xWBv4YqHj_YbK-S3wpmJQDE7L0-GwNR_vAkHE/edit#

Change-Id: I5ba8954c5d91c98c96a66558ecb659b59ff4386c
Bug: 980774
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1682434
Reviewed-by: Karan Bhatia <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Steven Holte <[email protected]>
Commit-Queue: Clark DuVall <[email protected]>
Cr-Commit-Position: refs/heads/master@{#679227}
diff --git a/extensions/browser/extension_util.cc b/extensions/browser/extension_util.cc
index 3cd9723c..854ea5ae 100644
--- a/extensions/browser/extension_util.cc
+++ b/extensions/browser/extension_util.cc
@@ -50,6 +50,16 @@
   return ExtensionPrefs::Get(context)->IsIncognitoEnabled(extension_id);
 }
 
+bool CanCrossIncognito(const Extension* extension,
+                       content::BrowserContext* context) {
+  // We allow the extension to see events and data from another profile iff it
+  // uses "spanning" behavior and it has incognito access. "split" mode
+  // extensions only see events for a matching profile.
+  CHECK(extension);
+  return IsIncognitoEnabled(extension->id(), context) &&
+         !IncognitoInfo::IsSplitMode(extension);
+}
+
 GURL GetSiteForExtensionId(const std::string& extension_id,
                            content::BrowserContext* context) {
   return content::SiteInstance::GetSiteForURL(