| 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 // addition, its associated RenderWidgetHostView has to be focused. | 410 // addition, its associated RenderWidgetHostView has to be focused. |
| 411 bool IsFocused(); | 411 bool IsFocused(); |
| 412 | 412 |
| 413 protected: | 413 protected: |
| 414 friend class RenderFrameHostFactory; | 414 friend class RenderFrameHostFactory; |
| 415 | 415 |
| 416 // |flags| is a combination of CreateRenderFrameFlags. | 416 // |flags| is a combination of CreateRenderFrameFlags. |
| 417 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost | 417 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost |
| 418 // should be the abstraction needed here, but we need RenderViewHost to pass | 418 // should be the abstraction needed here, but we need RenderViewHost to pass |
| 419 // into WebContentsObserver::FrameDetached for now. | 419 // into WebContentsObserver::FrameDetached for now. |
| 420 RenderFrameHostImpl(RenderViewHostImpl* render_view_host, | 420 RenderFrameHostImpl(SiteInstance* site_instance, |
| 421 RenderViewHostImpl* render_view_host, |
| 421 RenderFrameHostDelegate* delegate, | 422 RenderFrameHostDelegate* delegate, |
| 422 RenderWidgetHostDelegate* rwh_delegate, | 423 RenderWidgetHostDelegate* rwh_delegate, |
| 423 FrameTree* frame_tree, | 424 FrameTree* frame_tree, |
| 424 FrameTreeNode* frame_tree_node, | 425 FrameTreeNode* frame_tree_node, |
| 425 int routing_id, | 426 int routing_id, |
| 426 int flags); | 427 int flags); |
| 427 | 428 |
| 428 private: | 429 private: |
| 429 friend class TestRenderFrameHost; | 430 friend class TestRenderFrameHost; |
| 430 friend class TestRenderViewHost; | 431 friend class TestRenderViewHost; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 529 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 529 // refcount that calls Shutdown when it reaches zero. This allows each | 530 // refcount that calls Shutdown when it reaches zero. This allows each |
| 530 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 531 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 531 // we have a RenderViewHost for each RenderFrameHost. | 532 // we have a RenderViewHost for each RenderFrameHost. |
| 532 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 533 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 533 // some form of page context. | 534 // some form of page context. |
| 534 RenderViewHostImpl* render_view_host_; | 535 RenderViewHostImpl* render_view_host_; |
| 535 | 536 |
| 536 RenderFrameHostDelegate* delegate_; | 537 RenderFrameHostDelegate* delegate_; |
| 537 | 538 |
| 539 // The SiteInstance associated with this RenderFrameHost. All content drawn |
| 540 // in this RenderFrameHost is part of this SiteInstance. Cannot change over |
| 541 // time. |
| 542 scoped_refptr<SiteInstanceImpl> site_instance_; |
| 543 |
| 544 // The renderer process this RenderFrameHost is associated with. It is |
| 545 // equivalent to the result of site_instance_->GetProcess(), but that |
| 546 // method has the side effect of creating the process if it doesn't exist. |
| 547 // Cache a pointer to avoid unnecessary process creation. |
| 548 RenderProcessHost* process_; |
| 549 |
| 538 // |cross_process_frame_connector_| passes messages from an out-of-process | 550 // |cross_process_frame_connector_| passes messages from an out-of-process |
| 539 // child frame to the parent process for compositing. | 551 // child frame to the parent process for compositing. |
| 540 // | 552 // |
| 541 // This is only non-NULL when this is the swapped out RenderFrameHost in | 553 // This is only non-NULL when this is the swapped out RenderFrameHost in |
| 542 // the same site instance as this frame's parent. | 554 // the same site instance as this frame's parent. |
| 543 // | 555 // |
| 544 // See the class comment above CrossProcessFrameConnector for more | 556 // See the class comment above CrossProcessFrameConnector for more |
| 545 // information. | 557 // information. |
| 546 // | 558 // |
| 547 // This will move to RenderFrameProxyHost when that class is created. | 559 // This will move to RenderFrameProxyHost when that class is created. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 666 |
| 655 // NOTE: This must be the last member. | 667 // NOTE: This must be the last member. |
| 656 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 668 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 657 | 669 |
| 658 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 670 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 659 }; | 671 }; |
| 660 | 672 |
| 661 } // namespace content | 673 } // namespace content |
| 662 | 674 |
| 663 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 675 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |