OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/browser_url_handler.h" | 5 #include "chrome/browser/browser_url_handler.h" |
6 #include "chrome/test/testing_profile.h" | 6 #include "chrome/test/testing_profile.h" |
7 #include "content/browser/renderer_host/test_backing_store.h" | 7 #include "content/browser/renderer_host/test_backing_store.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance.h" | 9 #include "content/browser/site_instance.h" |
10 #include "content/browser/tab_contents/navigation_controller.h" | 10 #include "content/browser/tab_contents/navigation_controller.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 int routing_id) | 44 int routing_id) |
45 : RenderViewHost(instance, delegate, routing_id, | 45 : RenderViewHost(instance, delegate, routing_id, |
46 kInvalidSessionStorageNamespaceId), | 46 kInvalidSessionStorageNamespaceId), |
47 render_view_created_(false), | 47 render_view_created_(false), |
48 delete_counter_(NULL), | 48 delete_counter_(NULL), |
49 simulate_fetch_via_proxy_(false), | 49 simulate_fetch_via_proxy_(false), |
50 contents_mime_type_("text/html") { | 50 contents_mime_type_("text/html") { |
51 // For normal RenderViewHosts, this is freed when |Shutdown()| is called. | 51 // For normal RenderViewHosts, this is freed when |Shutdown()| is called. |
52 // For TestRenderViewHost, the view is explicitly deleted in the destructor | 52 // For TestRenderViewHost, the view is explicitly deleted in the destructor |
53 // below, because TestRenderWidgetHostView::Destroy() doesn't |delete this|. | 53 // below, because TestRenderWidgetHostView::Destroy() doesn't |delete this|. |
54 set_view(new TestRenderWidgetHostView(this)); | 54 SetView(new TestRenderWidgetHostView(this)); |
55 } | 55 } |
56 | 56 |
57 TestRenderViewHost::~TestRenderViewHost() { | 57 TestRenderViewHost::~TestRenderViewHost() { |
58 if (delete_counter_) | 58 if (delete_counter_) |
59 ++*delete_counter_; | 59 ++*delete_counter_; |
60 | 60 |
61 // Since this isn't a traditional view, we have to delete it. | 61 // Since this isn't a traditional view, we have to delete it. |
62 delete view(); | 62 delete view(); |
63 } | 63 } |
64 | 64 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 SetContents(NULL); | 362 SetContents(NULL); |
363 | 363 |
364 // Make sure that we flush any messages related to TabContents destruction | 364 // Make sure that we flush any messages related to TabContents destruction |
365 // before we destroy the profile. | 365 // before we destroy the profile. |
366 MessageLoop::current()->RunAllPending(); | 366 MessageLoop::current()->RunAllPending(); |
367 | 367 |
368 // Release the profile on the UI thread. | 368 // Release the profile on the UI thread. |
369 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); | 369 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); |
370 message_loop_.RunAllPending(); | 370 message_loop_.RunAllPending(); |
371 } | 371 } |
OLD | NEW |