| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
| 6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
| 7 | 7 |
| 8 #include <hlink.h> | 8 #include <hlink.h> |
| 9 #include <htiface.h> | 9 #include <htiface.h> |
| 10 #include <mshtmcid.h> | 10 #include <mshtmcid.h> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 is_automation_client_reused_(false) { | 51 is_automation_client_reused_(false) { |
| 52 } | 52 } |
| 53 | 53 |
| 54 HRESULT ChromeActiveDocument::FinalConstruct() { | 54 HRESULT ChromeActiveDocument::FinalConstruct() { |
| 55 // If we have a cached ChromeActiveDocument instance in TLS, then grab | 55 // If we have a cached ChromeActiveDocument instance in TLS, then grab |
| 56 // ownership of the cached document's automation client. This is an | 56 // ownership of the cached document's automation client. This is an |
| 57 // optimization to get Chrome active documents to load faster. | 57 // optimization to get Chrome active documents to load faster. |
| 58 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); | 58 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); |
| 59 if (cached_document) { | 59 if (cached_document) { |
| 60 DCHECK(automation_client_.get() == NULL); | 60 DCHECK(automation_client_.get() == NULL); |
| 61 automation_client_.reset(cached_document->automation_client_.release()); | 61 automation_client_ = cached_document->automation_client_.release(); |
| 62 DLOG(INFO) << "Reusing automation client instance from " | 62 DLOG(INFO) << "Reusing automation client instance from " |
| 63 << cached_document; | 63 << cached_document; |
| 64 DCHECK(automation_client_.get() != NULL); | 64 DCHECK(automation_client_.get() != NULL); |
| 65 automation_client_->Reinitialize(this); | 65 automation_client_->Reinitialize(this); |
| 66 is_automation_client_reused_ = true; | 66 is_automation_client_reused_ = true; |
| 67 } else { | 67 } else { |
| 68 // The FinalConstruct implementation in the ChromeFrameActivexBase class | 68 // The FinalConstruct implementation in the ChromeFrameActivexBase class |
| 69 // i.e. Base creates an instance of the ChromeFrameAutomationClient class | 69 // i.e. Base creates an instance of the ChromeFrameAutomationClient class |
| 70 // and initializes it, which would spawn a new Chrome process, etc. | 70 // and initializes it, which would spawn a new Chrome process, etc. |
| 71 // We don't want to be doing this if we have a cached document, whose | 71 // We don't want to be doing this if we have a cached document, whose |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 ScopedComPtr<IBrowserService> browser_service; | 810 ScopedComPtr<IBrowserService> browser_service; |
| 811 DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service.Receive()); | 811 DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service.Receive()); |
| 812 if (browser_service) { | 812 if (browser_service) { |
| 813 ScopedComPtr<ITravelLog> travel_log; | 813 ScopedComPtr<ITravelLog> travel_log; |
| 814 browser_service->GetTravelLog(travel_log.Receive()); | 814 browser_service->GetTravelLog(travel_log.Receive()); |
| 815 if (travel_log) { | 815 if (travel_log) { |
| 816 travel_log->Travel(browser_service, offset); | 816 travel_log->Travel(browser_service, offset); |
| 817 } | 817 } |
| 818 } | 818 } |
| 819 } | 819 } |
| OLD | NEW |