mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	 02aa31048c
			
		
	
	
		02aa31048c
		
			
		
	
	
	
	
		
			
			* nsIScreencastServiceClient is not thread safe refcounted so we make nsScreencastService::Session a thread safe refcounted object and keep it alive while there are inflight frames. Once such frames get handled on the main thread we check if the session has been stopped.
* Removed mCaptureCallbackCs in favor of atomic counter (mClient is not accessed only on the main thread).
* HeadlessWindowCapturer now holds RefPtr to the headless window object to avoid use after free when clearing it as a listener on the widget.
* ScreencastEncoder is not ref counted anymore.
Pretty-diff: 5f5042ff1e
		
	
			
		
			
				
	
	
		
			30 lines
		
	
	
		
			659 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			659 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <memory>
 | |
| #include <map>
 | |
| #include "nsIScreencastService.h"
 | |
| 
 | |
| namespace mozilla {
 | |
| 
 | |
| class nsScreencastService final : public nsIScreencastService {
 | |
|  public:
 | |
|   NS_DECL_ISUPPORTS
 | |
|   NS_DECL_NSISCREENCASTSERVICE
 | |
| 
 | |
|   static already_AddRefed<nsIScreencastService> GetSingleton();
 | |
| 
 | |
|   nsScreencastService();
 | |
| 
 | |
|  private:
 | |
|   ~nsScreencastService();
 | |
| 
 | |
|   class Session;
 | |
|   std::map<nsString, RefPtr<Session>> mIdToSession;
 | |
| };
 | |
| 
 | |
| }  // namespace mozilla
 |