diff options
-rw-r--r-- | chrome_frame/bind_context_info.cc | 7 | ||||
-rw-r--r-- | chrome_frame/bind_context_info.h | 20 | ||||
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 4 | ||||
-rw-r--r-- | chrome_frame/protocol_sink_wrap.h | 4 | ||||
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.cc | 13 | ||||
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 2 |
6 files changed, 22 insertions, 28 deletions
diff --git a/chrome_frame/bind_context_info.cc b/chrome_frame/bind_context_info.cc index b1f9565..28cb239 100644 --- a/chrome_frame/bind_context_info.cc +++ b/chrome_frame/bind_context_info.cc @@ -79,3 +79,10 @@ void BindContextInfo::SetToSwitch(IStream* cache) { } } +std::wstring BindContextInfo::GetUrl() { + if (has_prot_data()) { + return prot_data_->url(); + } + return std::wstring(); +} + diff --git a/chrome_frame/bind_context_info.h b/chrome_frame/bind_context_info.h index d6c5d22..e9add10 100644 --- a/chrome_frame/bind_context_info.h +++ b/chrome_frame/bind_context_info.h @@ -65,21 +65,6 @@ class __declspec(uuid("00000000-0000-0000-0000-000000000000")) BindContextInfo return cache_; } - // Accept a const wchar_t* to ensure that we don't have a reference - // to someone else's buffer. - void set_url(const wchar_t* url) { - DCHECK(url); - if (url) { - url_ = url; - } else { - url_.clear(); - } - } - - const std::wstring& url() const { - return url_; - } - void set_prot_data(ProtData* data) { prot_data_ = data; } @@ -100,6 +85,10 @@ class __declspec(uuid("00000000-0000-0000-0000-000000000000")) BindContextInfo return protocol_.get(); } + // Returns the url being navigated to. We retrieve the url from the ProtData + // instance which wraps the underlying protocol sink. + std::wstring GetUrl(); + protected: STDMETHOD(GetCppObject)(void** me) { DCHECK(me); @@ -115,7 +104,6 @@ class __declspec(uuid("00000000-0000-0000-0000-000000000000")) BindContextInfo bool no_cache_; bool chrome_request_; bool is_switching_; - std::wstring url_; base::win::ScopedComPtr<IUnknown> ftm_; scoped_refptr<ProtData> prot_data_; ScopedComPtr<IInternetProtocol> protocol_; diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index f0a2e76..3db9f4c 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -248,8 +248,8 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context, info.Receive()); DCHECK(info); - if (info && !info->url().empty()) { - url = info->url(); + if (info && !info->GetUrl().empty()) { + url = info->GetUrl(); } else { // If the original URL contains an anchor, then the URL queried // from the moniker does not contain the anchor. To workaround diff --git a/chrome_frame/protocol_sink_wrap.h b/chrome_frame/protocol_sink_wrap.h index eccd6a5..1aa0e10 100644 --- a/chrome_frame/protocol_sink_wrap.h +++ b/chrome_frame/protocol_sink_wrap.h @@ -130,6 +130,10 @@ class ProtData : public base::RefCounted<ProtData> { // Removes the mapping between the protocol and the ProtData. void Invalidate(); + const std::wstring& url() const { + return url_; + } + private: typedef std::map<IInternetProtocol*, ProtData*> ProtocolDataMap; static ProtocolDataMap datamap_; diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index 34520ef..f060155 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -249,15 +249,10 @@ STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max, HRESULT hr = S_OK; - // Remember the last redirected URL in case we get switched into - // chrome frame - if (status_code == BINDSTATUS_REDIRECTING) { - ScopedComPtr<BindContextInfo> info; - BindContextInfo::FromBindContext(bind_ctx_, info.Receive()); - DCHECK(info); - if (info) - info->set_url(status_text); - } + // TODO(ananta) + // ChromeFrame will not be informed of any redirects which occur while we + // switch into Chrome. This will only break the moniker patch which is + // legacy and needs to be deleted. if (ShouldCacheProgress(status_code)) { saved_progress_.push_back(new Progress(progress, progress_max, status_code, diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index c5c9bd5..c803263 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -289,7 +289,7 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress, ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context_, info.Receive()); DCHECK(info); - GURL previously_redirected(info ? info->url() : std::wstring()); + GURL previously_redirected(info ? info->GetUrl() : std::wstring()); if (GURL(status_text) != previously_redirected) { DVLOG(1) << __FUNCTION__ << me() << "redirect from " << url() << " to " << status_text; |