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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/lkgr Created 6 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 // 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // WebContentsImpl::DestructionObserver ---------------------------------------- 282 // WebContentsImpl::DestructionObserver ----------------------------------------
283 283
284 class WebContentsImpl::DestructionObserver : public WebContentsObserver { 284 class WebContentsImpl::DestructionObserver : public WebContentsObserver {
285 public: 285 public:
286 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) 286 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents)
287 : WebContentsObserver(watched_contents), 287 : WebContentsObserver(watched_contents),
288 owner_(owner) { 288 owner_(owner) {
289 } 289 }
290 290
291 // WebContentsObserver: 291 // WebContentsObserver:
292 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { 292 virtual void WebContentsDestroyed() OVERRIDE {
293 owner_->OnWebContentsDestroyed(static_cast<WebContentsImpl*>(web_contents)); 293 owner_->OnWebContentsDestroyed(
294 static_cast<WebContentsImpl*>(web_contents()));
294 } 295 }
295 296
296 private: 297 private:
297 WebContentsImpl* owner_; 298 WebContentsImpl* owner_;
298 299
299 DISALLOW_COPY_AND_ASSIGN(DestructionObserver); 300 DISALLOW_COPY_AND_ASSIGN(DestructionObserver);
300 }; 301 };
301 302
302 WebContentsImpl::ColorChooserInfo::ColorChooserInfo(int render_process_id, 303 WebContentsImpl::ColorChooserInfo::ColorChooserInfo(int render_process_id,
303 int render_frame_id, 304 int render_frame_id,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 413 }
413 414
414 ForEachFrame(run_render_frame_deleted_callback); 415 ForEachFrame(run_render_frame_deleted_callback);
415 416
416 FOR_EACH_OBSERVER(WebContentsObserver, 417 FOR_EACH_OBSERVER(WebContentsObserver,
417 observers_, 418 observers_,
418 RenderViewDeleted(GetRenderManager()->current_host())); 419 RenderViewDeleted(GetRenderManager()->current_host()));
419 420
420 FOR_EACH_OBSERVER(WebContentsObserver, 421 FOR_EACH_OBSERVER(WebContentsObserver,
421 observers_, 422 observers_,
422 WebContentsImplDestroyed()); 423 WebContentsDestroyed());
424
425 FOR_EACH_OBSERVER(WebContentsObserver,
426 observers_,
427 WebContentsDestroyedPrivate());
423 428
424 SetDelegate(NULL); 429 SetDelegate(NULL);
425 430
426 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(), 431 STLDeleteContainerPairSecondPointers(destruction_observers_.begin(),
427 destruction_observers_.end()); 432 destruction_observers_.end());
428 } 433 }
429 434
430 WebContentsImpl* WebContentsImpl::CreateWithOpener( 435 WebContentsImpl* WebContentsImpl::CreateWithOpener(
431 const WebContents::CreateParams& params, 436 const WebContents::CreateParams& params,
432 WebContentsImpl* opener) { 437 WebContentsImpl* opener) {
(...skipping 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 3929
3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3930 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3926 if (!delegate_) 3931 if (!delegate_)
3927 return; 3932 return;
3928 const gfx::Size new_size = GetPreferredSize(); 3933 const gfx::Size new_size = GetPreferredSize();
3929 if (new_size != old_size) 3934 if (new_size != old_size)
3930 delegate_->UpdatePreferredSize(this, new_size); 3935 delegate_->UpdatePreferredSize(this, new_size);
3931 } 3936 }
3932 3937
3933 } // namespace content 3938 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698