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

Side by Side Diff: components/guest_view/browser/test_guest_view_manager.cc

Issue 1143333008: Getting rid of more webview memory leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/guest_view/browser/test_guest_view_manager.h" 5 #include "components/guest_view/browser/test_guest_view_manager.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "components/guest_view/browser/guest_view_manager_delegate.h" 8 #include "components/guest_view/browser/guest_view_manager_delegate.h"
9 9
10 namespace guest_view { 10 namespace guest_view {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (created_message_loop_runner_.get()) 84 if (created_message_loop_runner_.get())
85 created_message_loop_runner_->Quit(); 85 created_message_loop_runner_->Quit();
86 } 86 }
87 87
88 void TestGuestViewManager::RemoveGuest(int guest_instance_id) { 88 void TestGuestViewManager::RemoveGuest(int guest_instance_id) {
89 GuestViewManager::RemoveGuest(guest_instance_id); 89 GuestViewManager::RemoveGuest(guest_instance_id);
90 } 90 }
91 91
92 void TestGuestViewManager::ViewGarbageCollected(int embedder_process_id, 92 void TestGuestViewManager::ViewGarbageCollected(int embedder_process_id,
93 int view_instance_id) { 93 int view_instance_id) {
94 GuestViewManager::ViewGarbageCollected(embedder_process_id, view_instance_id);
94 ++num_views_garbage_collected_; 95 ++num_views_garbage_collected_;
95 if (gc_message_loop_runner_.get()) 96 if (gc_message_loop_runner_.get())
96 gc_message_loop_runner_->Quit(); 97 gc_message_loop_runner_->Quit();
97 } 98 }
98 99
99 // Test factory for creating test instances of GuestViewManager. 100 // Test factory for creating test instances of GuestViewManager.
100 TestGuestViewManagerFactory::TestGuestViewManagerFactory() 101 TestGuestViewManagerFactory::TestGuestViewManagerFactory()
101 : test_guest_view_manager_(NULL) { 102 : test_guest_view_manager_(NULL) {
102 } 103 }
103 104
104 TestGuestViewManagerFactory::~TestGuestViewManagerFactory() { 105 TestGuestViewManagerFactory::~TestGuestViewManagerFactory() {
105 } 106 }
106 107
107 GuestViewManager* TestGuestViewManagerFactory::CreateGuestViewManager( 108 GuestViewManager* TestGuestViewManagerFactory::CreateGuestViewManager(
108 content::BrowserContext* context, 109 content::BrowserContext* context,
109 scoped_ptr<GuestViewManagerDelegate> delegate) { 110 scoped_ptr<GuestViewManagerDelegate> delegate) {
110 if (!test_guest_view_manager_) { 111 if (!test_guest_view_manager_) {
111 test_guest_view_manager_ = 112 test_guest_view_manager_ =
112 new TestGuestViewManager(context, delegate.Pass()); 113 new TestGuestViewManager(context, delegate.Pass());
113 } 114 }
114 return test_guest_view_manager_; 115 return test_guest_view_manager_;
115 } 116 }
116 117
117 } // namespace guest_view 118 } // namespace guest_view
OLDNEW
« no previous file with comments | « components/guest_view/browser/test_guest_view_manager.h ('k') | components/guest_view/common/guest_view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698