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

Side by Side Diff: content/public/renderer/render_frame_observer.h

Issue 2034153002: Makes RenderFrameObserver/RenderViewObserver::OnDestruct pure virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 6 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 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 19 matching lines...) Expand all
30 30
31 class RendererPpapiHost; 31 class RendererPpapiHost;
32 class RenderFrame; 32 class RenderFrame;
33 class RenderFrameImpl; 33 class RenderFrameImpl;
34 34
35 // Base class for objects that want to filter incoming IPCs, and also get 35 // Base class for objects that want to filter incoming IPCs, and also get
36 // notified of changes to the frame. 36 // notified of changes to the frame.
37 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, 37 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
38 public IPC::Sender { 38 public IPC::Sender {
39 public: 39 public:
40 // By default, observers will be deleted when the RenderFrame goes away. If 40 // A subclass can use this to delete itself. If it does not, the subclass must
41 // they want to outlive it, they can override this function. 41 // always null-check each call to render_frame() becase the RenderFrame can
42 virtual void OnDestruct(); 42 // go away at any time.
43 virtual void OnDestruct() = 0;
43 44
44 // Called when a Pepper plugin is created. 45 // Called when a Pepper plugin is created.
45 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} 46 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {}
46 47
47 // Called when a load is explicitly stopped by the user or browser. 48 // Called when a load is explicitly stopped by the user or browser.
48 virtual void OnStop() {} 49 virtual void OnStop() {}
49 50
50 // Called when the RenderFrame visiblity is changed. 51 // Called when the RenderFrame visiblity is changed.
51 virtual void WasHidden() {} 52 virtual void WasHidden() {}
52 virtual void WasShown() {} 53 virtual void WasShown() {}
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 RenderFrame* render_frame_; 145 RenderFrame* render_frame_;
145 // The routing ID of the associated RenderFrame. 146 // The routing ID of the associated RenderFrame.
146 int routing_id_; 147 int routing_id_;
147 148
148 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); 149 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver);
149 }; 150 };
150 151
151 } // namespace content 152 } // namespace content
152 153
153 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ 154 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_
OLDNEW
« no previous file with comments | « components/translate/content/renderer/translate_helper.cc ('k') | content/public/renderer/render_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698