Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_RENDERER_RENDER_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 class RenderViewImpl; | 39 class RenderViewImpl; |
| 40 class RenderWidget; | 40 class RenderWidget; |
| 41 class RenderWidgetFullscreenPepper; | 41 class RenderWidgetFullscreenPepper; |
| 42 | 42 |
| 43 class CONTENT_EXPORT RenderFrameImpl | 43 class CONTENT_EXPORT RenderFrameImpl |
| 44 : public RenderFrame, | 44 : public RenderFrame, |
| 45 NON_EXPORTED_BASE(public blink::WebFrameClient) { | 45 NON_EXPORTED_BASE(public blink::WebFrameClient) { |
| 46 public: | 46 public: |
| 47 // Creates a new RenderFrame. |render_view| is the RenderView object that this | 47 // Creates a new RenderFrame. |render_view| is the RenderView object that this |
| 48 // frame belongs to. | 48 // frame belongs to. |
| 49 // Callers *must* call |SetWebFrame| immediately after creation. | |
| 50 // TODO(creis): We should structure this so that |SetWebFrame| isn't needed. | |
| 49 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); | 51 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); |
| 50 | 52 |
| 53 // For subframes, look up the RenderFrameImpl for the given WebFrame. Returns | |
| 54 // NULL for main frames. | |
| 55 // This only works when using --site-per-process, and returns NULL otherwise. | |
| 56 // TODO(creis): Remove this when the RenderView methods dealing with frames | |
| 57 // have moved to RenderFrame. | |
| 58 static RenderFrameImpl* FindByWebFrame(blink::WebFrame* web_frame); | |
| 59 | |
| 51 // Used by content_layouttest_support to hook into the creation of | 60 // Used by content_layouttest_support to hook into the creation of |
| 52 // RenderFrameImpls. | 61 // RenderFrameImpls. |
| 53 static void InstallCreateHook( | 62 static void InstallCreateHook( |
| 54 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)); | 63 RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)); |
| 55 | 64 |
| 56 virtual ~RenderFrameImpl(); | 65 virtual ~RenderFrameImpl(); |
| 57 | 66 |
| 67 bool is_swapped_out() const { | |
| 68 return is_swapped_out_; | |
| 69 } | |
| 70 | |
| 58 // TODO(jam): this is a temporary getter until all the code is transitioned | 71 // TODO(jam): this is a temporary getter until all the code is transitioned |
| 59 // to using RenderFrame instead of RenderView. | 72 // to using RenderFrame instead of RenderView. |
| 60 RenderViewImpl* render_view() { return render_view_; } | 73 RenderViewImpl* render_view() { return render_view_; } |
| 61 | 74 |
| 62 // Returns the RenderWidget associated with this frame. | 75 // Returns the RenderWidget associated with this frame. |
| 63 RenderWidget* GetRenderWidget(); | 76 RenderWidget* GetRenderWidget(); |
| 64 | 77 |
| 65 // Called by RenderView right after creating this object when the | 78 // Called by RenderView right after creating this object when the |
| 66 // blink::WebFrame has been created. | 79 // blink::WebFrame has been created. |
| 67 void MainWebFrameCreated(blink::WebFrame* frame); | 80 void MainWebFrameCreated(blink::WebFrame* frame); |
| 68 | 81 |
| 82 // In --site-per-process mode, we keep track of which WebFrame this | |
| 83 // RenderFrameImpl is for. | |
| 84 void SetWebFrame(blink::WebFrame* web_frame); | |
|
nasko
2013/12/20 22:59:51
nit: Since this is not in the public interface, it
Charlie Reis
2013/12/21 00:26:42
No, only one-liners that can be inlined should be
| |
| 85 | |
| 69 #if defined(ENABLE_PLUGINS) | 86 #if defined(ENABLE_PLUGINS) |
| 70 // Notification that a PPAPI plugin has been created. | 87 // Notification that a PPAPI plugin has been created. |
| 71 void PepperPluginCreated(RendererPpapiHost* host); | 88 void PepperPluginCreated(RendererPpapiHost* host); |
| 72 | 89 |
| 73 // Indicates that the given instance has been created. | 90 // Indicates that the given instance has been created. |
| 74 void PepperInstanceCreated(PepperPluginInstanceImpl* instance); | 91 void PepperInstanceCreated(PepperPluginInstanceImpl* instance); |
| 75 | 92 |
| 76 // Indicates that the given instance is being destroyed. This is called from | 93 // Indicates that the given instance is being destroyed. This is called from |
| 77 // the destructor, so it's important that the instance is not dereferenced | 94 // the destructor, so it's important that the instance is not dereferenced |
| 78 // from this call. | 95 // from this call. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 protected: | 335 protected: |
| 319 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); | 336 RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 320 | 337 |
| 321 private: | 338 private: |
| 322 friend class RenderFrameObserver; | 339 friend class RenderFrameObserver; |
| 323 | 340 |
| 324 // Functions to add and remove observers for this object. | 341 // Functions to add and remove observers for this object. |
| 325 void AddObserver(RenderFrameObserver* observer); | 342 void AddObserver(RenderFrameObserver* observer); |
| 326 void RemoveObserver(RenderFrameObserver* observer); | 343 void RemoveObserver(RenderFrameObserver* observer); |
| 327 | 344 |
| 345 // IPC message handlers ------------------------------------------------------ | |
| 346 // | |
| 347 // The documentation for these functions should be in | |
| 348 // content/common/*_messages.h for the message that the function is handling. | |
| 349 void OnSwapOut(); | |
| 350 | |
| 351 // In --site-per-process mode, stores the WebFrame we are associated with. | |
|
nasko
2013/12/20 22:59:51
nit: I think when we remove the flag requirement f
Charlie Reis
2013/12/21 00:26:42
Good thought, but let's remove the comment when th
| |
| 352 // NULL otherwise. | |
| 353 blink::WebFrame* frame_; | |
| 354 | |
| 328 RenderViewImpl* render_view_; | 355 RenderViewImpl* render_view_; |
| 329 int routing_id_; | 356 int routing_id_; |
| 330 bool is_swapped_out_; | 357 bool is_swapped_out_; |
| 331 bool is_detaching_; | 358 bool is_detaching_; |
| 332 | 359 |
| 333 #if defined(ENABLE_PLUGINS) | 360 #if defined(ENABLE_PLUGINS) |
| 334 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | 361 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; |
| 335 PepperPluginSet active_pepper_instances_; | 362 PepperPluginSet active_pepper_instances_; |
| 336 | 363 |
| 337 // Current text input composition text. Empty if no composition is in | 364 // Current text input composition text. Empty if no composition is in |
| 338 // progress. | 365 // progress. |
| 339 base::string16 pepper_composition_text_; | 366 base::string16 pepper_composition_text_; |
| 340 #endif | 367 #endif |
| 341 | 368 |
| 342 // All the registered observers. | 369 // All the registered observers. |
| 343 ObserverList<RenderFrameObserver> observers_; | 370 ObserverList<RenderFrameObserver> observers_; |
| 344 | 371 |
| 345 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 372 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 346 }; | 373 }; |
| 347 | 374 |
| 348 } // namespace content | 375 } // namespace content |
| 349 | 376 |
| 350 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 377 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |