  
    bool ShouldSelectReplacement() const {
 diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
-index 049c8605bc63e52a14a8ac3b00d0e7d2b602c8eb..e9345a71ad6347ec456765f2e713416322bfe136 100644
+index 5be4065214fc8cc976f58c2b85f2441b04745648..e6406090db866a7b5e60cdee4b45381f18e025c2 100644
 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
 +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
 @@ -2509,7 +2509,7 @@ void HTMLMediaElement::setMuted(bool muted) {

   // chrome::mojom::ProfileImport:
   void StartImport(const importer::SourceProfile& source_profile,
                    uint16_t items,
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
index 27570202e8e5cca632e560fe5b22920aeb2c5742..3ac3b8c7b81c095b3b2264ff18431852de060a1b 100644
--- a/components/guest_view/browser/guest_view_base.cc
+++ b/components/guest_view/browser/guest_view_base.cc
@@ -432,8 +432,13 @@ void GuestViewBase::DidDetach() {
   owner_web_contents()->Send(new GuestViewMsg_GuestDetached(
       element_instance_id_));
   element_instance_id_ = kInstanceIDNone;
-  if (!CanRunInDetachedState())
+  if (!CanRunInDetachedState()) {
     Destroy(true);
+  } else {
+    // Give the derived class an opportunity to perform some actions.
+    DidDetachFromEmbedder();
+  }
+
 }
 
 WebContents* GuestViewBase::GetOwnerWebContents() const {
diff --git a/components/guest_view/browser/guest_view_base.h b/components/guest_view/browser/guest_view_base.h
index 67fdaf0e3730700b991f90f9a34b772450990f5c..aa8646551079b8f9d23a48e6f83c42389009cf91 100644
--- a/components/guest_view/browser/guest_view_base.h
+++ b/components/guest_view/browser/guest_view_base.h
@@ -242,6 +242,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,

               ui::TEXT_INPUT_TYPE_NONE &&
           [event type] == NSKeyDown &&
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index effd1bee8a12bccf0407f85180bc2817f3a9efa6..7dc9f3a98de779b1a8ad1b71888e2ce9fdb36bce 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1662,7 +1662,8 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
