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 <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <string> | 11 #include <string> |
9 #include <vector> | 12 #include <vector> |
10 | 13 |
11 #include "base/basictypes.h" | |
12 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
14 #include "base/id_map.h" | 16 #include "base/id_map.h" |
| 17 #include "base/macros.h" |
15 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
16 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
18 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
19 #include "base/process/process_handle.h" | 22 #include "base/process/process_handle.h" |
| 23 #include "build/build_config.h" |
20 #include "content/common/accessibility_mode_enums.h" | 24 #include "content/common/accessibility_mode_enums.h" |
21 #include "content/common/frame_message_enums.h" | 25 #include "content/common/frame_message_enums.h" |
22 #include "content/common/mojo/service_registry_impl.h" | 26 #include "content/common/mojo/service_registry_impl.h" |
23 #include "content/public/common/console_message_level.h" | 27 #include "content/public/common/console_message_level.h" |
24 #include "content/public/common/javascript_message_type.h" | 28 #include "content/public/common/javascript_message_type.h" |
25 #include "content/public/common/referrer.h" | 29 #include "content/public/common/referrer.h" |
26 #include "content/public/renderer/render_frame.h" | 30 #include "content/public/renderer/render_frame.h" |
27 #include "content/renderer/render_frame_proxy.h" | 31 #include "content/renderer/render_frame_proxy.h" |
28 #include "content/renderer/renderer_webcookiejar_impl.h" | 32 #include "content/renderer/renderer_webcookiejar_impl.h" |
29 #include "ipc/ipc_message.h" | 33 #include "ipc/ipc_message.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 186 |
183 // Returns the RenderFrameImpl for the given routing ID. | 187 // Returns the RenderFrameImpl for the given routing ID. |
184 static RenderFrameImpl* FromRoutingID(int routing_id); | 188 static RenderFrameImpl* FromRoutingID(int routing_id); |
185 | 189 |
186 // Just like RenderFrame::FromWebFrame but returns the implementation. | 190 // Just like RenderFrame::FromWebFrame but returns the implementation. |
187 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); | 191 static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); |
188 | 192 |
189 // Used by content_layouttest_support to hook into the creation of | 193 // Used by content_layouttest_support to hook into the creation of |
190 // RenderFrameImpls. | 194 // RenderFrameImpls. |
191 struct CreateParams { | 195 struct CreateParams { |
192 CreateParams(RenderViewImpl* render_view, int32 routing_id) | 196 CreateParams(RenderViewImpl* render_view, int32_t routing_id) |
193 : render_view(render_view), routing_id(routing_id) {} | 197 : render_view(render_view), routing_id(routing_id) {} |
194 ~CreateParams() {} | 198 ~CreateParams() {} |
195 | 199 |
196 RenderViewImpl* render_view; | 200 RenderViewImpl* render_view; |
197 int32 routing_id; | 201 int32_t routing_id; |
198 }; | 202 }; |
199 | 203 |
200 using CreateRenderFrameImplFunction = | 204 using CreateRenderFrameImplFunction = |
201 RenderFrameImpl* (*)(const CreateParams&); | 205 RenderFrameImpl* (*)(const CreateParams&); |
202 static void InstallCreateHook( | 206 static void InstallCreateHook( |
203 CreateRenderFrameImplFunction create_render_frame_impl); | 207 CreateRenderFrameImplFunction create_render_frame_impl); |
204 | 208 |
205 // Looks up and returns the WebFrame corresponding to a given opener frame | 209 // Looks up and returns the WebFrame corresponding to a given opener frame |
206 // routing ID. Also stores the opener's RenderView routing ID into | 210 // routing ID. Also stores the opener's RenderView routing ID into |
207 // |opener_view_routing_id|. | 211 // |opener_view_routing_id|. |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 base::WeakPtr<RenderFrameImpl> render_frame_impl_; | 685 base::WeakPtr<RenderFrameImpl> render_frame_impl_; |
682 | 686 |
683 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest); | 687 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest); |
684 }; | 688 }; |
685 | 689 |
686 typedef std::map<GURL, double> HostZoomLevels; | 690 typedef std::map<GURL, double> HostZoomLevels; |
687 | 691 |
688 // Creates a new RenderFrame. |render_view| is the RenderView object that this | 692 // Creates a new RenderFrame. |render_view| is the RenderView object that this |
689 // frame belongs to. | 693 // frame belongs to. |
690 // Callers *must* call |SetWebFrame| immediately after creation. | 694 // Callers *must* call |SetWebFrame| immediately after creation. |
691 static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); | 695 static RenderFrameImpl* Create(RenderViewImpl* render_view, |
| 696 int32_t routing_id); |
692 | 697 |
693 // Functions to add and remove observers for this object. | 698 // Functions to add and remove observers for this object. |
694 void AddObserver(RenderFrameObserver* observer); | 699 void AddObserver(RenderFrameObserver* observer); |
695 void RemoveObserver(RenderFrameObserver* observer); | 700 void RemoveObserver(RenderFrameObserver* observer); |
696 | 701 |
697 bool IsLocalRoot() const; | 702 bool IsLocalRoot() const; |
698 | 703 |
699 // Builds and sends DidCommitProvisionalLoad to the host. | 704 // Builds and sends DidCommitProvisionalLoad to the host. |
700 void SendDidCommitProvisionalLoad(blink::WebFrame* frame, | 705 void SendDidCommitProvisionalLoad(blink::WebFrame* frame, |
701 blink::WebHistoryCommitType commit_type, | 706 blink::WebHistoryCommitType commit_type, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 int id, | 744 int id, |
740 bool notify_result); | 745 bool notify_result); |
741 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript, | 746 void OnJavaScriptExecuteRequestForTests(const base::string16& javascript, |
742 int id, | 747 int id, |
743 bool notify_result, | 748 bool notify_result, |
744 bool has_user_gesture); | 749 bool has_user_gesture); |
745 void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript, | 750 void OnJavaScriptExecuteRequestInIsolatedWorld(const base::string16& jscript, |
746 int id, | 751 int id, |
747 bool notify_result, | 752 bool notify_result, |
748 int world_id); | 753 int world_id); |
749 void OnVisualStateRequest(uint64 key); | 754 void OnVisualStateRequest(uint64_t key); |
750 void OnSetEditableSelectionOffsets(int start, int end); | 755 void OnSetEditableSelectionOffsets(int start, int end); |
751 void OnSetCompositionFromExistingText( | 756 void OnSetCompositionFromExistingText( |
752 int start, int end, | 757 int start, int end, |
753 const std::vector<blink::WebCompositionUnderline>& underlines); | 758 const std::vector<blink::WebCompositionUnderline>& underlines); |
754 void OnExecuteNoValueEditCommand(const std::string& name); | 759 void OnExecuteNoValueEditCommand(const std::string& name); |
755 void OnExtendSelectionAndDelete(int before, int after); | 760 void OnExtendSelectionAndDelete(int before, int after); |
756 void OnReload(bool ignore_cache); | 761 void OnReload(bool ignore_cache); |
757 void OnTextSurroundingSelectionRequest(size_t max_length); | 762 void OnTextSurroundingSelectionRequest(size_t max_length); |
758 void OnSetAccessibilityMode(AccessibilityMode new_mode); | 763 void OnSetAccessibilityMode(AccessibilityMode new_mode); |
759 void OnSnapshotAccessibilityTree(int callback_id); | 764 void OnSnapshotAccessibilityTree(int callback_id); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 #endif | 1169 #endif |
1165 | 1170 |
1166 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1171 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1167 | 1172 |
1168 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1173 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1169 }; | 1174 }; |
1170 | 1175 |
1171 } // namespace content | 1176 } // namespace content |
1172 | 1177 |
1173 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1178 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |