Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Side by Side Diff: content/renderer/render_frame_impl.h

Issue 2902253003: Refactor UniqueNameHelper to use an adapter pattern for code sharing. (Closed)
Patch Set: Fix off by one bug Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 UniqueNameFrameAdapter : public UniqueNameHelper::FrameAdapter {
1171 public:
1172 explicit UniqueNameFrameAdapter(RenderFrameImpl* render_frame);
1173 ~UniqueNameFrameAdapter() 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 UniqueNameFrameAdapter unique_name_frame_adapter_;
1170 UniqueNameHelper unique_name_helper_; 1191 UniqueNameHelper unique_name_helper_;
1171 1192
1172 // When a frame is detached in response to a message from the browser process, 1193 // 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 1194 // this RenderFrame should not be sending notifications back to it. This
1174 // boolean is used to indicate this case. 1195 // boolean is used to indicate this case.
1175 bool in_browser_initiated_detach_; 1196 bool in_browser_initiated_detach_;
1176 1197
1177 // Indicates whether the frame has been inserted into the frame tree yet or 1198 // Indicates whether the frame has been inserted into the frame tree yet or
1178 // not. 1199 // not.
1179 // 1200 //
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; 1499 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_;
1479 1500
1480 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 1501 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1481 1502
1482 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 1503 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1483 }; 1504 };
1484 1505
1485 } // namespace content 1506 } // namespace content
1486 1507
1487 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 1508 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698