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

Side by Side Diff: content/public/browser/web_contents_observer.h

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: Removed what was added in https://codereview.chromium.org/239393009 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include "base/process/kill.h" 8 #include "base/process/kill.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // it's used for anything in case there's an exploited renderer. 286 // it's used for anything in case there's an exploited renderer.
287 virtual void PluginHungStatusChanged(int plugin_child_id, 287 virtual void PluginHungStatusChanged(int plugin_child_id,
288 const base::FilePath& plugin_path, 288 const base::FilePath& plugin_path,
289 bool is_hung) {} 289 bool is_hung) {}
290 290
291 // Invoked when WebContents::Clone() was used to clone a WebContents. 291 // Invoked when WebContents::Clone() was used to clone a WebContents.
292 virtual void DidCloneToNewWebContents(WebContents* old_web_contents, 292 virtual void DidCloneToNewWebContents(WebContents* old_web_contents,
293 WebContents* new_web_contents) {} 293 WebContents* new_web_contents) {}
294 294
295 // Invoked when the WebContents is being destroyed. Gives subclasses a chance 295 // Invoked when the WebContents is being destroyed. Gives subclasses a chance
296 // to cleanup. At the time this is invoked |web_contents()| returns NULL. 296 // to cleanup. After the whole loop over all WebContentsObservers
297 // It is safe to delete 'this' from here. 297 // has been finished, web_contents() returns NULL.
jam 2014/05/05 17:46:46 nit: don't indent before hitting 80 chars
zverre 2014/05/06 09:37:26 Done.
298 virtual void WebContentsDestroyed(WebContents* web_contents) {} 298 virtual void WebContentsDestroyed() {}
299 299
300 // Called when the user agent override for a WebContents has been changed. 300 // Called when the user agent override for a WebContents has been changed.
301 virtual void UserAgentOverrideSet(const std::string& user_agent) {} 301 virtual void UserAgentOverrideSet(const std::string& user_agent) {}
302 302
303 // Invoked when new FaviconURL candidates are received from the renderer. 303 // Invoked when new FaviconURL candidates are received from the renderer.
304 virtual void DidUpdateFaviconURL(int32 page_id, 304 virtual void DidUpdateFaviconURL(int32 page_id,
305 const std::vector<FaviconURL>& candidates) {} 305 const std::vector<FaviconURL>& candidates) {}
306 306
307 // Invoked when a pepper plugin creates and shows or destroys a fullscreen 307 // Invoked when a pepper plugin creates and shows or destroys a fullscreen
308 // render widget. 308 // render widget.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 virtual ~WebContentsObserver(); 352 virtual ~WebContentsObserver();
353 353
354 // Start observing a different WebContents; used with the default constructor. 354 // Start observing a different WebContents; used with the default constructor.
355 void Observe(WebContents* web_contents); 355 void Observe(WebContents* web_contents);
356 356
357 WebContents* web_contents() const; 357 WebContents* web_contents() const;
358 358
359 private: 359 private:
360 friend class WebContentsImpl; 360 friend class WebContentsImpl;
361 361
362 // Invoked from WebContentsImpl. Invokes WebContentsDestroyed and NULL out 362 // Resets |web_contents_| pointer to NULL as a final step in the process
363 // |web_contents_|. 363 // of destroying the WebContents. See comments near WebContentsDestroyed.
jam 2014/05/05 17:46:46 no need to comment a simple setter, remove this wh
zverre 2014/05/06 09:37:26 Done.
364 void WebContentsImplDestroyed(); 364 void reset_web_contents() { web_contents_ = NULL; }
365 365
366 WebContentsImpl* web_contents_; 366 WebContentsImpl* web_contents_;
367 367
368 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); 368 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver);
369 }; 369 };
370 370
371 } // namespace content 371 } // namespace content
372 372
373 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ 373 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698