Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/browser/extensions/extension_view_host.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/lkgr Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_view_host.h" 5 #include "chrome/browser/extensions/extension_view_host.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/window_controller.h" 9 #include "chrome/browser/extensions/window_controller.h"
10 #include "chrome/browser/file_select_helper.h" 10 #include "chrome/browser/file_select_helper.h"
(...skipping 25 matching lines...) Expand all
36 // Notifies an ExtensionViewHost when a WebContents is destroyed. 36 // Notifies an ExtensionViewHost when a WebContents is destroyed.
37 class ExtensionViewHost::AssociatedWebContentsObserver 37 class ExtensionViewHost::AssociatedWebContentsObserver
38 : public WebContentsObserver { 38 : public WebContentsObserver {
39 public: 39 public:
40 AssociatedWebContentsObserver(ExtensionViewHost* host, 40 AssociatedWebContentsObserver(ExtensionViewHost* host,
41 WebContents* web_contents) 41 WebContents* web_contents)
42 : WebContentsObserver(web_contents), host_(host) {} 42 : WebContentsObserver(web_contents), host_(host) {}
43 virtual ~AssociatedWebContentsObserver() {} 43 virtual ~AssociatedWebContentsObserver() {}
44 44
45 // content::WebContentsObserver: 45 // content::WebContentsObserver:
46 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { 46 virtual void WebContentsDestroyed() OVERRIDE {
47 // Deleting |this| from here is safe. 47 // Deleting |this| from here is safe.
48 host_->SetAssociatedWebContents(NULL); 48 host_->SetAssociatedWebContents(NULL);
49 } 49 }
50 50
51 private: 51 private:
52 ExtensionViewHost* host_; 52 ExtensionViewHost* host_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver); 54 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver);
55 }; 55 };
56 56
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 void ExtensionViewHost::InsertInfobarCSS() { 338 void ExtensionViewHost::InsertInfobarCSS() {
339 static const base::StringPiece css( 339 static const base::StringPiece css(
340 ResourceBundle::GetSharedInstance().GetRawDataResource( 340 ResourceBundle::GetSharedInstance().GetRawDataResource(
341 IDR_EXTENSIONS_INFOBAR_CSS)); 341 IDR_EXTENSIONS_INFOBAR_CSS));
342 342
343 host_contents()->InsertCSS(css.as_string()); 343 host_contents()->InsertCSS(css.as_string());
344 } 344 }
345 345
346 } // namespace extensions 346 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698