| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "content/browser/accessibility/browser_accessibility_manager.h" | 17 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 18 #include "content/browser/bad_message.h" |
| 18 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
| 19 #include "content/common/accessibility_mode_enums.h" | 20 #include "content/common/accessibility_mode_enums.h" |
| 20 #include "content/common/ax_content_node_data.h" | 21 #include "content/common/ax_content_node_data.h" |
| 21 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
| 22 #include "content/common/frame_message_enums.h" | 23 #include "content/common/frame_message_enums.h" |
| 23 #include "content/common/frame_replication_state.h" | 24 #include "content/common/frame_replication_state.h" |
| 24 #include "content/common/image_downloader/image_downloader.mojom.h" | 25 #include "content/common/image_downloader/image_downloader.mojom.h" |
| 25 #include "content/common/mojo/service_registry_impl.h" | 26 #include "content/common/mojo/service_registry_impl.h" |
| 26 #include "content/common/navigation_params.h" | 27 #include "content/common/navigation_params.h" |
| 27 #include "content/public/browser/render_frame_host.h" | 28 #include "content/public/browser/render_frame_host.h" |
| 28 #include "content/public/common/javascript_message_type.h" | 29 #include "content/public/common/javascript_message_type.h" |
| 29 #include "net/http/http_response_headers.h" | 30 #include "net/http/http_response_headers.h" |
| 31 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
| 30 #include "third_party/WebKit/public/web/WebTextDirection.h" | 32 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 31 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 33 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
| 32 #include "ui/accessibility/ax_node_data.h" | 34 #include "ui/accessibility/ax_node_data.h" |
| 33 #include "ui/base/page_transition_types.h" | 35 #include "ui/base/page_transition_types.h" |
| 34 | 36 |
| 35 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| 36 #include "content/browser/mojo/service_registry_android.h" | 38 #include "content/browser/mojo/service_registry_android.h" |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 class GURL; | 41 class GURL; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Tracks whether the RenderFrame for this RenderFrameHost has been created in | 200 // Tracks whether the RenderFrame for this RenderFrameHost has been created in |
| 199 // the renderer process. This is currently only used for subframes. | 201 // the renderer process. This is currently only used for subframes. |
| 200 // TODO(creis): Use this for main frames as well when RVH goes away. | 202 // TODO(creis): Use this for main frames as well when RVH goes away. |
| 201 void SetRenderFrameCreated(bool created); | 203 void SetRenderFrameCreated(bool created); |
| 202 | 204 |
| 203 // Called for renderer-created windows to resume requests from this frame, | 205 // Called for renderer-created windows to resume requests from this frame, |
| 204 // after they are blocked in RenderWidgetHelper::CreateNewWindow. | 206 // after they are blocked in RenderWidgetHelper::CreateNewWindow. |
| 205 void Init(); | 207 void Init(); |
| 206 | 208 |
| 207 int routing_id() const { return routing_id_; } | 209 int routing_id() const { return routing_id_; } |
| 208 void OnCreateChildFrame(int new_routing_id, | 210 void OnCreateChildFrame( |
| 209 blink::WebTreeScopeType scope, | 211 int new_routing_id, |
| 210 const std::string& frame_name, | 212 blink::WebTreeScopeType scope, |
| 211 blink::WebSandboxFlags sandbox_flags); | 213 const std::string& frame_name, |
| 214 blink::WebSandboxFlags sandbox_flags, |
| 215 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 212 | 216 |
| 213 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 217 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| 214 RenderFrameHostDelegate* delegate() { return delegate_; } | 218 RenderFrameHostDelegate* delegate() { return delegate_; } |
| 215 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | 219 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
| 216 | 220 |
| 217 // Returns this RenderFrameHost's loading state. This method is only used by | 221 // Returns this RenderFrameHost's loading state. This method is only used by |
| 218 // FrameTreeNode. The proper way to check whether a frame is loading is to | 222 // FrameTreeNode. The proper way to check whether a frame is loading is to |
| 219 // call FrameTreeNode::IsLoading. | 223 // call FrameTreeNode::IsLoading. |
| 220 bool is_loading() const { return is_loading_; } | 224 bool is_loading() const { return is_loading_; } |
| 221 | 225 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 IPC::Message* reply_msg); | 540 IPC::Message* reply_msg); |
| 537 void OnTextSurroundingSelectionResponse(const base::string16& content, | 541 void OnTextSurroundingSelectionResponse(const base::string16& content, |
| 538 size_t start_offset, | 542 size_t start_offset, |
| 539 size_t end_offset); | 543 size_t end_offset); |
| 540 void OnDidAccessInitialDocument(); | 544 void OnDidAccessInitialDocument(); |
| 541 void OnDidChangeOpener(int32 opener_routing_id); | 545 void OnDidChangeOpener(int32 opener_routing_id); |
| 542 void OnDidChangeName(const std::string& name); | 546 void OnDidChangeName(const std::string& name); |
| 543 void OnDidAssignPageId(int32 page_id); | 547 void OnDidAssignPageId(int32 page_id); |
| 544 void OnDidChangeSandboxFlags(int32 frame_routing_id, | 548 void OnDidChangeSandboxFlags(int32 frame_routing_id, |
| 545 blink::WebSandboxFlags flags); | 549 blink::WebSandboxFlags flags); |
| 550 void OnDidChangeFrameOwnerProperties( |
| 551 int32 frame_routing_id, |
| 552 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 546 void OnUpdateTitle(const base::string16& title, | 553 void OnUpdateTitle(const base::string16& title, |
| 547 blink::WebTextDirection title_direction); | 554 blink::WebTextDirection title_direction); |
| 548 void OnUpdateEncoding(const std::string& encoding); | 555 void OnUpdateEncoding(const std::string& encoding); |
| 549 void OnBeginNavigation(const CommonNavigationParams& common_params, | 556 void OnBeginNavigation(const CommonNavigationParams& common_params, |
| 550 const BeginNavigationParams& begin_params, | 557 const BeginNavigationParams& begin_params, |
| 551 scoped_refptr<ResourceRequestBody> body); | 558 scoped_refptr<ResourceRequestBody> body); |
| 552 void OnDispatchLoad(); | 559 void OnDispatchLoad(); |
| 553 void OnAccessibilityEvents( | 560 void OnAccessibilityEvents( |
| 554 const std::vector<AccessibilityHostMsg_EventParams>& params, | 561 const std::vector<AccessibilityHostMsg_EventParams>& params, |
| 555 int reset_token); | 562 int reset_token); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 RenderWidgetHostViewBase* GetViewForAccessibility(); | 628 RenderWidgetHostViewBase* GetViewForAccessibility(); |
| 622 | 629 |
| 623 // Sends a navigate message to the RenderFrame and notifies DevTools about | 630 // Sends a navigate message to the RenderFrame and notifies DevTools about |
| 624 // navigation happening. Should be used instead of sending the message | 631 // navigation happening. Should be used instead of sending the message |
| 625 // directly. | 632 // directly. |
| 626 void SendNavigateMessage( | 633 void SendNavigateMessage( |
| 627 const content::CommonNavigationParams& common_params, | 634 const content::CommonNavigationParams& common_params, |
| 628 const content::StartNavigationParams& start_params, | 635 const content::StartNavigationParams& start_params, |
| 629 const content::RequestNavigationParams& request_params); | 636 const content::RequestNavigationParams& request_params); |
| 630 | 637 |
| 638 // Returns the child FrameTreeNode if |child_frame_routing_id| is an |
| 639 // immediate child of this FrameTreeNode. |child_frame_routing_id| is |
| 640 // considered untrusted, so the renderer process is killed if it refers to a |
| 641 // FrameTreeNode that is not a child of this node. |
| 642 FrameTreeNode* FindAndVerifyChild( |
| 643 int32 child_frame_routing_id, bad_message::BadMessageReason reason); |
| 644 |
| 631 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 645 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 632 // refcount that calls Shutdown when it reaches zero. This allows each | 646 // refcount that calls Shutdown when it reaches zero. This allows each |
| 633 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 647 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 634 // we have a RenderViewHost for each RenderFrameHost. | 648 // we have a RenderViewHost for each RenderFrameHost. |
| 635 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 649 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 636 // some form of page context. | 650 // some form of page context. |
| 637 RenderViewHostImpl* render_view_host_; | 651 RenderViewHostImpl* render_view_host_; |
| 638 | 652 |
| 639 RenderFrameHostDelegate* delegate_; | 653 RenderFrameHostDelegate* delegate_; |
| 640 | 654 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 | 812 |
| 799 // NOTE: This must be the last member. | 813 // NOTE: This must be the last member. |
| 800 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 814 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 801 | 815 |
| 802 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 816 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 803 }; | 817 }; |
| 804 | 818 |
| 805 } // namespace content | 819 } // namespace content |
| 806 | 820 |
| 807 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 821 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |