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

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

Issue 2369453004: Fix crash when a frame is detached while a PepperPluginInstance is being constructed. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | 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 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 is_deleted_(false), 531 is_deleted_(false),
532 initialized_(false), 532 initialized_(false),
533 audio_controller_(new PepperAudioController(this)), 533 audio_controller_(new PepperAudioController(this)),
534 view_change_weak_ptr_factory_(this), 534 view_change_weak_ptr_factory_(this),
535 weak_factory_(this) { 535 weak_factory_(this) {
536 pp_instance_ = HostGlobals::Get()->AddInstance(this); 536 pp_instance_ = HostGlobals::Get()->AddInstance(this);
537 537
538 memset(&current_print_settings_, 0, sizeof(current_print_settings_)); 538 memset(&current_print_settings_, 0, sizeof(current_print_settings_));
539 module_->InstanceCreated(this); 539 module_->InstanceCreated(this);
540 540
541 if (render_frame) { // NULL in tests 541 if (render_frame_) { // NULL in tests or if the frame has been destroyed.
542 render_frame->PepperInstanceCreated(this); 542 render_frame_->PepperInstanceCreated(this);
543 view_data_.is_page_visible = !render_frame_->GetRenderWidget()->is_hidden(); 543 view_data_.is_page_visible = !render_frame_->GetRenderWidget()->is_hidden();
544 544
545 // Set the initial focus. 545 // Set the initial focus.
546 SetContentAreaFocus(render_frame_->GetRenderWidget()->has_focus()); 546 SetContentAreaFocus(render_frame_->GetRenderWidget()->has_focus());
547 547
548 if (!module_->IsProxied()) { 548 if (!module_->IsProxied()) {
549 PepperBrowserConnection* browser_connection = 549 PepperBrowserConnection* browser_connection =
550 PepperBrowserConnection::Get(render_frame_); 550 PepperBrowserConnection::Get(render_frame_);
551 browser_connection->DidCreateInProcessInstance( 551 browser_connection->DidCreateInProcessInstance(
552 pp_instance(), 552 pp_instance(),
(...skipping 2871 matching lines...) Expand 10 before | Expand all | Expand 10 after
3424 const cc::TextureMailbox& mailbox) const { 3424 const cc::TextureMailbox& mailbox) const {
3425 auto it = 3425 auto it =
3426 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3426 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3427 [&mailbox](const TextureMailboxRefCount& ref_count) { 3427 [&mailbox](const TextureMailboxRefCount& ref_count) {
3428 return ref_count.first.mailbox() == mailbox.mailbox(); 3428 return ref_count.first.mailbox() == mailbox.mailbox();
3429 }); 3429 });
3430 return it != texture_ref_counts_.end(); 3430 return it != texture_ref_counts_.end();
3431 } 3431 }
3432 3432
3433 } // namespace content 3433 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698