From 6b49e23312486e6989e0ded3a89698505955cf81 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 27 Oct 2014 16:42:54 +0800 Subject: [PATCH] Fix leaking WebContents from devtools. --- brightray/browser/inspectable_web_contents_impl.cc | 11 +++++++++++ brightray/browser/inspectable_web_contents_impl.h | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index b2af61d8f108..f05e1ac8a8a0 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -355,6 +355,17 @@ bool InspectableWebContentsImpl::AddMessageToConsole( return true; } +bool InspectableWebContentsImpl::ShouldCreateWebContents( + content::WebContents* web_contents, + int route_id, + WindowContainerType window_container_type, + const base::string16& frame_name, + const GURL& target_url, + const std::string& partition_id, + content::SessionStorageNamespace* session_storage_namespace) { + return false; +} + void InspectableWebContentsImpl::HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) { diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 989abb340f82..db24bc95daf9 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -113,6 +113,14 @@ class InspectableWebContentsImpl : const base::string16& message, int32 line_no, const base::string16& source_id) override; + bool ShouldCreateWebContents( + content::WebContents* web_contents, + int route_id, + WindowContainerType window_container_type, + const base::string16& frame_name, + const GURL& target_url, + const std::string& partition_id, + content::SessionStorageNamespace* session_storage_namespace) override; void HandleKeyboardEvent( content::WebContents*, const content::NativeWebKeyboardEvent&) override; void CloseContents(content::WebContents* source) override;