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

Side by Side Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All
3 * Rights Reserved. 3 * Rights Reserved.
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 page_clients.chrome_client->IsSVGImageChromeClient() 122 page_clients.chrome_client->IsSVGImageChromeClient()
123 ? UseCounter::kSVGImageContext 123 ? UseCounter::kSVGImageContext
124 : UseCounter::kDefaultContext), 124 : UseCounter::kDefaultContext),
125 opened_by_dom_(false), 125 opened_by_dom_(false),
126 tab_key_cycles_through_elements_(true), 126 tab_key_cycles_through_elements_(true),
127 suspended_(false), 127 suspended_(false),
128 device_scale_factor_(1), 128 device_scale_factor_(1),
129 visibility_state_(kPageVisibilityStateVisible), 129 visibility_state_(kPageVisibilityStateVisible),
130 is_cursor_visible_(true), 130 is_cursor_visible_(true),
131 subframe_count_(0) { 131 subframe_count_(0) {
132 ASSERT(editor_client_); 132 DCHECK(editor_client_);
133 133
134 ASSERT(!AllPages().Contains(this)); 134 DCHECK(!AllPages().Contains(this));
135 AllPages().insert(this); 135 AllPages().insert(this);
136 } 136 }
137 137
138 Page::~Page() { 138 Page::~Page() {
139 // willBeDestroyed() must be called before Page destruction. 139 // willBeDestroyed() must be called before Page destruction.
140 ASSERT(!main_frame_); 140 DCHECK(!main_frame_);
141 } 141 }
142 142
143 void Page::CloseSoon() { 143 void Page::CloseSoon() {
144 // Make sure this Page can no longer be found by JS. 144 // Make sure this Page can no longer be found by JS.
145 is_closing_ = true; 145 is_closing_ = true;
146 146
147 // TODO(dcheng): Try to remove this in a followup, it's not obviously needed. 147 // TODO(dcheng): Try to remove this in a followup, it's not obviously needed.
148 if (main_frame_->IsLocalFrame()) 148 if (main_frame_->IsLocalFrame())
149 ToLocalFrame(main_frame_)->Loader().StopAllLoaders(); 149 ToLocalFrame(main_frame_)->Loader().StopAllLoaders();
150 150
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 647 }
648 648
649 void Page::WillBeDestroyed() { 649 void Page::WillBeDestroyed() {
650 Frame* main_frame = main_frame_; 650 Frame* main_frame = main_frame_;
651 651
652 // TODO(sashab): Remove this check, the call to detach() here should always 652 // TODO(sashab): Remove this check, the call to detach() here should always
653 // work. 653 // work.
654 if (main_frame->IsAttached()) 654 if (main_frame->IsAttached())
655 main_frame->Detach(FrameDetachType::kRemove); 655 main_frame->Detach(FrameDetachType::kRemove);
656 656
657 ASSERT(AllPages().Contains(this)); 657 DCHECK(AllPages().Contains(this));
658 AllPages().erase(this); 658 AllPages().erase(this);
659 OrdinaryPages().erase(this); 659 OrdinaryPages().erase(this);
660 660
661 if (scrolling_coordinator_) 661 if (scrolling_coordinator_)
662 scrolling_coordinator_->WillBeDestroyed(); 662 scrolling_coordinator_->WillBeDestroyed();
663 663
664 GetChromeClient().ChromeDestroyed(); 664 GetChromeClient().ChromeDestroyed();
665 if (validation_message_client_) 665 if (validation_message_client_)
666 validation_message_client_->WillBeDestroyed(); 666 validation_message_client_->WillBeDestroyed();
667 main_frame_ = nullptr; 667 main_frame_ = nullptr;
668 668
669 PageVisibilityNotifier::NotifyContextDestroyed(); 669 PageVisibilityNotifier::NotifyContextDestroyed();
670 } 670 }
671 671
672 Page::PageClients::PageClients() 672 Page::PageClients::PageClients()
673 : chrome_client(nullptr), 673 : chrome_client(nullptr),
674 context_menu_client(nullptr), 674 context_menu_client(nullptr),
675 editor_client(nullptr), 675 editor_client(nullptr),
676 spell_checker_client(nullptr) {} 676 spell_checker_client(nullptr) {}
677 677
678 Page::PageClients::~PageClients() {} 678 Page::PageClients::~PageClients() {}
679 679
680 template class CORE_TEMPLATE_EXPORT Supplement<Page>; 680 template class CORE_TEMPLATE_EXPORT Supplement<Page>;
681 681
682 } // namespace blink 682 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/CreateWindow.cpp ('k') | third_party/WebKit/Source/core/page/PagePopupController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698