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

Unified Diff: chrome_frame/chrome_active_document.cc

Issue 7627005: Fix a back forward bug in ChromeFrame reported on the field. The bug occurs when multiple (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/chrome_active_document.h ('k') | chrome_frame/chrome_frame_automation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_active_document.cc
===================================================================
--- chrome_frame/chrome_active_document.cc (revision 96788)
+++ chrome_frame/chrome_active_document.cc (working copy)
@@ -19,17 +19,10 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
-#include "base/file_util.h"
#include "base/logging.h"
-#include "base/path_service.h"
-#include "base/process_util.h"
-#include "base/string_tokenizer.h"
#include "base/string_util.h"
-#include "base/threading/thread.h"
-#include "base/threading/thread_local.h"
#include "base/utf_string_conversions.h"
#include "base/win/scoped_variant.h"
-#include "base/win/win_util.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/automation_messages.h"
@@ -49,8 +42,6 @@
DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0,
0x46);
-base::ThreadLocalPointer<ChromeActiveDocument> g_active_doc_cache;
-
bool g_first_launch_by_process_ = true;
const DWORD kIEEncodingIdArray[] = {
@@ -73,29 +64,14 @@
}
HRESULT ChromeActiveDocument::FinalConstruct() {
- // If we have a cached ChromeActiveDocument instance in TLS, then grab
- // ownership of the cached document's automation client. This is an
- // optimization to get Chrome active documents to load faster.
- ChromeActiveDocument* cached_document = g_active_doc_cache.Get();
- if (cached_document && cached_document->IsValid()) {
- SetResourceModule();
- DCHECK(automation_client_.get() == NULL);
- automation_client_.swap(cached_document->automation_client_);
- DVLOG(1) << "Reusing automation client instance from " << cached_document;
- DCHECK(automation_client_.get() != NULL);
- automation_client_->Reinitialize(this, url_fetcher_.get());
- is_automation_client_reused_ = true;
- OnAutomationServerReady();
- } else {
- // The FinalConstruct implementation in the ChromeFrameActivexBase class
- // i.e. Base creates an instance of the ChromeFrameAutomationClient class
- // and initializes it, which would spawn a new Chrome process, etc.
- // We don't want to be doing this if we have a cached document, whose
- // automation client instance can be reused.
- HRESULT hr = BaseActiveX::FinalConstruct();
- if (FAILED(hr))
- return hr;
- }
+ // The FinalConstruct implementation in the ChromeFrameActivexBase class
+ // i.e. Base creates an instance of the ChromeFrameAutomationClient class
+ // and initializes it, which would spawn a new Chrome process, etc.
+ // We don't want to be doing this if we have a cached document, whose
+ // automation client instance can be reused.
+ HRESULT hr = BaseActiveX::FinalConstruct();
+ if (FAILED(hr))
+ return hr;
InitializeAutomationSettings();
@@ -543,13 +519,6 @@
HRESULT ChromeActiveDocument::IOleObject_SetClientSite(
IOleClientSite* client_site) {
if (client_site == NULL) {
- ChromeActiveDocument* cached_document = g_active_doc_cache.Get();
- if (cached_document) {
- DCHECK(this == cached_document);
- g_active_doc_cache.Set(NULL);
- cached_document->Release();
- }
-
base::win::ScopedComPtr<IDocHostUIHandler> doc_host_handler;
if (doc_site_)
doc_host_handler.QueryFrom(doc_site_);
@@ -974,23 +943,6 @@
}
}
-void ChromeActiveDocument::OnOpenURL(const GURL& url_to_open,
- const GURL& referrer,
- int open_disposition) {
- // If the disposition indicates that we should be opening the URL in the
- // current tab, then we can reuse the ChromeFrameAutomationClient instance
- // maintained by the current ChromeActiveDocument instance. We cache this
- // instance so that it can be used by the new ChromeActiveDocument instance
- // which may be instantiated for handling the new URL.
- if (open_disposition == CURRENT_TAB) {
- // Grab a reference to ensure that the document remains valid.
- AddRef();
- g_active_doc_cache.Set(this);
- }
-
- BaseActiveX::OnOpenURL(url_to_open, referrer, open_disposition);
-}
-
void ChromeActiveDocument::OnAttachExternalTab(
const AttachExternalTabParams& params) {
if (!automation_client_.get()) {
« no previous file with comments | « chrome_frame/chrome_active_document.h ('k') | chrome_frame/chrome_frame_automation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698