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

Side by Side Diff: content/browser/presentation/presentation_service_impl.h

Issue 2949053002: [Presentation API] OffscreenPresentationManager should only interact with top level receiver frame (Closed)
Patch Set: add unit test Created 3 years, 5 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 | « no previous file | content/browser/presentation/presentation_service_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_
6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ 6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 96 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
97 ListenForConnectionStateChange); 97 ListenForConnectionStateChange);
98 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 98 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
99 ListenForConnectionClose); 99 ListenForConnectionClose);
100 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 100 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
101 MaxPendingStartPresentationRequests); 101 MaxPendingStartPresentationRequests);
102 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 102 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
103 MaxPendingReconnectPresentationRequests); 103 MaxPendingReconnectPresentationRequests);
104 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, 104 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
105 ReceiverPresentationServiceDelegate); 105 ReceiverPresentationServiceDelegate);
106 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest,
107 ReceiverDelegateOnSubFrame);
106 108
107 // Maximum number of pending ReconnectPresentation requests at any given time. 109 // Maximum number of pending ReconnectPresentation requests at any given time.
108 static const int kMaxQueuedRequests = 10; 110 static const int kMaxQueuedRequests = 10;
109 111
110 using ConnectionMessagesCallback = 112 using ConnectionMessagesCallback =
111 base::OnceCallback<void(std::vector<PresentationConnectionMessage>)>; 113 base::OnceCallback<void(std::vector<PresentationConnectionMessage>)>;
112 114
113 // Listener implementation owned by PresentationServiceImpl. An instance of 115 // Listener implementation owned by PresentationServiceImpl. An instance of
114 // this is created when PresentationRequest.getAvailability() is resolved. 116 // this is created when PresentationRequest.getAvailability() is resolved.
115 // The instance receives screen availability results from the embedder and 117 // The instance receives screen availability results from the embedder and
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 pending_reconnect_presentation_cbs_; 273 pending_reconnect_presentation_cbs_;
272 274
273 // RAII binding of |this| to an Presentation interface request. 275 // RAII binding of |this| to an Presentation interface request.
274 // The binding is removed when binding_ is cleared or goes out of scope. 276 // The binding is removed when binding_ is cleared or goes out of scope.
275 std::unique_ptr<mojo::Binding<blink::mojom::PresentationService>> binding_; 277 std::unique_ptr<mojo::Binding<blink::mojom::PresentationService>> binding_;
276 278
277 // ID of the RenderFrameHost this object is associated with. 279 // ID of the RenderFrameHost this object is associated with.
278 int render_process_id_; 280 int render_process_id_;
279 int render_frame_id_; 281 int render_frame_id_;
280 282
283 // If current frame is top level frame.
284 bool is_main_frame_;
285
281 // NOTE: Weak pointers must be invalidated before all other member variables. 286 // NOTE: Weak pointers must be invalidated before all other member variables.
282 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; 287 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_;
283 288
284 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); 289 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl);
285 }; 290 };
286 291
287 } // namespace content 292 } // namespace content
288 293
289 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ 294 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698