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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 #include "base/unguessable_token.h" | 30 #include "base/unguessable_token.h" |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "content/common/accessibility_mode.h" | 32 #include "content/common/accessibility_mode.h" |
| 33 #include "content/common/associated_interface_registry_impl.h" | 33 #include "content/common/associated_interface_registry_impl.h" |
| 34 #include "content/common/download/mhtml_save_status.h" | 34 #include "content/common/download/mhtml_save_status.h" |
| 35 #include "content/common/features.h" | 35 #include "content/common/features.h" |
| 36 #include "content/common/frame.mojom.h" | 36 #include "content/common/frame.mojom.h" |
| 37 #include "content/common/frame_message_enums.h" | 37 #include "content/common/frame_message_enums.h" |
| 38 #include "content/common/host_zoom.mojom.h" | 38 #include "content/common/host_zoom.mojom.h" |
| 39 #include "content/common/renderer.mojom.h" | 39 #include "content/common/renderer.mojom.h" |
| 40 #include "content/common/unique_name_helper.h" | |
| 40 #include "content/common/url_loader_factory.mojom.h" | 41 #include "content/common/url_loader_factory.mojom.h" |
| 41 #include "content/public/common/console_message_level.h" | 42 #include "content/public/common/console_message_level.h" |
| 42 #include "content/public/common/javascript_dialog_type.h" | 43 #include "content/public/common/javascript_dialog_type.h" |
| 43 #include "content/public/common/previews_state.h" | 44 #include "content/public/common/previews_state.h" |
| 44 #include "content/public/common/referrer.h" | 45 #include "content/public/common/referrer.h" |
| 45 #include "content/public/common/request_context_type.h" | 46 #include "content/public/common/request_context_type.h" |
| 46 #include "content/public/common/stop_find_action.h" | 47 #include "content/public/common/stop_find_action.h" |
| 47 #include "content/public/renderer/render_frame.h" | 48 #include "content/public/renderer/render_frame.h" |
| 48 #include "content/renderer/frame_blame_context.h" | 49 #include "content/renderer/frame_blame_context.h" |
| 49 #include "content/renderer/mojo/blink_interface_provider_impl.h" | 50 #include "content/renderer/mojo/blink_interface_provider_impl.h" |
| 50 #include "content/renderer/renderer_webcookiejar_impl.h" | 51 #include "content/renderer/renderer_webcookiejar_impl.h" |
| 51 #include "content/renderer/unique_name_helper.h" | |
| 52 #include "ipc/ipc_message.h" | 52 #include "ipc/ipc_message.h" |
| 53 #include "ipc/ipc_platform_file.h" | 53 #include "ipc/ipc_platform_file.h" |
| 54 #include "media/base/routing_token_callback.h" | 54 #include "media/base/routing_token_callback.h" |
| 55 #include "media/blink/webmediaplayer_delegate.h" | 55 #include "media/blink/webmediaplayer_delegate.h" |
| 56 #include "media/blink/webmediaplayer_params.h" | 56 #include "media/blink/webmediaplayer_params.h" |
| 57 #include "media/mojo/features.h" | 57 #include "media/mojo/features.h" |
| 58 #include "media/mojo/interfaces/remoting.mojom.h" | 58 #include "media/mojo/interfaces/remoting.mojom.h" |
| 59 #include "mojo/public/cpp/bindings/associated_binding.h" | 59 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 60 #include "mojo/public/cpp/bindings/binding.h" | 60 #include "mojo/public/cpp/bindings/binding.h" |
| 61 #include "mojo/public/cpp/bindings/binding_set.h" | 61 #include "mojo/public/cpp/bindings/binding_set.h" |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1160 // constructor until BindToWebFrame is called, and it is null after | 1160 // constructor until BindToWebFrame is called, and it is null after |
| 1161 // frameDetached is called until destruction (which is asynchronous in the | 1161 // frameDetached is called until destruction (which is asynchronous in the |
| 1162 // case of the main frame, but not subframes). | 1162 // case of the main frame, but not subframes). |
| 1163 blink::WebLocalFrame* frame_; | 1163 blink::WebLocalFrame* frame_; |
| 1164 | 1164 |
| 1165 // Boolean value indicating whether this RenderFrameImpl object is for the | 1165 // Boolean value indicating whether this RenderFrameImpl object is for the |
| 1166 // main frame or not. It remains accurate during destruction, even when | 1166 // main frame or not. It remains accurate during destruction, even when |
| 1167 // |frame_| has been invalidated. | 1167 // |frame_| has been invalidated. |
| 1168 bool is_main_frame_; | 1168 bool is_main_frame_; |
| 1169 | 1169 |
| 1170 class RenderFrameAdapter : public UniqueNameHelper::FrameAdapter { | |
| 1171 public: | |
| 1172 explicit RenderFrameAdapter(RenderFrameImpl* render_frame); | |
| 1173 ~RenderFrameAdapter() override; | |
| 1174 | |
| 1175 // FrameAdapter overrides: | |
| 1176 bool IsMainFrame() const override; | |
| 1177 bool IsCandidateUnique(const std::string& name) const override; | |
| 1178 int GetSiblingCount() const override; | |
| 1179 int GetChildCount() const override; | |
| 1180 std::vector<base::StringPiece> CollectAncestorNames( | |
| 1181 BeginPoint begin_point, | |
| 1182 bool (*should_stop)(base::StringPiece)) const override; | |
| 1183 std::vector<int> GetFramePosition(BeginPoint begin_point) const override; | |
| 1184 | |
| 1185 private: | |
| 1186 blink::WebLocalFrame* GetWebFrame() const; | |
| 1187 | |
| 1188 RenderFrameImpl* render_frame_; | |
| 1189 }; | |
| 1190 // TODO(dcheng): This name is not good. | |
| 1191 RenderFrameAdapter render_frame_adapter_; | |
|
Łukasz Anforowicz
2017/05/25 16:48:50
Optional: Have you considered hiding the RenderFra
dcheng
2017/05/25 18:25:03
I considered that. While it hides the subclass def
Łukasz Anforowicz
2017/05/25 18:33:18
FWIW, the current name is not that bad IMO. If yo
dcheng
2017/05/25 18:40:41
Done.
| |
| 1170 UniqueNameHelper unique_name_helper_; | 1192 UniqueNameHelper unique_name_helper_; |
| 1171 | 1193 |
| 1172 // When a frame is detached in response to a message from the browser process, | 1194 // When a frame is detached in response to a message from the browser process, |
| 1173 // this RenderFrame should not be sending notifications back to it. This | 1195 // this RenderFrame should not be sending notifications back to it. This |
| 1174 // boolean is used to indicate this case. | 1196 // boolean is used to indicate this case. |
| 1175 bool in_browser_initiated_detach_; | 1197 bool in_browser_initiated_detach_; |
| 1176 | 1198 |
| 1177 // Indicates whether the frame has been inserted into the frame tree yet or | 1199 // Indicates whether the frame has been inserted into the frame tree yet or |
| 1178 // not. | 1200 // not. |
| 1179 // | 1201 // |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1478 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; | 1500 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; |
| 1479 | 1501 |
| 1480 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1502 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1481 | 1503 |
| 1482 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1504 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1483 }; | 1505 }; |
| 1484 | 1506 |
| 1485 } // namespace content | 1507 } // namespace content |
| 1486 | 1508 |
| 1487 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1509 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |