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

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

Issue 1963633003: Revert of Pepper: Add a nullptr check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/renderer/pepper/pepper_plugin_instance_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 (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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 // Commit the texture mailbox to the screen. 201 // Commit the texture mailbox to the screen.
202 void CommitTextureMailbox(const cc::TextureMailbox& texture_mailbox); 202 void CommitTextureMailbox(const cc::TextureMailbox& texture_mailbox);
203 203
204 // Passes the committed texture to |texture_layer_| and marks it as in use. 204 // Passes the committed texture to |texture_layer_| and marks it as in use.
205 void PassCommittedTextureToTextureLayer(); 205 void PassCommittedTextureToTextureLayer();
206 206
207 // Callback when the compositor is finished consuming the committed texture. 207 // Callback when the compositor is finished consuming the committed texture.
208 void FinishedConsumingCommittedTexture( 208 void FinishedConsumingCommittedTexture(
209 const cc::TextureMailbox& texture_mailbox, 209 const cc::TextureMailbox& texture_mailbox,
210 scoped_refptr<PPB_Graphics3D_Impl> graphics_3d,
211 const gpu::SyncToken& sync_token, 210 const gpu::SyncToken& sync_token,
212 bool is_lost); 211 bool is_lost);
213 212
214 // Called when the out-of-process plugin implementing this instance crashed. 213 // Called when the out-of-process plugin implementing this instance crashed.
215 void InstanceCrashed(); 214 void InstanceCrashed();
216 215
217 // PPB_Instance and PPB_Instance_Private implementation. 216 // PPB_Instance and PPB_Instance_Private implementation.
218 bool full_frame() const { return full_frame_; } 217 bool full_frame() const { return full_frame_; }
219 const ppapi::ViewData& view_data() const { return view_data_; } 218 const ppapi::ViewData& view_data() const { return view_data_; }
220 219
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 961
963 bool is_deleted_; 962 bool is_deleted_;
964 963
965 // The text that is currently selected in the plugin. 964 // The text that is currently selected in the plugin.
966 base::string16 selected_text_; 965 base::string16 selected_text_;
967 966
968 // The most recently committed texture. This is kept around in case the layer 967 // The most recently committed texture. This is kept around in case the layer
969 // needs to be regenerated. 968 // needs to be regenerated.
970 cc::TextureMailbox committed_texture_; 969 cc::TextureMailbox committed_texture_;
971 970
972 // The Graphics3D that produced the most recently committed texture.
973 scoped_refptr<PPB_Graphics3D_Impl> committed_texture_graphics_3d_;
974
975 gpu::SyncToken committed_texture_consumed_sync_token_; 971 gpu::SyncToken committed_texture_consumed_sync_token_;
976 972
977 // Holds the number of references |texture_layer_| has to any given 973 // Holds the number of references |texture_layer_| has to any given
978 // cc::TextureMailbox. 974 // cc::TextureMailbox.
979 // We expect there to be no more than 10 textures in use at a time. A 975 // We expect there to be no more than 10 textures in use at a time. A
980 // std::vector will have better performance than a std::map. 976 // std::vector will have better performance than a std::map.
981 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>; 977 using TextureMailboxRefCount = std::pair<cc::TextureMailbox, int>;
982 std::vector<TextureMailboxRefCount> texture_ref_counts_; 978 std::vector<TextureMailboxRefCount> texture_ref_counts_;
983 979
984 bool initialized_; 980 bool initialized_;
985 981
986 // We use a weak ptr factory for scheduling DidChangeView events so that we 982 // We use a weak ptr factory for scheduling DidChangeView events so that we
987 // can tell whether updates are pending and consolidate them. When there's 983 // can tell whether updates are pending and consolidate them. When there's
988 // already a weak ptr pending (HasWeakPtrs is true), code should update the 984 // already a weak ptr pending (HasWeakPtrs is true), code should update the
989 // view_data_ but not send updates. This also allows us to cancel scheduled 985 // view_data_ but not send updates. This also allows us to cancel scheduled
990 // view change events. 986 // view change events.
991 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; 987 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
992 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; 988 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_;
993 989
994 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); 990 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
995 }; 991 };
996 992
997 } // namespace content 993 } // namespace content
998 994
999 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 995 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698