summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 23:41:56 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 23:41:56 +0000
commitaa2cf38beabe222641b145e1cf985c72acd46c1e (patch)
tree9859b7141aba180524b6792dc980e7fe9f24ed75
parent022001851f2f6be890f9b44c49fa45ea38fa80b2 (diff)
downloadchromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.zip
chromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.tar.gz
chromium_src-aa2cf38beabe222641b145e1cf985c72acd46c1e.tar.bz2
Fix a bug where in having ChromeFrame installed on the machine would cause a non chrome frame
email site to automatically logout after logging in. ChromeFrame appends the chromeframe string to the user agent to outgoing requests initiated from IE. However this was only done in the protocol sink patch for top level requests. Sub requests would carry the IE user agent which in this case would cause the web server to get confused and drop the connection. Fix is to resurrent the IHttpNegotiate vtable patch for the protocol patch as well. Removed the code which read the patch method from the registry and turned on the moniker or the httpequiv patch. It is unlikely that we will need this in the future. Cleaned up the http negotiate patch by removing references to the navigation manager and the ReportProgress patch which is not needed anymore. Fixes bug http://code.google.com/p/chromium/issues/detail?id=60745 Bug=60745 Review URL: http://codereview.chromium.org/4247001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64688 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome_frame/bho.cc20
-rw-r--r--chrome_frame/http_negotiate.cc234
-rw-r--r--chrome_frame/http_negotiate.h36
-rw-r--r--chrome_frame/protocol_sink_wrap.cc42
-rw-r--r--chrome_frame/protocol_sink_wrap.h10
-rw-r--r--chrome_frame/test/http_negotiate_unittest.cc90
-rw-r--r--chrome_frame/test/navigation_test.cc22
-rw-r--r--chrome_frame/test/test_with_web_server.cc15
-rw-r--r--chrome_frame/test/ui_test.cc4
-rw-r--r--chrome_frame/utils.cc12
-rw-r--r--chrome_frame/utils.h21
11 files changed, 8 insertions, 498 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc
index b6dc10b..5e74881 100644
--- a/chrome_frame/bho.cc
+++ b/chrome_frame/bho.cc
@@ -132,9 +132,6 @@ STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url,
if (is_top_level) {
set_url(url->bstrVal);
set_referrer("");
- if (IsIBrowserServicePatchEnabled()) {
- ProcessOptInUrls(web_browser2, url->bstrVal);
- }
}
return S_OK;
}
@@ -319,20 +316,9 @@ bool PatchHelper::InitializeAndPatchProtocolsIfNeeded() {
_pAtlModule->m_csStaticDataInitAndTypeInfo.Lock();
if (state_ == UNKNOWN) {
- ProtocolPatchMethod patch_method = GetPatchMethod();
- if (patch_method == PATCH_METHOD_INET_PROTOCOL) {
- g_trans_hooks.InstallHooks();
- state_ = PATCH_PROTOCOL;
- } else if (patch_method == PATCH_METHOD_IBROWSER) {
- HttpNegotiatePatch::Initialize();
- state_ = PATCH_IBROWSER;
- } else {
- DCHECK(patch_method == PATCH_METHOD_MONIKER);
- state_ = PATCH_MONIKER;
- HttpNegotiatePatch::Initialize();
- MonikerPatch::Initialize();
- }
-
+ g_trans_hooks.InstallHooks();
+ HttpNegotiatePatch::Initialize();
+ state_ = PATCH_PROTOCOL;
ret = true;
}
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc
index cc6155b..9d8344e 100644
--- a/chrome_frame/http_negotiate.cc
+++ b/chrome_frame/http_negotiate.cc
@@ -39,20 +39,6 @@ BEGIN_VTABLE_PATCHES(IHttpNegotiate)
HttpNegotiatePatch::BeginningTransaction)
END_VTABLE_PATCHES()
-static const int kBindStatusCallbackStartBindingIndex = 3;
-
-BEGIN_VTABLE_PATCHES(IBindStatusCallback)
- VTABLE_PATCH_ENTRY(kBindStatusCallbackStartBindingIndex,
- HttpNegotiatePatch::StartBinding)
-END_VTABLE_PATCHES()
-
-static const int kInternetProtocolSinkReportProgressIndex = 4;
-
-BEGIN_VTABLE_PATCHES(IInternetProtocolSink)
- VTABLE_PATCH_ENTRY(kInternetProtocolSinkReportProgressIndex,
- HttpNegotiatePatch::ReportProgress)
-END_VTABLE_PATCHES()
-
namespace {
class SimpleBindStatusCallback : public CComObjectRootEx<CComSingleThreadModel>,
@@ -170,25 +156,6 @@ std::string ReplaceOrAddUserAgent(LPCWSTR headers,
return new_headers;
}
-HRESULT GetBrowserServiceFromProtocolSink(IInternetProtocolSink* sink,
- IBrowserService** browser_service) {
- DCHECK(browser_service);
- // When fetching a page for the first time (not cached), we can query the
- // sink directly for IID_IShellBrowser to get the browser service.
- HRESULT hr = DoQueryService(IID_IShellBrowser, sink, browser_service);
- if (FAILED(hr)) {
- // When the request is being served up from the cache, we have to take
- // a different route via IID_ITargetFrame2.
- ScopedComPtr<IWebBrowser2> browser2;
- hr = DoQueryService(IID_ITargetFrame2, sink, browser2.Receive());
- if (browser2) {
- hr = DoQueryService(IID_IShellBrowser, browser2, browser_service);
- }
- }
-
- return hr;
-}
-
HttpNegotiatePatch::HttpNegotiatePatch() {
}
@@ -246,19 +213,6 @@ HRESULT HttpNegotiatePatch::PatchHttpNegotiate(IUnknown* to_patch) {
DLOG(WARNING)
<< base::StringPrintf("IHttpNegotiate not supported 0x%08X", hr);
}
-
- ScopedComPtr<IBindStatusCallback> bscb;
- hr = bscb.QueryFrom(to_patch);
-
- if (bscb) {
- hr = vtable_patch::PatchInterfaceMethods(bscb,
- IBindStatusCallback_PatchInfo);
- DLOG_IF(ERROR, FAILED(hr))
- << base::StringPrintf("BindStatusCallback patch failed 0x%08X", hr);
- } else {
- DLOG(WARNING) << base::StringPrintf(
- "IBindStatusCallback not supported 0x%08X", hr);
- }
return hr;
}
@@ -274,35 +228,6 @@ HRESULT HttpNegotiatePatch::BeginningTransaction(
DLOG(WARNING) << __FUNCTION__ << " Delegate returned an error";
return hr;
}
-
- NavigationManager* mgr = NavigationManager::GetThreadInstance();
- if (mgr && mgr->IsTopLevelUrl(url)) {
- ScopedComPtr<IWebBrowser2> browser2;
- DoQueryService(IID_ITargetFrame2, me, browser2.Receive());
- if (browser2) {
- VARIANT_BOOL is_top_level = VARIANT_FALSE;
- browser2->get_TopLevelContainer(&is_top_level);
-
- if (is_top_level != VARIANT_FALSE) {
- std::string referrer = FindReferrerFromHeaders(headers,
- *additional_headers);
- // When we switch from IE to CF the BeginningTransaction function is
- // called twice. The first call contains the referrer while the
- // second call does not. We set the referrer only if the URL in the
- // navigation manager changes. The URL in the navigation manager
- // is reset in BeforeNavigate2
- if (!referrer.empty()) {
- DCHECK(mgr->referrer().empty());
- mgr->set_referrer(referrer);
- }
- }
- } else {
- DVLOG(1) << "No IWebBrowser2";
- }
- } else {
- DVLOG(1) << "No NavigationManager";
- }
-
std::string updated(AppendCFUserAgentString(headers, *additional_headers));
*additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemRealloc(
*additional_headers, (updated.length() + 1) * sizeof(wchar_t)));
@@ -310,162 +235,3 @@ HRESULT HttpNegotiatePatch::BeginningTransaction(
return S_OK;
}
-// static
-HRESULT HttpNegotiatePatch::StartBinding(
- IBindStatusCallback_StartBinding_Fn original,
- IBindStatusCallback* me, DWORD reserved, IBinding* binding) {
- ScopedComPtr<IBinding> local_binding(binding);
- ScopedComPtr<IInternetProtocolSink> protocol_sink;
-
- HRESULT hr = protocol_sink.QueryFrom(local_binding);
- if (FAILED(hr) || !protocol_sink) {
- DLOG(WARNING) << "Failed to get IInternetProtocolSink from IBinding: "
- << hr;
- } else {
- if (!IS_PATCHED(IInternetProtocolSink)) {
- hr = vtable_patch::PatchInterfaceMethods(protocol_sink,
- IInternetProtocolSink_PatchInfo);
- DCHECK(SUCCEEDED(hr));
- // Now that we've gotten to the protocol sink,
- // we don't need this patch anymore.
- HRESULT hr_unpatch = vtable_patch::UnpatchInterfaceMethods(
- IBindStatusCallback_PatchInfo);
- DCHECK(SUCCEEDED(hr_unpatch));
- }
-
- DLOG_IF(WARNING, FAILED(hr))
- << "Failed to patch IInternetProtocolSink from IBinding: " << hr;
- }
-
- hr = original(me, reserved, binding);
- return hr;
-}
-
-// static
-HRESULT HttpNegotiatePatch::ReportProgress(
- IInternetProtocolSink_ReportProgress_Fn original, IInternetProtocolSink* me,
- ULONG status_code, LPCWSTR status_text) {
- DVLOG(1) << __FUNCTION__
- << base::StringPrintf(" %i %ls", status_code, status_text);
- bool updated_mime_type = false;
-
- if (status_code == BINDSTATUS_MIMETYPEAVAILABLE ||
- status_code == BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE ||
- status_code == LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE) {
- DCHECK(lstrlenW(status_text));
- bool render_in_chrome_frame = false;
- bool is_top_level_request = !IsSubFrameRequest(me);
- // NOTE: After switching over to using the onhttpequiv notification from
- // mshtml we can expect to see sub frames being created even before the
- // owning document has completed loading. In particular frames whose
- // source is about:blank.
-
- if (is_top_level_request) {
- ScopedComPtr<IBrowserService> browser;
- GetBrowserServiceFromProtocolSink(me, browser.Receive());
- if (browser) {
- render_in_chrome_frame = CheckForCFNavigation(browser, true);
- }
-
- DVLOG_IF(1, !render_in_chrome_frame) << " - browser not tagged";
-
- if (!render_in_chrome_frame) {
- // Check to see if we need to alter the mime type that gets reported
- // by inspecting the raw header information:
- ScopedComPtr<IWinInetHttpInfo> win_inet_http_info;
- HRESULT hr = win_inet_http_info.QueryFrom(me);
-
- // Try slightly harder if we couldn't QI directly.
- if (!win_inet_http_info || FAILED(hr)) {
- hr = DoQueryService(IID_IWinInetHttpInfo, me,
- win_inet_http_info.Receive());
- DLOG_IF(WARNING, FAILED(hr)) << "Failed to get IWinInetHttpInfo";
- }
-
- // Note that it has been observed that getting an IWinInetHttpInfo will
- // fail if we are loading a page like about:blank that isn't loaded via
- // wininet.
- if (win_inet_http_info) {
- // We have headers: check to see if the server is requesting CF via
- // the X-UA-Compatible: chrome=1 HTTP header.
- // TODO(tommi): use HTTP_QUERY_CUSTOM instead of fetching and parsing
- // all the headers.
- std::string headers(GetRawHttpHeaders(win_inet_http_info));
- net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(),
- "\r\n");
- while (it.GetNext()) {
- if (LowerCaseEqualsASCII(it.name_begin(), it.name_end(),
- kUACompatibleHttpHeader)) {
- std::string ua_value(StringToLowerASCII(it.values()));
- if (ua_value.find("chrome=1") != std::string::npos) {
- render_in_chrome_frame = true;
- break;
- }
- }
- }
- }
- }
- }
-
- if (render_in_chrome_frame) {
- if (IsTextHtmlMimeType(status_text)) {
- DVLOG(1) << "- changing mime type to " << kChromeMimeType;
- status_text = kChromeMimeType;
- updated_mime_type = true;
- } else {
- DVLOG(1) << "- don't want to render " << status_text << " in cf";
- }
- }
- }
-
- if (updated_mime_type) {
- // Report all crashes in the exception handler as we updated the mime type.
- // Note that this avoids having the VEH report a crash if an SEH earlier in
- // the chain handles the exception.
- ExceptionBarrier barrier;
- return original(me, status_code, status_text);
- } else {
- // Only report exceptions caused within ChromeFrame in this context.
- ExceptionBarrierReportOnlyModule barrier;
- return original(me, status_code, status_text);
- }
-}
-
-STDMETHODIMP UserAgentAddOn::BeginningTransaction(LPCWSTR url, LPCWSTR headers,
- DWORD reserved,
- LPWSTR* additional_headers) {
- HRESULT hr = S_OK;
- if (delegate_) {
- hr = delegate_->BeginningTransaction(url, headers, reserved,
- additional_headers);
- }
-
- if (hr == S_OK) {
- std::string updated_headers;
- if (IsGcfDefaultRenderer() &&
- RENDERER_TYPE_CHROME_DEFAULT_RENDERER == RendererTypeForUrl(url)) {
- // Replace the user-agent header with Chrome's.
- updated_headers = ReplaceOrAddUserAgent(*additional_headers,
- http_utils::GetChromeUserAgent());
- } else {
- // Add "chromeframe" user-agent string.
- updated_headers = AppendCFUserAgentString(headers, *additional_headers);
- }
-
- *additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemRealloc(
- *additional_headers, (updated_headers.length() + 1) * sizeof(wchar_t)));
- lstrcpyW(*additional_headers, ASCIIToWide(updated_headers).c_str());
- }
- return hr;
-}
-
-STDMETHODIMP UserAgentAddOn::OnResponse(DWORD response_code,
- LPCWSTR response_headers, LPCWSTR request_headers,
- LPWSTR* additional_headers) {
- HRESULT hr = S_OK;
- if (delegate_) {
- hr = delegate_->OnResponse(response_code, response_headers, request_headers,
- additional_headers);
- }
- return hr;
-}
diff --git a/chrome_frame/http_negotiate.h b/chrome_frame/http_negotiate.h
index a4d135a..eb17c7f 100644
--- a/chrome_frame/http_negotiate.h
+++ b/chrome_frame/http_negotiate.h
@@ -52,15 +52,6 @@ class HttpNegotiatePatch {
IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me,
LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers);
- // IBindStatusCallback patch methods
- static STDMETHODIMP StartBinding(IBindStatusCallback_StartBinding_Fn original,
- IBindStatusCallback* me, DWORD reserved, IBinding *binding);
-
- // IInternetProtocolSink patch methods
- static STDMETHODIMP ReportProgress(
- IInternetProtocolSink_ReportProgress_Fn original,
- IInternetProtocolSink* me, ULONG status_code, LPCWSTR status_text);
-
protected:
static HRESULT PatchHttpNegotiate(IUnknown* to_patch);
@@ -68,10 +59,6 @@ class HttpNegotiatePatch {
DISALLOW_COPY_AND_ASSIGN(HttpNegotiatePatch);
};
-// Attempts to get to the associated browser service for an active request.
-HRESULT GetBrowserServiceFromProtocolSink(IInternetProtocolSink* sink,
- IBrowserService** browser_service);
-
// From the latest urlmon.h. Symbol name prepended with LOCAL_ to
// avoid conflict (and therefore build errors) for those building with
// a newer Windows SDK.
@@ -94,27 +81,4 @@ std::string AppendCFUserAgentString(LPCWSTR headers,
std::string ReplaceOrAddUserAgent(LPCWSTR headers,
const std::string& user_agent_value);
-// Simple class that wraps IHttpNegotiate interface and adds "chromeframe"
-// to User-agent Http header.
-class UserAgentAddOn : public IHttpNegotiate {
- public:
- UserAgentAddOn() {}
- ~UserAgentAddOn() {}
- void set_delegate(IHttpNegotiate* delegate) {
- delegate_ = delegate;
- }
-
- bool has_delegate() const {
- return delegate_ != NULL;
- }
-
- protected:
- // IHttpNegotiate
- STDMETHOD(BeginningTransaction)(LPCWSTR url, LPCWSTR headers, DWORD reserved,
- LPWSTR* additional_headers);
- STDMETHOD(OnResponse)(DWORD response_code, LPCWSTR response_headers,
- LPCWSTR request_headers, LPWSTR* additional_headers);
- ScopedComPtr<IHttpNegotiate> delegate_;
-};
-
#endif // CHROME_FRAME_HTTP_NEGOTIATE_H_
diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc
index 5757234..0ea330f 100644
--- a/chrome_frame/protocol_sink_wrap.cc
+++ b/chrome_frame/protocol_sink_wrap.cc
@@ -104,48 +104,6 @@ ScopedComPtr<IInternetProtocolSink> ProtocolSinkWrap::CreateNewSink(
return ScopedComPtr<IInternetProtocolSink>(new_sink);
}
-HRESULT ProtocolSinkWrap::ObtainServiceProvider() {
- HRESULT hr = S_OK;
- if (!delegate_service_provider_) {
- hr = delegate_service_provider_.QueryFrom(delegate_);
- }
- return hr;
-}
-
-HRESULT ProtocolSinkWrap::ObtainHttpNegotiate() {
- if (UserAgentAddOn::has_delegate())
- return S_OK;
-
- HRESULT hr = ObtainServiceProvider();
- if (hr == S_OK) {
- ScopedComPtr<IHttpNegotiate> http_negotiate;
- hr = delegate_service_provider_->QueryService(
- IID_IHttpNegotiate,
- IID_IHttpNegotiate,
- reinterpret_cast<void**>(http_negotiate.Receive()));
- UserAgentAddOn::set_delegate(http_negotiate);
- }
- return hr;
-}
-
-STDMETHODIMP ProtocolSinkWrap::QueryService(REFGUID guidService, REFIID riid,
- void** ppvObject) {
- // We really insist to append "chromeframe" user-agent header, even in the
- // very unlikely case when delegate does not support IServiceProvider and/or
- // IHttpNegotiate.
- if (guidService == IID_IHttpNegotiate && riid == IID_IHttpNegotiate) {
- ObtainHttpNegotiate();
- AddRef();
- *ppvObject = reinterpret_cast<void**>(static_cast<IHttpNegotiate*>(this));
- return S_OK;
- }
-
- HRESULT hr = ObtainServiceProvider();
- if (hr == S_OK)
- hr = delegate_service_provider_->QueryService(guidService, riid, ppvObject);
- return hr;
-}
-
// IInternetProtocolSink methods
STDMETHODIMP ProtocolSinkWrap::Switch(PROTOCOLDATA* protocol_data) {
HRESULT hr = E_FAIL;
diff --git a/chrome_frame/protocol_sink_wrap.h b/chrome_frame/protocol_sink_wrap.h
index 24810aa..3c6897a 100644
--- a/chrome_frame/protocol_sink_wrap.h
+++ b/chrome_frame/protocol_sink_wrap.h
@@ -57,13 +57,10 @@ class ProtData;
// but delegate simply the QI.
class ProtocolSinkWrap
: public CComObjectRootEx<CComMultiThreadModel>,
- public IServiceProvider,
- public UserAgentAddOn, // implements IHttpNegotiate
public IInternetProtocolSink {
public:
BEGIN_COM_MAP(ProtocolSinkWrap)
- COM_INTERFACE_ENTRY(IServiceProvider)
COM_INTERFACE_ENTRY(IInternetProtocolSink)
COM_INTERFACE_BLIND_DELEGATE()
END_COM_MAP()
@@ -87,13 +84,6 @@ END_COM_MAP()
STDMETHOD(ReportData)(DWORD flags, ULONG progress, ULONG max_progress);
STDMETHOD(ReportResult)(HRESULT result, DWORD error, LPCWSTR result_text);
- // IServiceProvider - return our HttpNegotiate or forward to delegate
- STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void** ppvObject);
-
- // Helpers.
- HRESULT ObtainHttpNegotiate();
- HRESULT ObtainServiceProvider();
-
// Remember original sink
base::win::ScopedComPtr<IInternetProtocolSink> delegate_;
base::win::ScopedComPtr<IServiceProvider> delegate_service_provider_;
diff --git a/chrome_frame/test/http_negotiate_unittest.cc b/chrome_frame/test/http_negotiate_unittest.cc
index 2fef40b..c56034b 100644
--- a/chrome_frame/test/http_negotiate_unittest.cc
+++ b/chrome_frame/test/http_negotiate_unittest.cc
@@ -185,96 +185,6 @@ END_COM_MAP()
base::win::ScopedComPtr<IWebBrowser2> browser_;
};
-TEST_F(HttpNegotiateTest, ReportProgress) {
- if (chrome_frame_test::GetInstalledIEVersion() == IE_6) {
- DVLOG(1) << "Not running test for IE6";
- return;
- }
- static const int kReportProgressIndex = 4;
- CComObjectStackEx<TestInternetProtocolSink> test_sink;
- IInternetProtocolSink_ReportProgress_Fn original =
- reinterpret_cast<IInternetProtocolSink_ReportProgress_Fn>(
- (*reinterpret_cast<void***>(
- static_cast<IInternetProtocolSink*>(
- &test_sink)))[kReportProgressIndex]);
-
- struct TestCase {
- bool mark_browser_;
- const ULONG status_;
- const std::wstring status_text_;
- const std::wstring expected_status_text_;
- } test_cases[] = {
- // Cases where we could switch the mime type.
- { true,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
- { true,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
- { true,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"text/html",
- kChromeMimeType },
- { false,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"text/html",
- L"text/html" },
-
- // Cases where we mark the browser but can't switch due to mime type.
- { true,
- BINDSTATUS_MIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
- { true,
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
- { true,
- LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE,
- L"application/pdf",
- L"application/pdf" },
-
- // Cases where we should do nothing.
- { false,
- BINDSTATUS_CONNECTING,
- L"foo",
- L"foo" },
- { false,
- BINDSTATUS_UPLOADINGDATA,
- L"bar",
- L"bar" },
- };
-
- base::win::ScopedComPtr<IBrowserService> browser;
- EXPECT_HRESULT_SUCCEEDED(GetBrowserServiceFromProtocolSink(&test_sink,
- browser.Receive()));
-
- for (int i = 0; i < arraysize(test_cases); ++i) {
- TestCase& test = test_cases[i];
- if (test.mark_browser_) {
- MarkBrowserOnThreadForCFNavigation(browser);
- }
-
- HRESULT hr = HttpNegotiatePatch::ReportProgress(original, &test_sink,
- test.status_, test.status_text_.c_str());
- EXPECT_EQ(S_OK, hr);
- // The TLS flag should always be cleared.
- EXPECT_FALSE(CheckForCFNavigation(browser, false));
- EXPECT_EQ(test.expected_status_text_, test_sink.last_status_text());
- EXPECT_EQ(test.status_, test_sink.last_status());
- }
-}
-
using testing::AllOf;
using testing::ContainsRegex;
using testing::HasSubstr;
diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc
index b760857..c8861d9 100644
--- a/chrome_frame/test/navigation_test.cc
+++ b/chrome_frame/test/navigation_test.cc
@@ -69,10 +69,6 @@ TEST_P(FullTabNavigationTest, TypeUrl) {
// This tests navigation to a typed URL containing an fragment.
TEST_P(FullTabNavigationTest, TypeAnchorUrl) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
MockAccEventObserver acc_observer;
EXPECT_CALL(acc_observer, OnAccDocLoad(_)).Times(testing::AnyNumber());
AccObjectMatcher address_matcher(L"Address", L"editable text");
@@ -284,10 +280,6 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
LOG(ERROR) << "Test disabled for this configuration.";
return;
}
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
MockWindowObserver win_observer_mock;
ScopedComPtr<IInternetSecurityManager> security_manager;
@@ -300,8 +292,6 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
EXPECT_CALL(ie_mock_, OnFileDownload(_, _)).Times(testing::AnyNumber());
server_mock_.ExpectAndServeAnyRequests(GetParam());
- ProtocolPatchMethod patch_method = GetPatchMethod();
-
const char* kAlertDlgCaption = "Security Alert";
EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
@@ -311,13 +301,11 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) {
.Times(1)
.WillOnce(WatchWindow(&win_observer_mock, kAlertDlgCaption, ""));
- if (patch_method == PATCH_METHOD_INET_PROTOCOL) {
- EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
- _,
- testing::Field(&VARIANT::bstrVal, testing::HasSubstr(L"res://")),
- _, _, _, _, _))
- .Times(testing::AtMost(1));
- }
+ EXPECT_CALL(ie_mock_, OnBeforeNavigate2(
+ _,
+ testing::Field(&VARIANT::bstrVal, testing::HasSubstr(L"res://")),
+ _, _, _, _, _))
+ .Times(testing::AtMost(1));
EXPECT_CALL(ie_mock_, OnNavigateComplete2(_,
testing::Field(&VARIANT::bstrVal, StrEq(GetSimplePageUrl()))))
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index db057ff..0fca76c 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -921,22 +921,12 @@ const wchar_t kAnchorUrlNavigate[] =
L"fulltab_anchor_url_navigate.html#chrome_frame";
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_AnchorUrlNavigateTest) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
SimpleBrowserTest(IE, kAnchorUrlNavigate);
}
// Test whether POST-ing a form from an mshtml page to a CF page will cause
// the request to get reissued. It should not.
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestPostReissue) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
// The order of pages in this array is assumed to be mshtml, cf, script.
const wchar_t* kPages[] = {
L"full_tab_post_mshtml.html",
@@ -968,11 +958,6 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestPostReissue) {
// Test whether following a link from an mshtml page to a CF page will cause
// multiple network requests. It should not.
TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestMultipleGet) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
-
// The order of pages in this array is assumed to be mshtml, cf, script.
const wchar_t* kPages[] = {
L"full_tab_get_mshtml.html",
diff --git a/chrome_frame/test/ui_test.cc b/chrome_frame/test/ui_test.cc
index a355d0e..169bcc1 100644
--- a/chrome_frame/test/ui_test.cc
+++ b/chrome_frame/test/ui_test.cc
@@ -193,10 +193,6 @@ TEST_P(FullTabUITest, FLAKY_CtrlW) {
// Test address bar navigation with Alt+d and URL.
TEST_P(FullTabUITest, FLAKY_AltD) {
- if (IsIBrowserServicePatchEnabled()) {
- LOG(ERROR) << "Not running test. IBrowserServicePatch is in place.";
- return;
- }
EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(),
StrEq(GetSimplePageUrl())))
.WillOnce(testing::DoAll(
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index eff1331..294f044 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -1180,18 +1180,6 @@ bool IsTextHtmlClipFormat(CLIPFORMAT cf) {
return cf == GetTextHtmlClipboardFormat();
}
-ProtocolPatchMethod GetPatchMethod() {
- ProtocolPatchMethod patch_method =
- static_cast<ProtocolPatchMethod>(
- GetConfigInt(PATCH_METHOD_INET_PROTOCOL, kPatchProtocols));
- return patch_method;
-}
-
-bool IsIBrowserServicePatchEnabled() {
- ProtocolPatchMethod patch_method = GetPatchMethod();
- return patch_method == PATCH_METHOD_IBROWSER;
-}
-
bool IsSystemProcess() {
bool is_system = false;
CAccessToken process_token;
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index 7cafc26..11b749b 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -42,20 +42,6 @@ extern const wchar_t kEnableGCFRendererByDefault[];
extern const wchar_t kIexploreProfileName[];
extern const wchar_t kRundllProfileName[];
-typedef enum ProtocolPatchMethod {
- PATCH_METHOD_IBROWSER = 0,
- PATCH_METHOD_INET_PROTOCOL, // 1
- PATCH_METHOD_MONIKER, // 2
-};
-
-// A REG_DWORD config value that maps to the ProtocolPatchMethod enum.
-// To get the config value, call:
-// ProtocolPatchMethod patch_method =
-// static_cast<ProtocolPatchMethod>(
-// GetConfigInt(PATCH_METHOD_IBROWSER, kPatchProtocols));
-extern const wchar_t kPatchProtocols[];
-
-
// This function is very similar to the AtlRegisterTypeLib function except
// that it takes a parameter that specifies whether to register the typelib
// for the current user only or on a machine-wide basis
@@ -498,13 +484,6 @@ bool IsTextHtmlMimeType(const wchar_t* mime_type);
// Returns true iff the clipboard format is text/html.
bool IsTextHtmlClipFormat(CLIPFORMAT cf);
-// Returns the desired patch method (moniker, http_equiv, protocol sink).
-// Defaults to moniker patch.
-ProtocolPatchMethod GetPatchMethod();
-
-// Returns true if the IMoniker patch is enabled.
-bool IsIBrowserServicePatchEnabled();
-
// Returns true if we can detect that we are running as SYSTEM, false otherwise.
bool IsSystemProcess();