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> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <memory> | 13 #include <memory> |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/callback.h" | |
18 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
19 #include "base/gtest_prod_util.h" | 20 #include "base/gtest_prod_util.h" |
20 #include "base/id_map.h" | 21 #include "base/id_map.h" |
21 #include "base/macros.h" | 22 #include "base/macros.h" |
22 #include "base/memory/linked_ptr.h" | 23 #include "base/memory/linked_ptr.h" |
23 #include "base/memory/ref_counted.h" | 24 #include "base/memory/ref_counted.h" |
24 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
25 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
27 #include "base/optional.h" | |
26 #include "base/process/process_handle.h" | 28 #include "base/process/process_handle.h" |
27 #include "base/single_thread_task_runner.h" | 29 #include "base/single_thread_task_runner.h" |
30 #include "base/unguessable_token.h" | |
28 #include "build/build_config.h" | 31 #include "build/build_config.h" |
29 #include "content/common/accessibility_mode.h" | 32 #include "content/common/accessibility_mode.h" |
30 #include "content/common/associated_interface_registry_impl.h" | 33 #include "content/common/associated_interface_registry_impl.h" |
31 #include "content/common/download/mhtml_save_status.h" | 34 #include "content/common/download/mhtml_save_status.h" |
32 #include "content/common/features.h" | 35 #include "content/common/features.h" |
33 #include "content/common/frame.mojom.h" | 36 #include "content/common/frame.mojom.h" |
34 #include "content/common/frame_message_enums.h" | 37 #include "content/common/frame_message_enums.h" |
35 #include "content/common/host_zoom.mojom.h" | 38 #include "content/common/host_zoom.mojom.h" |
36 #include "content/common/renderer.mojom.h" | 39 #include "content/common/renderer.mojom.h" |
37 #include "content/public/common/console_message_level.h" | 40 #include "content/public/common/console_message_level.h" |
38 #include "content/public/common/javascript_dialog_type.h" | 41 #include "content/public/common/javascript_dialog_type.h" |
39 #include "content/public/common/previews_state.h" | 42 #include "content/public/common/previews_state.h" |
40 #include "content/public/common/referrer.h" | 43 #include "content/public/common/referrer.h" |
41 #include "content/public/common/request_context_type.h" | 44 #include "content/public/common/request_context_type.h" |
42 #include "content/public/common/stop_find_action.h" | 45 #include "content/public/common/stop_find_action.h" |
43 #include "content/public/renderer/render_frame.h" | 46 #include "content/public/renderer/render_frame.h" |
44 #include "content/renderer/frame_blame_context.h" | 47 #include "content/renderer/frame_blame_context.h" |
45 #include "content/renderer/mojo/blink_interface_provider_impl.h" | 48 #include "content/renderer/mojo/blink_interface_provider_impl.h" |
46 #include "content/renderer/renderer_webcookiejar_impl.h" | 49 #include "content/renderer/renderer_webcookiejar_impl.h" |
47 #include "content/renderer/unique_name_helper.h" | 50 #include "content/renderer/unique_name_helper.h" |
48 #include "ipc/ipc_message.h" | 51 #include "ipc/ipc_message.h" |
49 #include "ipc/ipc_platform_file.h" | 52 #include "ipc/ipc_platform_file.h" |
53 #if defined(OS_ANDROID) | |
54 #include "media/base/android/routing_token_callback.h" | |
boliu
2017/04/04 23:53:21
nit: platform-specific includes after the cross-pl
liberato (no reviews please)
2017/04/05 15:13:30
Done.
| |
55 #endif | |
50 #include "media/blink/webmediaplayer_delegate.h" | 56 #include "media/blink/webmediaplayer_delegate.h" |
51 #include "media/blink/webmediaplayer_params.h" | 57 #include "media/blink/webmediaplayer_params.h" |
52 #include "media/mojo/interfaces/remoting.mojom.h" | 58 #include "media/mojo/interfaces/remoting.mojom.h" |
53 #include "mojo/public/cpp/bindings/associated_binding.h" | 59 #include "mojo/public/cpp/bindings/associated_binding.h" |
54 #include "mojo/public/cpp/bindings/binding.h" | 60 #include "mojo/public/cpp/bindings/binding.h" |
55 #include "ppapi/features/features.h" | 61 #include "ppapi/features/features.h" |
56 #include "services/service_manager/public/cpp/service_info.h" | 62 #include "services/service_manager/public/cpp/service_info.h" |
57 #include "services/service_manager/public/interfaces/connector.mojom.h" | 63 #include "services/service_manager/public/interfaces/connector.mojom.h" |
58 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 64 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
59 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" | 65 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 friend class RenderFrameObserver; | 762 friend class RenderFrameObserver; |
757 friend class RenderAccessibilityImplTest; | 763 friend class RenderAccessibilityImplTest; |
758 friend class TestRenderFrame; | 764 friend class TestRenderFrame; |
759 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | 765 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
760 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 766 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
761 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); | 767 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
762 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); | 768 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
763 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, | 769 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, |
764 AccessibilityMessagesQueueWhileSwappedOut); | 770 AccessibilityMessagesQueueWhileSwappedOut); |
765 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); | 771 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); |
772 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | |
773 TestOverlayRoutingTokenSendsLater); | |
774 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | |
775 TestOverlayRoutingTokenSendsNow); | |
766 | 776 |
767 // A wrapper class used as the callback for JavaScript executed | 777 // A wrapper class used as the callback for JavaScript executed |
768 // in an isolated world. | 778 // in an isolated world. |
769 class JavaScriptIsolatedWorldRequest | 779 class JavaScriptIsolatedWorldRequest |
770 : public blink::WebScriptExecutionCallback { | 780 : public blink::WebScriptExecutionCallback { |
771 public: | 781 public: |
772 JavaScriptIsolatedWorldRequest( | 782 JavaScriptIsolatedWorldRequest( |
773 int id, | 783 int id, |
774 bool notify_result, | 784 bool notify_result, |
775 int routing_id, | 785 int routing_id, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
916 void OnSuppressFurtherDialogs(); | 926 void OnSuppressFurtherDialogs(); |
917 void OnFileChooserResponse( | 927 void OnFileChooserResponse( |
918 const std::vector<content::FileChooserFileInfo>& files); | 928 const std::vector<content::FileChooserFileInfo>& files); |
919 void OnClearFocusedElement(); | 929 void OnClearFocusedElement(); |
920 void OnBlinkFeatureUsageReport(const std::set<int>& features); | 930 void OnBlinkFeatureUsageReport(const std::set<int>& features); |
921 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); | 931 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); |
922 #if defined(OS_ANDROID) | 932 #if defined(OS_ANDROID) |
923 void OnActivateNearestFindResult(int request_id, float x, float y); | 933 void OnActivateNearestFindResult(int request_id, float x, float y); |
924 void OnGetNearestFindResult(int request_id, float x, float y); | 934 void OnGetNearestFindResult(int request_id, float x, float y); |
925 void OnFindMatchRects(int current_version); | 935 void OnFindMatchRects(int current_version); |
936 void OnSetOverlayRoutingToken(const base::UnguessableToken& token); | |
926 #endif | 937 #endif |
927 | 938 |
928 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 939 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
929 #if defined(OS_MACOSX) | 940 #if defined(OS_MACOSX) |
930 void OnSelectPopupMenuItem(int selected_index); | 941 void OnSelectPopupMenuItem(int selected_index); |
931 #else | 942 #else |
932 void OnSelectPopupMenuItems(bool canceled, | 943 void OnSelectPopupMenuItems(bool canceled, |
933 const std::vector<int>& selected_indices); | 944 const std::vector<int>& selected_indices); |
934 #endif | 945 #endif |
935 #endif | 946 #endif |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1111 // Sends a reply to the current find operation handling if it was a | 1122 // Sends a reply to the current find operation handling if it was a |
1112 // synchronous find request. | 1123 // synchronous find request. |
1113 void SendFindReply(int request_id, | 1124 void SendFindReply(int request_id, |
1114 int match_count, | 1125 int match_count, |
1115 int ordinal, | 1126 int ordinal, |
1116 const blink::WebRect& selection_rect, | 1127 const blink::WebRect& selection_rect, |
1117 bool final_status_update); | 1128 bool final_status_update); |
1118 | 1129 |
1119 void InitializeBlameContext(RenderFrameImpl* parent_frame); | 1130 void InitializeBlameContext(RenderFrameImpl* parent_frame); |
1120 | 1131 |
1132 #if defined(OS_ANDROID) | |
1133 // Send |callback| our AndroidOverlay routing token when it arrives. We may | |
1134 // call |callback| before returning. | |
1135 void GetOverlayRoutingToken(const media::RoutingTokenCallback& callback); | |
1136 | |
1137 // Ask the host to send our AndroidOverlay routing token to us. | |
1138 void RequestOverlayRoutingTokenFromHost(); | |
1139 #endif | |
1140 | |
1121 // Stores the WebLocalFrame we are associated with. This is null from the | 1141 // Stores the WebLocalFrame we are associated with. This is null from the |
1122 // constructor until BindToWebFrame is called, and it is null after | 1142 // constructor until BindToWebFrame is called, and it is null after |
1123 // frameDetached is called until destruction (which is asynchronous in the | 1143 // frameDetached is called until destruction (which is asynchronous in the |
1124 // case of the main frame, but not subframes). | 1144 // case of the main frame, but not subframes). |
1125 blink::WebLocalFrame* frame_; | 1145 blink::WebLocalFrame* frame_; |
1126 | 1146 |
1127 // Boolean value indicating whether this RenderFrameImpl object is for the | 1147 // Boolean value indicating whether this RenderFrameImpl object is for the |
1128 // main frame or not. It remains accurate during destruction, even when | 1148 // main frame or not. It remains accurate during destruction, even when |
1129 // |frame_| has been invalidated. | 1149 // |frame_| has been invalidated. |
1130 bool is_main_frame_; | 1150 bool is_main_frame_; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1414 blink::WebSourceLocation source_location; | 1434 blink::WebSourceLocation source_location; |
1415 | 1435 |
1416 PendingNavigationInfo(const NavigationPolicyInfo& info); | 1436 PendingNavigationInfo(const NavigationPolicyInfo& info); |
1417 }; | 1437 }; |
1418 | 1438 |
1419 // PlzNavigate: Contains information about a pending navigation to be sent to | 1439 // PlzNavigate: Contains information about a pending navigation to be sent to |
1420 // the browser. This state is allocated in decidePolicyForNavigation() and | 1440 // the browser. This state is allocated in decidePolicyForNavigation() and |
1421 // is used and released in didStartProvisionalLoad(). | 1441 // is used and released in didStartProvisionalLoad(). |
1422 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_; | 1442 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_; |
1423 | 1443 |
1444 #if defined(OS_ANDROID) | |
1445 // AndroidOverlay routing token from the browser, if we have one yet. | |
1446 base::Optional<base::UnguessableToken> overlay_routing_token_; | |
1447 | |
1448 // Callbacks that we should call when we get a routing token. | |
1449 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; | |
1450 #endif | |
1451 | |
1424 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1452 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1425 | 1453 |
1426 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1454 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1427 }; | 1455 }; |
1428 | 1456 |
1429 } // namespace content | 1457 } // namespace content |
1430 | 1458 |
1431 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1459 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |