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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 2065513004: Expose flash playback status and volume control to content renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_focus_manager
Patch Set: addressing nits Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 struct InputEventData; 99 struct InputEventData;
100 struct PPP_Instance_Combined; 100 struct PPP_Instance_Combined;
101 class ScopedPPVar; 101 class ScopedPPVar;
102 } 102 }
103 103
104 namespace content { 104 namespace content {
105 105
106 class ContentDecryptorDelegate; 106 class ContentDecryptorDelegate;
107 class FullscreenContainer; 107 class FullscreenContainer;
108 class MessageChannel; 108 class MessageChannel;
109 class PepperAudioController;
109 class PepperCompositorHost; 110 class PepperCompositorHost;
110 class PepperGraphics2DHost; 111 class PepperGraphics2DHost;
111 class PluginInstanceThrottlerImpl; 112 class PluginInstanceThrottlerImpl;
112 class PluginModule; 113 class PluginModule;
113 class PluginObject; 114 class PluginObject;
114 class PPB_Graphics3D_Impl; 115 class PPB_Graphics3D_Impl;
115 class PPB_ImageData_Impl; 116 class PPB_ImageData_Impl;
116 class PPB_URLLoader_Impl; 117 class PPB_URLLoader_Impl;
117 class RenderFrameImpl; 118 class RenderFrameImpl;
118 class RenderViewImpl; 119 class RenderViewImpl;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 std::unique_ptr<cc::SingleReleaseCallback>* release_callback, 551 std::unique_ptr<cc::SingleReleaseCallback>* release_callback,
551 bool use_shared_memory) override; 552 bool use_shared_memory) override;
552 553
553 // RenderFrameObserver 554 // RenderFrameObserver
554 void OnDestruct() override; 555 void OnDestruct() override;
555 556
556 // PluginInstanceThrottler::Observer 557 // PluginInstanceThrottler::Observer
557 void OnThrottleStateChange() override; 558 void OnThrottleStateChange() override;
558 void OnHiddenForPlaceholder(bool hidden) override; 559 void OnHiddenForPlaceholder(bool hidden) override;
559 560
561 PepperAudioController& audio_controller() {
562 return *audio_controller_;
563 }
564
560 private: 565 private:
561 friend class base::RefCounted<PepperPluginInstanceImpl>; 566 friend class base::RefCounted<PepperPluginInstanceImpl>;
562 friend class PpapiPluginInstanceTest; 567 friend class PpapiPluginInstanceTest;
563 friend class PpapiUnittest; 568 friend class PpapiUnittest;
564 569
565 // Delete should be called by the WebPlugin before this destructor. 570 // Delete should be called by the WebPlugin before this destructor.
566 ~PepperPluginInstanceImpl() override; 571 ~PepperPluginInstanceImpl() override;
567 572
568 // Class to record document load notifications and play them back once the 573 // Class to record document load notifications and play them back once the
569 // real document loader becomes available. Used only by external instances. 574 // real document loader becomes available. Used only by external instances.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 975
971 // Holds the number of references |texture_layer_| has to any given 976 // Holds the number of references |texture_layer_| has to any given
972 // cc::TextureMailbox. 977 // cc::TextureMailbox.
973 // We expect there to be no more than 10 textures in use at a time. A 978 // We expect there to be no more than 10 textures in use at a time. A
974 // std::vector will have better performance than a std::map. 979 // std::vector will have better performance than a std::map.
975 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>; 980 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>;
976 std::vector<TextureMailboxRefCount> texture_ref_counts_; 981 std::vector<TextureMailboxRefCount> texture_ref_counts_;
977 982
978 bool initialized_; 983 bool initialized_;
979 984
985 // The controller for all active audios of this pepper instance.
986 std::unique_ptr<PepperAudioController> audio_controller_;
987
980 // We use a weak ptr factory for scheduling DidChangeView events so that we 988 // We use a weak ptr factory for scheduling DidChangeView events so that we
981 // can tell whether updates are pending and consolidate them. When there's 989 // can tell whether updates are pending and consolidate them. When there's
982 // already a weak ptr pending (HasWeakPtrs is true), code should update the 990 // already a weak ptr pending (HasWeakPtrs is true), code should update the
983 // view_data_ but not send updates. This also allows us to cancel scheduled 991 // view_data_ but not send updates. This also allows us to cancel scheduled
984 // view change events. 992 // view change events.
985 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; 993 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
986 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; 994 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_;
987 995
988 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); 996 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
989 }; 997 };
990 998
991 } // namespace content 999 } // namespace content
992 1000
993 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 1001 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698