Remove Channel ID methods and member from net::CookieStore

Bug: 875053
Change-Id: I1a0efc926bd73875a9f6612ca318648c217a17b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580261
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Nick Harper <nharper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653699}
diff --git a/android_webview/browser/net/aw_cookie_store_wrapper.cc b/android_webview/browser/net/aw_cookie_store_wrapper.cc
index d23bb2b..93d4da1 100644
--- a/android_webview/browser/net/aw_cookie_store_wrapper.cc
+++ b/android_webview/browser/net/aw_cookie_store_wrapper.cc
@@ -197,10 +197,6 @@
                      CreateWrappedCallback<bool>(std::move(callback))));
 }
 
-bool AwCookieStoreWrapper::IsEphemeral() {
-  return GetCookieStore()->IsEphemeral();
-}
-
 base::OnceClosure AwCookieStoreWrapper::CreateWrappedClosureCallback(
     base::OnceClosure callback) {
   if (callback.is_null())
diff --git a/android_webview/browser/net/aw_cookie_store_wrapper.h b/android_webview/browser/net/aw_cookie_store_wrapper.h
index 2ed942b..d0b77e1 100644
--- a/android_webview/browser/net/aw_cookie_store_wrapper.h
+++ b/android_webview/browser/net/aw_cookie_store_wrapper.h
@@ -68,7 +68,6 @@
   net::CookieChangeDispatcher& GetChangeDispatcher() override;
   void SetCookieableSchemes(const std::vector<std::string>& schemes,
                             SetCookieableSchemesCallback callback) override;
-  bool IsEphemeral() override;
 
  private:
   // Used by CreateWrappedCallback below. Takes an argument of Type and posts
diff --git a/ios/components/io_thread/ios_io_thread.h b/ios/components/io_thread/ios_io_thread.h
index 407f564..21eaee7 100644
--- a/ios/components/io_thread/ios_io_thread.h
+++ b/ios/components/io_thread/ios_io_thread.h
@@ -29,7 +29,6 @@
 namespace net {
 class CTPolicyEnforcer;
 class CertVerifier;
-class ChannelIDService;
 class CookieStore;
 class CTVerifier;
 class HostResolver;
@@ -99,8 +98,6 @@
     std::unique_ptr<net::NetworkDelegate> system_network_delegate;
     std::unique_ptr<net::HostResolver> host_resolver;
     std::unique_ptr<net::CertVerifier> cert_verifier;
-    // The ChannelIDService must outlive the HttpTransactionFactory.
-    std::unique_ptr<net::ChannelIDService> system_channel_id_service;
     // This TransportSecurityState doesn't load or save any state. It's only
     // used to enforce pinning for system requests and will only use built-in
     // pins.
diff --git a/ios/components/io_thread/ios_io_thread.mm b/ios/components/io_thread/ios_io_thread.mm
index 6214e2a..42b8ab7 100644
--- a/ios/components/io_thread/ios_io_thread.mm
+++ b/ios/components/io_thread/ios_io_thread.mm
@@ -262,10 +262,6 @@
   globals_->system_cookie_store.reset(
       new net::CookieMonster(nullptr /* store */, nullptr /* netlog */));
   // In-memory channel ID store.
-  globals_->system_channel_id_service.reset(
-      new net::ChannelIDService(new net::DefaultChannelIDStore(nullptr)));
-  globals_->system_cookie_store->SetChannelIDServiceID(
-      globals_->system_channel_id_service->GetUniqueID());
   globals_->http_user_agent_settings.reset(new net::StaticHttpUserAgentSettings(
       std::string(),
       web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE)));
@@ -376,7 +372,6 @@
   context->set_job_factory(globals->system_url_request_job_factory.get());
 
   context->set_cookie_store(globals->system_cookie_store.get());
-  context->set_channel_id_service(globals->system_channel_id_service.get());
   context->set_network_delegate(globals->system_network_delegate.get());
   context->set_http_user_agent_settings(
       globals->http_user_agent_settings.get());
diff --git a/ios/net/cookies/cookie_store_ios.h b/ios/net/cookies/cookie_store_ios.h
index a37c0f4..45139b4a 100644
--- a/ios/net/cookies/cookie_store_ios.h
+++ b/ios/net/cookies/cookie_store_ios.h
@@ -107,7 +107,6 @@
   CookieChangeDispatcher& GetChangeDispatcher() override;
   void SetCookieableSchemes(const std::vector<std::string>& schemes,
                             SetCookieableSchemesCallback callback) override;
-  bool IsEphemeral() override;
 
  protected:
   CookieStoreIOS(net::CookieMonster::PersistentCookieStore* persistent_store,
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm
index 385cfe5..aea8e14 100644
--- a/ios/net/cookies/cookie_store_ios.mm
+++ b/ios/net/cookies/cookie_store_ios.mm
@@ -646,10 +646,6 @@
   std::move(callback).Run(false);
 }
 
-bool CookieStoreIOS::IsEphemeral() {
-  return cookie_monster_->IsEphemeral();
-}
-
 std::unique_ptr<CookieChangeSubscription> CookieStoreIOS::AddCallbackForCookie(
     const GURL& gurl,
     const std::string& name,
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 1241126..459962a 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -533,10 +533,6 @@
   return change_dispatcher_;
 }
 
-bool CookieMonster::IsEphemeral() {
-  return store_.get() == nullptr;
-}
-
 void CookieMonster::DumpMemoryStats(
     base::trace_event::ProcessMemoryDump* pmd,
     const std::string& parent_absolute_name) const {
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 747b378..9b7dbbe 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -190,8 +190,6 @@
   static const char* const kDefaultCookieableSchemes[];
   static const int kDefaultCookieableSchemesCount;
 
-  bool IsEphemeral() override;
-
   void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd,
                        const std::string& parent_absolute_name) const override;
 
diff --git a/net/cookies/cookie_store.cc b/net/cookies/cookie_store.cc
index 64d6a6f..bfe48b1 100644
--- a/net/cookies/cookie_store.cc
+++ b/net/cookies/cookie_store.cc
@@ -31,19 +31,8 @@
   GetCookieListWithOptionsAsync(url, options, std::move(callback));
 }
 
-void CookieStore::SetChannelIDServiceID(int id) {
-  DCHECK_EQ(-1, channel_id_service_id_);
-  channel_id_service_id_ = id;
-}
-
-int CookieStore::GetChannelIDServiceID() {
-  return channel_id_service_id_;
-}
-
 void CookieStore::DumpMemoryStats(
     base::trace_event::ProcessMemoryDump* pmd,
     const std::string& parent_absolute_name) const {}
 
-CookieStore::CookieStore() : channel_id_service_id_(-1) {}
-
 }  // namespace net
diff --git a/net/cookies/cookie_store.h b/net/cookies/cookie_store.h
index c1146a9..d6299f5 100644
--- a/net/cookies/cookie_store.h
+++ b/net/cookies/cookie_store.h
@@ -145,20 +145,9 @@
   virtual void SetCookieableSchemes(const std::vector<std::string>& schemes,
                                     SetCookieableSchemesCallback callback) = 0;
 
-  // Returns true if this cookie store is ephemeral, and false if it is backed
-  // by some sort of persistence layer.
-  // TODO(nharper): Remove this method once crbug.com/548423 has been closed.
-  virtual bool IsEphemeral() = 0;
-  void SetChannelIDServiceID(int id);
-  int GetChannelIDServiceID();
-
   // Reports the estimate of dynamically allocated memory in bytes.
   virtual void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd,
                                const std::string& parent_absolute_name) const;
-
- protected:
-  CookieStore();
-  int channel_id_service_id_;
 };
 
 }  // namespace net
diff --git a/net/cookies/cookie_store_test_helpers.cc b/net/cookies/cookie_store_test_helpers.cc
index d32e57ce..8467a98 100644
--- a/net/cookies/cookie_store_test_helpers.cc
+++ b/net/cookies/cookie_store_test_helpers.cc
@@ -199,10 +199,6 @@
   ADD_FAILURE();
 }
 
-bool DelayedCookieMonster::IsEphemeral() {
-  return true;
-}
-
 //
 // CookieURLHelper
 //
diff --git a/net/cookies/cookie_store_test_helpers.h b/net/cookies/cookie_store_test_helpers.h
index 9feb259..9708821 100644
--- a/net/cookies/cookie_store_test_helpers.h
+++ b/net/cookies/cookie_store_test_helpers.h
@@ -91,8 +91,6 @@
   void SetCookieableSchemes(const std::vector<std::string>& schemes,
                             SetCookieableSchemesCallback callback) override;
 
-  bool IsEphemeral() override;
-
  private:
   // Be called immediately from CookieMonster.