diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index c30c6f1becbd..f196efa0248c 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -159,10 +159,10 @@ void InspectableWebContentsImpl::RegisterPrefs(PrefRegistrySimple* registry) { InspectableWebContentsImpl::InspectableWebContentsImpl( content::WebContents* web_contents) - : web_contents_(web_contents), - frontend_loaded_(false), + : frontend_loaded_(false), can_dock_(true), delegate_(nullptr), + web_contents_(web_contents), weak_factory_(this) { auto context = static_cast(web_contents_->GetBrowserContext()); auto bounds_dict = context->prefs()->GetDictionary(kDevToolsBoundsPref); diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index d9af6cf12304..5df435b15e7b 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -147,10 +147,6 @@ class InspectableWebContentsImpl : void SendMessageAck(int request_id, const base::Value* arg1); - scoped_ptr web_contents_; - scoped_ptr devtools_web_contents_; - scoped_ptr view_; - bool frontend_loaded_; scoped_refptr agent_host_; scoped_ptr frontend_host_; @@ -160,10 +156,14 @@ class InspectableWebContentsImpl : gfx::Rect devtools_bounds_; bool can_dock_; - InspectableWebContentsDelegate* delegate_; // weak references. - using PendingRequestsMap = std::map; PendingRequestsMap pending_requests_; + InspectableWebContentsDelegate* delegate_; // weak references. + + scoped_ptr view_; + scoped_ptr web_contents_; + scoped_ptr devtools_web_contents_; + base::WeakPtrFactory weak_factory_; DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsImpl);