diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 20:53:23 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 20:53:23 +0000 |
commit | 8ee65baac4ab9e3beb67674adbc6a210e2708604 (patch) | |
tree | 44400d118d7813a8d7e16a67f074c6696f8868b3 /chrome_frame | |
parent | f1094b0275c82ead4b9aabbda24f5c2b3e8b4a1b (diff) | |
download | chromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.zip chromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.tar.gz chromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.tar.bz2 |
Include base/win/scoped_comptr.h instead of base/scoped_comptr_win.h.
Fix up all the callers to use the new location and namespace.
Also, delete the stub file since it isn't included by anyone more.
(Note: This was a TODO for brettw).
BUG=None
TEST=None
R=brettw@chromium.org
Review URL: http://codereview.chromium.org/6825055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
45 files changed, 287 insertions, 282 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc index 5ac26f4..f6b87a4 100644 --- a/chrome_frame/bho.cc +++ b/chrome_frame/bho.cc @@ -94,7 +94,7 @@ void ReadyModeDelegateImpl::DisableChromeFrame() { STDMETHODIMP Bho::SetSite(IUnknown* site) { HRESULT hr = S_OK; if (site) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; web_browser2.QueryFrom(site); if (web_browser2) { hr = DispEventAdvise(web_browser2, &DIID_DWebBrowserEvents2); @@ -104,7 +104,7 @@ STDMETHODIMP Bho::SetSite(IUnknown* site) { } if (g_patch_helper.state() == PatchHelper::PATCH_IBROWSER) { - ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<IBrowserService> browser_service; hr = DoQueryService(SID_SShellBrowser, site, browser_service.Receive()); DCHECK(browser_service) << "DoQueryService - SID_SShellBrowser failed." << " Site: " << site << " Error: " << hr; @@ -128,7 +128,7 @@ STDMETHODIMP Bho::SetSite(IUnknown* site) { } else { UnregisterThreadInstance(); buggy_bho::BuggyBhoTls::DestroyInstance(); - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; web_browser2.QueryFrom(m_spUnkSite); DispEventUnadvise(web_browser2, &DIID_DWebBrowserEvents2); Release(); @@ -145,7 +145,7 @@ STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, return S_OK; } - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; if (dispatch) web_browser2.QueryFrom(dispatch); @@ -156,7 +156,7 @@ STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, DVLOG(1) << "BeforeNavigate2: " << url->bstrVal; - ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<IBrowserService> browser_service; DoQueryService(SID_SShellBrowser, web_browser2, browser_service.Receive()); if (!browser_service || !CheckForCFNavigation(browser_service, false)) { // TODO(tommi): Remove? Isn't this done below by calling set_referrer("")? @@ -181,7 +181,7 @@ STDMETHODIMP_(void) Bho::NavigateComplete2(IDispatch* dispatch, VARIANT* url) { STDMETHODIMP_(void) Bho::DocumentComplete(IDispatch* dispatch, VARIANT* url) { DVLOG(1) << __FUNCTION__; - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; if (dispatch) web_browser2.QueryFrom(dispatch); @@ -199,12 +199,12 @@ namespace { // See comments in Bho::OnHttpEquiv for details. void ClearDocumentContents(IUnknown* browser) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; if (SUCCEEDED(DoQueryService(SID_SWebBrowserApp, browser, web_browser2.Receive()))) { - ScopedComPtr<IDispatch> doc_disp; + base::win::ScopedComPtr<IDispatch> doc_disp; web_browser2->get_Document(doc_disp.Receive()); - ScopedComPtr<IHTMLDocument2> doc; + base::win::ScopedComPtr<IHTMLDocument2> doc; if (doc_disp && SUCCEEDED(doc.QueryFrom(doc_disp))) { SAFEARRAY* sa = ::SafeArrayCreateVector(VT_UI1, 0, 0); doc->write(sa); @@ -218,17 +218,17 @@ void ClearDocumentContents(IUnknown* browser) { bool DocumentHasEmbeddedItems(IUnknown* browser) { bool has_embedded_items = false; - ScopedComPtr<IWebBrowser2> web_browser2; - ScopedComPtr<IDispatch> document; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IDispatch> document; if (SUCCEEDED(DoQueryService(SID_SWebBrowserApp, browser, web_browser2.Receive())) && SUCCEEDED(web_browser2->get_Document(document.Receive()))) { - ScopedComPtr<IOleContainer> container; + base::win::ScopedComPtr<IOleContainer> container; if (SUCCEEDED(container.QueryFrom(document))) { - ScopedComPtr<IEnumUnknown> enumerator; + base::win::ScopedComPtr<IEnumUnknown> enumerator; container->EnumObjects(OLECONTF_EMBEDDINGS, enumerator.Receive()); if (enumerator) { - ScopedComPtr<IUnknown> unk; + base::win::ScopedComPtr<IUnknown> unk; DWORD fetched = 0; while (!has_embedded_items && SUCCEEDED(enumerator->Next(1, unk.Receive(), &fetched)) @@ -237,7 +237,7 @@ bool DocumentHasEmbeddedItems(IUnknown* browser) { // that first the top level document finishes loading and then the // iframes load. We should only treat an embedded element as an // iframe if it supports the IWebBrowser interface. - ScopedComPtr<IWebBrowser2> embedded_web_browser2; + base::win::ScopedComPtr<IWebBrowser2> embedded_web_browser2; if (SUCCEEDED(embedded_web_browser2.QueryFrom(unk))) { // If we initiate a top level navigation then at times MSHTML // creates a temporary IWebBrowser2 interface which basically shows @@ -340,7 +340,7 @@ void Bho::ProcessOptInUrls(IWebBrowser2* browser, BSTR url) { bool cf_protocol = StartsWith(current_url, kChromeProtocolPrefix, false); if (!cf_protocol && IsChrome(RendererTypeForUrl(current_url))) { DVLOG(1) << "Opt-in URL. Switching to cf."; - ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<IBrowserService> browser_service; DoQueryService(SID_SShellBrowser, browser, browser_service.Receive()); DCHECK(browser_service) << "DoQueryService - SID_SShellBrowser failed."; MarkBrowserOnThreadForCFNavigation(browser_service); diff --git a/chrome_frame/bho.h b/chrome_frame/bho.h index d1f232d..111eb04 100644 --- a/chrome_frame/bho.h +++ b/chrome_frame/bho.h @@ -111,7 +111,7 @@ END_SINK_MAP() static void ProcessOptInUrls(IWebBrowser2* browser, BSTR url); // COM_INTERFACE_ENTRY_CACHED_TEAR_OFF manages the raw pointer from CComPtr - // which ScopedComPtr doesn't expose. + // which base::win::ScopedComPtr doesn't expose. CComPtr<IUnknown> delete_chrome_history_; protected: diff --git a/chrome_frame/bind_context_info.cc b/chrome_frame/bind_context_info.cc index 89d6991..bfdf89a 100644 --- a/chrome_frame/bind_context_info.cc +++ b/chrome_frame/bind_context_info.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -39,11 +39,11 @@ HRESULT BindContextInfo::FromBindContext(IBindCtx* bind_context, return E_POINTER; } - ScopedComPtr<IUnknown> context; + base::win::ScopedComPtr<IUnknown> context; HRESULT hr = bind_context->GetObjectParam(kBindContextInfo, context.Receive()); if (context) { - ScopedComPtr<IBindContextInfoInternal> internal; + base::win::ScopedComPtr<IBindContextInfoInternal> internal; hr = internal.QueryFrom(context); if (SUCCEEDED(hr)) { hr = internal->GetCppObject(reinterpret_cast<void**>(info)); diff --git a/chrome_frame/bind_context_info.h b/chrome_frame/bind_context_info.h index e9add10..7c0e421 100644 --- a/chrome_frame/bind_context_info.h +++ b/chrome_frame/bind_context_info.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -35,7 +35,7 @@ class __declspec(uuid("00000000-0000-0000-0000-000000000000")) BindContextInfo // Returns the BindContextInfo instance associated with the bind // context. Creates it if needed. // The returned info object will be AddRef-ed on return, so use - // ScopedComPtr<>::Receive() to receive this pointer. + // base::win::ScopedComPtr<>::Receive() to receive this pointer. static HRESULT FromBindContext(IBindCtx* bind_context, BindContextInfo** info); @@ -106,7 +106,7 @@ class __declspec(uuid("00000000-0000-0000-0000-000000000000")) BindContextInfo bool is_switching_; base::win::ScopedComPtr<IUnknown> ftm_; scoped_refptr<ProtData> prot_data_; - ScopedComPtr<IInternetProtocol> protocol_; + base::win::ScopedComPtr<IInternetProtocol> protocol_; DISALLOW_COPY_AND_ASSIGN(BindContextInfo); }; diff --git a/chrome_frame/bind_status_callback_impl.cc b/chrome_frame/bind_status_callback_impl.cc index 9e535e5..4a3c588 100644 --- a/chrome_frame/bind_status_callback_impl.cc +++ b/chrome_frame/bind_status_callback_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -65,7 +65,7 @@ HRESULT BSCBImpl::ReleaseBind() { HRESULT BSCBImpl::QueryService(REFGUID service, REFIID iid, void** object) { HRESULT hr = E_NOINTERFACE; if (delegate_) { - ScopedComPtr<IServiceProvider> svc; + base::win::ScopedComPtr<IServiceProvider> svc; svc.QueryFrom(delegate_); if (svc) { hr = svc->QueryService(service, iid, object); @@ -159,7 +159,7 @@ HRESULT BSCBImpl::GetBindInfoEx(DWORD* bindf, BINDINFO* bind_info, << base::StringPrintf(" tid=%i", base::PlatformThread::CurrentId()); HRESULT hr = S_OK; if (delegate_) { - ScopedComPtr<IBindStatusCallbackEx> bscbex; + base::win::ScopedComPtr<IBindStatusCallbackEx> bscbex; bscbex.QueryFrom(delegate_); if (bscbex) hr = bscbex->GetBindInfoEx(bindf, bind_info, bindf2, reserved); @@ -175,7 +175,7 @@ HRESULT BSCBImpl::BeginningTransaction(LPCWSTR url, LPCWSTR headers, HRESULT hr = S_OK; if (delegate_) { - ScopedComPtr<IHttpNegotiate> http_negotiate; + base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; http_negotiate.QueryFrom(delegate_); if (http_negotiate) { hr = http_negotiate->BeginningTransaction(url, headers, reserved, @@ -195,7 +195,7 @@ HRESULT BSCBImpl::OnResponse(DWORD response_code, LPCWSTR response_headers, HRESULT hr = S_OK; if (delegate_) { - ScopedComPtr<IHttpNegotiate> http_negotiate; + base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; http_negotiate.QueryFrom(delegate_); if (http_negotiate) { hr = http_negotiate->OnResponse(response_code, response_headers, @@ -209,7 +209,7 @@ HRESULT BSCBImpl::GetRootSecurityId(BYTE* security_id, DWORD* security_id_size, DWORD_PTR reserved) { HRESULT hr = S_OK; if (delegate_) { - ScopedComPtr<IHttpNegotiate2> http_negotiate; + base::win::ScopedComPtr<IHttpNegotiate2> http_negotiate; http_negotiate.QueryFrom(delegate_); if (http_negotiate) { hr = http_negotiate->GetRootSecurityId(security_id, security_id_size, @@ -223,7 +223,7 @@ HRESULT BSCBImpl::GetSerializedClientCertContext(BYTE** cert, DWORD* cert_size) { HRESULT hr = S_OK; if (delegate_) { - ScopedComPtr<IHttpNegotiate3> http_negotiate; + base::win::ScopedComPtr<IHttpNegotiate3> http_negotiate; http_negotiate.QueryFrom(delegate_); if (http_negotiate) { return http_negotiate->GetSerializedClientCertContext(cert, cert_size); diff --git a/chrome_frame/bind_status_callback_impl.h b/chrome_frame/bind_status_callback_impl.h index 7066050..57245e4 100644 --- a/chrome_frame/bind_status_callback_impl.h +++ b/chrome_frame/bind_status_callback_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,7 +10,7 @@ #include <string> #include <urlmon.h> -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/utils.h" // A generic base class for IBindStatus callback implementation. @@ -88,8 +88,8 @@ END_COM_MAP() // used for logging. std::string me(); - ScopedComPtr<IBindStatusCallback> delegate_; - ScopedComPtr<IBindCtx> bind_ctx_; + base::win::ScopedComPtr<IBindStatusCallback> delegate_; + base::win::ScopedComPtr<IBindCtx> bind_ctx_; private: DISALLOW_COPY_AND_ASSIGN(BSCBImpl); diff --git a/chrome_frame/buggy_bho_handling.cc b/chrome_frame/buggy_bho_handling.cc index bcd2427..227c999 100644 --- a/chrome_frame/buggy_bho_handling.cc +++ b/chrome_frame/buggy_bho_handling.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome_frame/buggy_bho_handling.h" #include "base/logging.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/exception_barrier.h" #include "chrome_frame/function_stub.h" @@ -125,15 +125,15 @@ HRESULT BuggyBhoTls::PatchBuggyBHOs(IWebBrowser2* browser) { DCHECK(browser); DCHECK(web_browser2_ == NULL); - ScopedComPtr<IConnectionPointContainer> cpc; + base::win::ScopedComPtr<IConnectionPointContainer> cpc; HRESULT hr = cpc.QueryFrom(browser); if (SUCCEEDED(hr)) { const GUID sinks[] = { DIID_DWebBrowserEvents2, DIID_DWebBrowserEvents }; for (size_t i = 0; i < arraysize(sinks); ++i) { - ScopedComPtr<IConnectionPoint> cp; + base::win::ScopedComPtr<IConnectionPoint> cp; cpc->FindConnectionPoint(sinks[i], cp.Receive()); if (cp) { - ScopedComPtr<IEnumConnections> connections; + base::win::ScopedComPtr<IEnumConnections> connections; cp->EnumConnections(connections.Receive()); if (connections) { CONNECTDATA cd = {0}; @@ -159,7 +159,7 @@ bool BuggyBhoTls::PatchIfBuggy(IUnknown* unk, const IID& diid) { if (!IsBuggyBho(mod)) return false; - ScopedComPtr<IDispatch> disp; + base::win::ScopedComPtr<IDispatch> disp; HRESULT hr = unk->QueryInterface(diid, reinterpret_cast<void**>(disp.Receive())); if (FAILED(hr)) // Sometimes only IDispatch QI is supported diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index a75a6cd..98c4d76 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -30,7 +30,6 @@ #include "base/utf_string_conversions.h" #include "base/win/scoped_variant.h" #include "base/win/win_util.h" -#include "grit/generated_resources.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/common/automation_messages.h" @@ -45,6 +44,7 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/common/navigation_types.h" #include "content/common/page_zoom.h" +#include "grit/generated_resources.h" DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46); @@ -154,7 +154,7 @@ STDMETHODIMP ChromeActiveDocument::DoVerb(LONG verb, if (doc_site_) { switch (verb) { case OLEIVERB_SHOW: { - ScopedComPtr<IDocHostUIHandler> doc_host_handler; + base::win::ScopedComPtr<IDocHostUIHandler> doc_host_handler; doc_host_handler.QueryFrom(doc_site_); if (doc_host_handler.get()) doc_host_handler->ShowUI(DOCHOSTUITYPE_BROWSE, this, this, NULL, NULL); @@ -215,9 +215,9 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, if (NULL == moniker_name) return E_INVALIDARG; - ScopedComPtr<IOleClientSite> client_site; + base::win::ScopedComPtr<IOleClientSite> client_site; if (bind_context) { - ScopedComPtr<IUnknown> site; + base::win::ScopedComPtr<IUnknown> site; bind_context->GetObjectParam(SZ_HTML_CLIENTSITE_OBJECTPARAM, site.Receive()); if (site) @@ -232,7 +232,7 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, // See if mshtml parsed the html header for us. If so, we need to // clear the browser service flag that we use to indicate that this // browser instance is navigating to a CF document. - ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<IBrowserService> browser_service; DoQueryService(SID_SShellBrowser, client_site, browser_service.Receive()); if (browser_service) { bool flagged = CheckForCFNavigation(browser_service, true); @@ -245,7 +245,7 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, std::wstring url; - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context, info.Receive()); DCHECK(info); if (info && !info->GetUrl().empty()) { @@ -550,7 +550,7 @@ HRESULT ChromeActiveDocument::IOleObject_SetClientSite( cached_document->Release(); } - ScopedComPtr<IDocHostUIHandler> doc_host_handler; + base::win::ScopedComPtr<IDocHostUIHandler> doc_host_handler; if (doc_site_) doc_host_handler.QueryFrom(doc_site_); @@ -578,7 +578,7 @@ HRESULT ChromeActiveDocument::ActiveXDocActivate(LONG verb) { m_bInPlaceActive = TRUE; // get location in the parent window, // as well as some information about the parent - ScopedComPtr<IOleInPlaceUIWindow> in_place_ui_window; + base::win::ScopedComPtr<IOleInPlaceUIWindow> in_place_ui_window; frame_info_.cb = sizeof(OLEINPLACEFRAMEINFO); HWND parent_window = NULL; if (m_spInPlaceSite->GetWindow(&parent_window) == S_OK) { @@ -607,7 +607,7 @@ HRESULT ChromeActiveDocument::ActiveXDocActivate(LONG verb) { SetObjectRects(&position_rect, &clip_rect); } - ScopedComPtr<IOleInPlaceActiveObject> in_place_active_object(this); + base::win::ScopedComPtr<IOleInPlaceActiveObject> in_place_active_object(this); // Gone active by now, take care of UIACTIVATE if (DoesVerbUIActivate(verb)) { @@ -707,7 +707,7 @@ void ChromeActiveDocument::OnCloseTab() { BaseActiveX::OnCloseTab(); // Close the container window. - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); if (web_browser2) web_browser2->Quit(); @@ -754,7 +754,7 @@ void ChromeActiveDocument::UpdateNavigationState( // event sink's of these bho's and don't invoke the event sink if chrome // frame is the currently loaded document. if (GetConfigBool(true, kEnableBuggyBhoIntercept)) { - ScopedComPtr<IWebBrowser2> wb2; + base::win::ScopedComPtr<IWebBrowser2> wb2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, wb2.Receive()); if (wb2 && buggy_bho::BuggyBhoTls::GetInstance()) { buggy_bho::BuggyBhoTls::GetInstance()->PatchBuggyBHOs(wb2); @@ -788,8 +788,8 @@ void ChromeActiveDocument::UpdateNavigationState( url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); if (is_internal_navigation) { - ScopedComPtr<IDocObjectService> doc_object_svc; - ScopedComPtr<IWebBrowserEventsService> web_browser_events_svc; + base::win::ScopedComPtr<IDocObjectService> doc_object_svc; + base::win::ScopedComPtr<IWebBrowserEventsService> web_browser_events_svc; DoQueryService(__uuidof(web_browser_events_svc), m_spClientSite, web_browser_events_svc.Receive()); @@ -982,8 +982,8 @@ void ChromeActiveDocument::OnAttachExternalTab( } bool ChromeActiveDocument::PreProcessContextMenu(HMENU menu) { - ScopedComPtr<IBrowserService> browser_service; - ScopedComPtr<ITravelLog> travel_log; + base::win::ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<ITravelLog> travel_log; GetBrowserServiceAndTravelLog(browser_service.Receive(), travel_log.Receive()); if (!browser_service || !travel_log) @@ -1003,7 +1003,7 @@ bool ChromeActiveDocument::PreProcessContextMenu(HMENU menu) { bool ChromeActiveDocument::HandleContextMenuCommand( UINT cmd, const MiniContextMenuParams& params) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); if (cmd == IDC_BACK) @@ -1023,9 +1023,9 @@ HRESULT ChromeActiveDocument::IEExec(const GUID* cmd_group_guid, VARIANT* in_args, VARIANT* out_args) { HRESULT hr = E_FAIL; - ScopedComPtr<IOleCommandTarget> frame_cmd_target; + base::win::ScopedComPtr<IOleCommandTarget> frame_cmd_target; - ScopedComPtr<IOleInPlaceSite> in_place_site(m_spInPlaceSite); + base::win::ScopedComPtr<IOleInPlaceSite> in_place_site(m_spInPlaceSite); if (!in_place_site.get() && m_spClientSite != NULL) in_place_site.QueryFrom(m_spClientSite); @@ -1251,8 +1251,8 @@ HRESULT ChromeActiveDocument::OnEncodingChange(const GUID* cmd_group_guid, void ChromeActiveDocument::OnGoToHistoryEntryOffset(int offset) { DVLOG(1) << __FUNCTION__ << " - offset:" << offset; - ScopedComPtr<IBrowserService> browser_service; - ScopedComPtr<ITravelLog> travel_log; + base::win::ScopedComPtr<IBrowserService> browser_service; + base::win::ScopedComPtr<ITravelLog> travel_log; GetBrowserServiceAndTravelLog(browser_service.Receive(), travel_log.Receive()); @@ -1261,7 +1261,7 @@ void ChromeActiveDocument::OnGoToHistoryEntryOffset(int offset) { } void ChromeActiveDocument::OnMoveWindow(const gfx::Rect& dimensions) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); if (!web_browser2) @@ -1289,7 +1289,7 @@ void ChromeActiveDocument::OnMoveWindow(const gfx::Rect& dimensions) { HRESULT ChromeActiveDocument::GetBrowserServiceAndTravelLog( IBrowserService** browser_service, ITravelLog** travel_log) { DCHECK(browser_service || travel_log); - ScopedComPtr<IBrowserService> browser_service_local; + base::win::ScopedComPtr<IBrowserService> browser_service_local; HRESULT hr = DoQueryService(SID_SShellBrowser, m_spClientSite, browser_service_local.Receive()); if (!browser_service_local) { @@ -1311,7 +1311,7 @@ HRESULT ChromeActiveDocument::GetBrowserServiceAndTravelLog( LRESULT ChromeActiveDocument::OnForward(WORD notify_code, WORD id, HWND control_window, BOOL& bHandled) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); DCHECK(web_browser2); @@ -1323,7 +1323,7 @@ LRESULT ChromeActiveDocument::OnForward(WORD notify_code, WORD id, LRESULT ChromeActiveDocument::OnBack(WORD notify_code, WORD id, HWND control_window, BOOL& bHandled) { - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); DCHECK(web_browser2); @@ -1338,7 +1338,7 @@ LRESULT ChromeActiveDocument::OnFirePrivacyChange(UINT message, WPARAM wparam, if (!m_spClientSite) return 0; - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); if (!web_browser2) { @@ -1346,11 +1346,11 @@ LRESULT ChromeActiveDocument::OnFirePrivacyChange(UINT message, WPARAM wparam, return 0; } - ScopedComPtr<IShellBrowser> shell_browser; + base::win::ScopedComPtr<IShellBrowser> shell_browser; DoQueryService(SID_STopLevelBrowser, web_browser2, shell_browser.Receive()); DCHECK(shell_browser.get() != NULL); - ScopedComPtr<ITridentService2> trident_services; + base::win::ScopedComPtr<ITridentService2> trident_services; trident_services.QueryFrom(shell_browser); if (trident_services) trident_services->FirePrivacyImpactedStateChange(wparam); diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index d9e4f73..a720f23 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -16,18 +16,18 @@ #include <string> #include "base/memory/scoped_ptr.h" -#include "base/scoped_comptr_win.h" #include "base/threading/thread.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/chrome_frame_activex_base.h" #include "chrome_frame/com_type_info_holder.h" +#include "chrome_frame/extra_system_apis.h" #include "chrome_frame/find_dialog.h" #include "chrome_frame/html_private_window_impl.h" #include "chrome_frame/html_window_impl.h" #include "chrome_frame/in_place_menu.h" #include "chrome_frame/ole_document_impl.h" #include "chrome_frame/resource.h" -#include "chrome_frame/extra_system_apis.h" #include "chrome_frame/utils.h" class Thread; @@ -467,7 +467,7 @@ END_EXEC_COMMAND_MAP() // a new ChromeActiveDocument instance is taking its place. bool is_automation_client_reused_; - ScopedComPtr<INewWindowManager> popup_manager_; + base::win::ScopedComPtr<INewWindowManager> popup_manager_; bool popup_allowed_; HACCEL accelerator_table_; diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index eb1eb79..62bae43 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -27,8 +27,8 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/automation/tab_proxy.h" -#include "googleurl/src/gurl.h" #include "chrome_frame/utils.h" +#include "googleurl/src/gurl.h" namespace { @@ -198,7 +198,7 @@ LRESULT ChromeFrameActivex::OnHostMoved(UINT message, WPARAM wparam, } HRESULT ChromeFrameActivex::GetContainingDocument(IHTMLDocument2** doc) { - ScopedComPtr<IOleContainer> container; + base::win::ScopedComPtr<IOleContainer> container; HRESULT hr = m_spClientSite->GetContainer(container.Receive()); if (container) hr = container.QueryInterface(doc); @@ -206,7 +206,7 @@ HRESULT ChromeFrameActivex::GetContainingDocument(IHTMLDocument2** doc) { } HRESULT ChromeFrameActivex::GetDocumentWindow(IHTMLWindow2** window) { - ScopedComPtr<IHTMLDocument2> document; + base::win::ScopedComPtr<IHTMLDocument2> document; HRESULT hr = GetContainingDocument(document.Receive()); if (document) hr = document->get_parentWindow(window); @@ -214,7 +214,7 @@ HRESULT ChromeFrameActivex::GetDocumentWindow(IHTMLWindow2** window) { } void ChromeFrameActivex::OnLoad(const GURL& gurl) { - ScopedComPtr<IDispatch> event; + base::win::ScopedComPtr<IDispatch> event; std::string url = gurl.spec(); if (SUCCEEDED(CreateDomEvent("event", url, "", event.Receive()))) Fire_onload(event); @@ -224,7 +224,7 @@ void ChromeFrameActivex::OnLoad(const GURL& gurl) { } void ChromeFrameActivex::OnLoadFailed(int error_code, const std::string& url) { - ScopedComPtr<IDispatch> event; + base::win::ScopedComPtr<IDispatch> event; if (SUCCEEDED(CreateDomEvent("event", url, "", event.Receive()))) Fire_onloaderror(event); @@ -242,7 +242,7 @@ void ChromeFrameActivex::OnMessageFromChromeFrame(const std::string& message, if (is_privileged()) { // Forward messages if the control is in privileged mode. - ScopedComPtr<IDispatch> message_event; + base::win::ScopedComPtr<IDispatch> message_event; if (SUCCEEDED(CreateDomEvent("message", message, origin, message_event.Receive()))) { base::win::ScopedBstr target_bstr(UTF8ToWide(target).c_str()); @@ -263,7 +263,7 @@ void ChromeFrameActivex::OnMessageFromChromeFrame(const std::string& message, return; } - ScopedComPtr<IDispatch> message_event; + base::win::ScopedComPtr<IDispatch> message_event; if (SUCCEEDED(CreateDomEvent("message", message, origin, message_event.Receive()))) { Fire_onmessage(message_event); @@ -284,7 +284,7 @@ bool ChromeFrameActivex::ShouldShowVersionMismatchDialog( } if (client_site) { - ScopedComPtr<IChromeFramePrivileged> service; + base::win::ScopedComPtr<IChromeFramePrivileged> service; HRESULT hr = DoQueryService(SID_ChromeFramePrivileged, client_site, service.Receive()); @@ -346,7 +346,7 @@ STDMETHODIMP ChromeFrameActivex::Load(IPropertyBag* bag, IErrorLog* error_log) { base::win::ScopedBstr object_id; GetObjectScriptId(obj_element, object_id.Receive()); - ScopedComPtr<IHTMLElement2> element; + base::win::ScopedComPtr<IHTMLElement2> element; element.QueryFrom(obj_element); HRESULT hr = S_OK; @@ -431,7 +431,7 @@ HRESULT ChromeFrameActivex::IOleObject_SetClientSite( // Drop privileged mode on uninitialization. set_is_privileged(false); } else { - ScopedComPtr<IHTMLDocument2> document; + base::win::ScopedComPtr<IHTMLDocument2> document; GetContainingDocument(document.Receive()); if (document) { base::win::ScopedBstr url; @@ -440,7 +440,7 @@ HRESULT ChromeFrameActivex::IOleObject_SetClientSite( } // Probe to see whether the host implements the privileged service. - ScopedComPtr<IChromeFramePrivileged> service; + base::win::ScopedComPtr<IChromeFramePrivileged> service; HRESULT service_hr = DoQueryService(SID_ChromeFramePrivileged, m_spClientSite, service.Receive()); @@ -502,7 +502,7 @@ HRESULT ChromeFrameActivex::GetObjectScriptId(IHTMLObjectElement* object_elem, HRESULT hr = E_FAIL; if (object_elem) { - ScopedComPtr<IHTMLElement> elem; + base::win::ScopedComPtr<IHTMLElement> elem; hr = elem.QueryFrom(object_elem); if (elem) { hr = elem->get_id(id); @@ -517,10 +517,10 @@ HRESULT ChromeFrameActivex::GetObjectElement(IHTMLObjectElement** element) { if (!m_spClientSite) return E_UNEXPECTED; - ScopedComPtr<IOleControlSite> site; + base::win::ScopedComPtr<IOleControlSite> site; HRESULT hr = site.QueryFrom(m_spClientSite); if (site) { - ScopedComPtr<IDispatch> disp; + base::win::ScopedComPtr<IDispatch> disp; hr = site->GetExtendedControl(disp.Receive()); if (disp) { hr = disp.QueryInterface(element); @@ -545,14 +545,14 @@ HRESULT ChromeFrameActivex::CreateScriptBlockForEvent( return E_INVALIDARG; } - ScopedComPtr<IHTMLDocument2> document; + base::win::ScopedComPtr<IHTMLDocument2> document; HRESULT hr = GetContainingDocument(document.Receive()); if (SUCCEEDED(hr)) { - ScopedComPtr<IHTMLElement> element, new_element; + base::win::ScopedComPtr<IHTMLElement> element, new_element; document->createElement(base::win::ScopedBstr(L"script"), element.Receive()); if (element) { - ScopedComPtr<IHTMLScriptElement> script_element; + base::win::ScopedComPtr<IHTMLScriptElement> script_element; if (SUCCEEDED(hr = script_element.QueryFrom(element))) { script_element->put_htmlFor(instance_id); script_element->put_event(event_name); @@ -572,7 +572,7 @@ HRESULT ChromeFrameActivex::CreateScriptBlockForEvent( void ChromeFrameActivex::FireEvent(const EventHandlers& handlers, const std::string& arg) { if (handlers.size()) { - ScopedComPtr<IDispatch> event; + base::win::ScopedComPtr<IDispatch> event; if (SUCCEEDED(CreateDomEvent("event", arg, "", event.Receive()))) { FireEvent(handlers, event); } @@ -621,7 +621,7 @@ void ChromeFrameActivex::FireEvent(const EventHandlers& handlers, HRESULT ChromeFrameActivex::InstallTopLevelHook(IOleClientSite* client_site) { // Get the parent window of the site, and install our hook on the topmost // window of the parent. - ScopedComPtr<IOleWindow> ole_window; + base::win::ScopedComPtr<IOleWindow> ole_window; HRESULT hr = ole_window.QueryFrom(client_site); if (FAILED(hr)) return hr; @@ -650,7 +650,7 @@ HRESULT ChromeFrameActivex::registerBhoIfNeeded() { return S_OK; } - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; HRESULT hr = DoQueryService(SID_SWebBrowserApp, m_spUnkSite, web_browser2.Receive()); if (FAILED(hr) || web_browser2.get() == NULL) { @@ -663,7 +663,7 @@ HRESULT ChromeFrameActivex::registerBhoIfNeeded() { StringFromGUID2(CLSID_ChromeFrameBHO, bho_class_id_as_string, arraysize(bho_class_id_as_string)); - ScopedComPtr<IObjectWithSite> bho; + base::win::ScopedComPtr<IObjectWithSite> bho; hr = bho.CreateInstance(CLSID_ChromeFrameBHO, NULL, CLSCTX_INPROC_SERVER); if (FAILED(hr)) { NOTREACHED() << "Failed to register ChromeFrame BHO. Error:" diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 18494c3..eed2983 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -7,8 +7,8 @@ #include <atlbase.h> #include <atlwin.h> -#include <string> #include <map> +#include <string> #include <vector> #include "base/memory/ref_counted.h" @@ -528,7 +528,7 @@ class ChromeFrameAutomationClient scoped_refptr<ChromeFrameLaunchParams> chrome_launch_params_; // Cache security manager for URL zone checking - ScopedComPtr<IInternetSecurityManager> security_manager_; + base::win::ScopedComPtr<IInternetSecurityManager> security_manager_; // When host network stack is used, this object is in charge of // handling network requests. diff --git a/chrome_frame/com_message_event.cc b/chrome_frame/com_message_event.cc index 8535999..32f1fc6 100644 --- a/chrome_frame/com_message_event.cc +++ b/chrome_frame/com_message_event.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -25,15 +25,15 @@ bool ComMessageEvent::Initialize(IOleContainer* container, type_ = event_type; // May remain NULL if container not IE - ScopedComPtr<IHTMLEventObj> basic_event; - ScopedComPtr<IHTMLDocument2> doc; + base::win::ScopedComPtr<IHTMLEventObj> basic_event; + base::win::ScopedComPtr<IHTMLDocument2> doc; // Fetching doc may fail in non-IE containers // and container might be NULL in some applications. if (container) container->QueryInterface(doc.Receive()); if (doc) { - ScopedComPtr<IHTMLDocument4> doc4; + base::win::ScopedComPtr<IHTMLDocument4> doc4; doc4.QueryFrom(doc); DCHECK(doc4); // supported by IE5.5 and higher if (doc4) { diff --git a/chrome_frame/com_message_event.h b/chrome_frame/com_message_event.h index 86fec2d..39900e9 100644 --- a/chrome_frame/com_message_event.h +++ b/chrome_frame/com_message_event.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,8 +8,9 @@ #include <atlbase.h> #include <atlcom.h> #include <mshtml.h> // IHTMLEventObj + #include "base/basictypes.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" // Implements a MessageEvent compliant event object by providing MessageEvent // specific properties itself and inherited properties from a browser provided @@ -63,7 +64,7 @@ END_COM_MAP() // calls that we do not directly support. This may not be initialized // if our container does not require the properties/methods exposed by // the basic event object. - ScopedComPtr<IHTMLEventObj> basic_event_; + base::win::ScopedComPtr<IHTMLEventObj> basic_event_; std::string message_; std::string origin_; std::string type_; diff --git a/chrome_frame/com_type_info_holder.cc b/chrome_frame/com_type_info_holder.cc index 695d61e..aa9b13b 100644 --- a/chrome_frame/com_type_info_holder.cc +++ b/chrome_frame/com_type_info_holder.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -62,7 +62,7 @@ HRESULT TypeInfoNameCache::Initialize(const IID& iid) { return E_UNEXPECTED; } - ScopedComPtr<ITypeLib> type_lib; + base::win::ScopedComPtr<ITypeLib> type_lib; HRESULT hr = LoadTypeLib(file_path, type_lib.Receive()); if (SUCCEEDED(hr)) { hr = type_lib->GetTypeInfoOfGuid(iid, type_info_.Receive()); diff --git a/chrome_frame/com_type_info_holder.h b/chrome_frame/com_type_info_holder.h index bf476a5..a777d7c 100644 --- a/chrome_frame/com_type_info_holder.h +++ b/chrome_frame/com_type_info_holder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,8 +8,8 @@ #include <map> #include <ocidl.h> // IProvideClassInfo2 -#include "base/scoped_comptr_win.h" #include "base/synchronization/lock.h" +#include "base/win/scoped_comptr.h" #define NO_VTABLE __declspec(novtable) @@ -60,7 +60,7 @@ class TypeInfoNameCache { } protected: - ScopedComPtr<ITypeInfo> type_info_; + base::win::ScopedComPtr<ITypeInfo> type_info_; NameToDispIdCache cache_; }; @@ -140,8 +140,8 @@ template <class T, const IID& iid = __uuidof(T)> class NO_VTABLE IDispatchImpl : public T { public: STDMETHOD(GetTypeInfoCount)(UINT* count) { - if (count == NULL) - return E_POINTER; + if (count == NULL) + return E_POINTER; *count = 1; return S_OK; } @@ -174,7 +174,7 @@ class NO_VTABLE IProvideClassInfo2Impl : public IProvideClassInfo2 { } STDMETHOD(GetGUID)(DWORD guid_kind, GUID* guid) { - if(guid == NULL || guid_kind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) + if (guid == NULL || guid_kind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) return E_INVALIDARG; *guid = source_iid; diff --git a/chrome_frame/external_tab.h b/chrome_frame/external_tab.h index 36b3e3d..ab10614 100644 --- a/chrome_frame/external_tab.h +++ b/chrome_frame/external_tab.h @@ -9,11 +9,13 @@ #include <windows.h> #include <atlbase.h> #include <atlwin.h> -#include <vector> + #include <string> +#include <vector> + #include "base/memory/scoped_ptr.h" -#include "base/scoped_comptr_win.h" #include "base/time.h" +#include "base/win/scoped_comptr.h" #include "chrome/common/automation_constants.h" #include "chrome_frame/cfproxy.h" #include "chrome_frame/task_marshaller.h" diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc index 0bff64b..7ca3cea 100644 --- a/chrome_frame/http_negotiate.cc +++ b/chrome_frame/http_negotiate.cc @@ -16,8 +16,8 @@ #include "chrome_frame/bho.h" #include "chrome_frame/exception_barrier.h" #include "chrome_frame/html_utils.h" -#include "chrome_frame/urlmon_url_request.h" #include "chrome_frame/urlmon_moniker.h" +#include "chrome_frame/urlmon_url_request.h" #include "chrome_frame/utils.h" #include "chrome_frame/vtable_patch_manager.h" #include "net/http/http_response_headers.h" @@ -172,11 +172,11 @@ bool HttpNegotiatePatch::Initialize() { // Use our SimpleBindStatusCallback class as we need a temporary object that // implements IBindStatusCallback. CComObjectStackEx<SimpleBindStatusCallback> request; - ScopedComPtr<IBindCtx> bind_ctx; + base::win::ScopedComPtr<IBindCtx> bind_ctx; HRESULT hr = CreateAsyncBindCtx(0, &request, NULL, bind_ctx.Receive()); DCHECK(SUCCEEDED(hr)) << "CreateAsyncBindCtx"; if (bind_ctx) { - ScopedComPtr<IUnknown> bscb_holder; + base::win::ScopedComPtr<IUnknown> bscb_holder; bind_ctx->GetObjectParam(L"_BSCB_Holder_", bscb_holder.Receive()); if (bscb_holder) { hr = PatchHttpNegotiate(bscb_holder); @@ -200,7 +200,7 @@ HRESULT HttpNegotiatePatch::PatchHttpNegotiate(IUnknown* to_patch) { DCHECK(to_patch); DCHECK_IS_NOT_PATCHED(IHttpNegotiate); - ScopedComPtr<IHttpNegotiate> http; + base::win::ScopedComPtr<IHttpNegotiate> http; HRESULT hr = http.QueryFrom(to_patch); if (FAILED(hr)) { hr = DoQueryService(IID_IHttpNegotiate, to_patch, http.Receive()); diff --git a/chrome_frame/http_negotiate.h b/chrome_frame/http_negotiate.h index 70a3ca2..e21d74e 100644 --- a/chrome_frame/http_negotiate.h +++ b/chrome_frame/http_negotiate.h @@ -11,7 +11,7 @@ #include <string> #include "base/basictypes.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" // Typedefs for IHttpNegotiate methods. typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_BeginningTransaction_Fn)( diff --git a/chrome_frame/in_place_menu.h b/chrome_frame/in_place_menu.h index d6b368a..76e9d75 100644 --- a/chrome_frame/in_place_menu.h +++ b/chrome_frame/in_place_menu.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,7 +22,7 @@ // Active Template Library product. #include "base/logging.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" template <class T> class InPlaceMenu { @@ -42,7 +42,7 @@ class InPlaceMenu { if (ole_menu_ || shared_menu_) return S_OK; - ScopedComPtr<IOleInPlaceFrame> in_place_frame; + base::win::ScopedComPtr<IOleInPlaceFrame> in_place_frame; GetInPlaceFrame(in_place_frame.Receive()); // We have no IOleInPlaceFrame, no menu merging possible if (!in_place_frame) { @@ -70,7 +70,7 @@ class InPlaceMenu { } HRESULT InPlaceMenuDestroy() { - ScopedComPtr<IOleInPlaceFrame> in_place_frame; + base::win::ScopedComPtr<IOleInPlaceFrame> in_place_frame; GetInPlaceFrame(in_place_frame.Receive()); if (in_place_frame) { in_place_frame->RemoveMenus(shared_menu_); @@ -177,7 +177,7 @@ class InPlaceMenu { // we'll have to get it ourselves. if (t->m_spInPlaceSite) { t->frame_info_.cb = sizeof(OLEINPLACEFRAMEINFO); - ScopedComPtr<IOleInPlaceUIWindow> in_place_ui_window; + base::win::ScopedComPtr<IOleInPlaceUIWindow> in_place_ui_window; RECT position_rect = {0}; RECT clip_rect = {0}; hr = t->m_spInPlaceSite->GetWindowContext(in_place_frame, diff --git a/chrome_frame/plugin_url_request.h b/chrome_frame/plugin_url_request.h index e74a589..879620c 100644 --- a/chrome_frame/plugin_url_request.h +++ b/chrome_frame/plugin_url_request.h @@ -9,8 +9,8 @@ #include <vector> #include "base/memory/ref_counted.h" -#include "base/scoped_comptr_win.h" #include "base/time.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/chrome_frame_delegate.h" #include "chrome_frame/urlmon_upload_data_stream.h" #include "ipc/ipc_message.h" @@ -186,7 +186,7 @@ class PluginUrlRequest { std::string extra_headers_; ResourceType::Type resource_type_; int load_flags_; - ScopedComPtr<IStream> upload_data_; + base::win::ScopedComPtr<IStream> upload_data_; bool is_chunked_upload_; // Contains the ip address and port of the destination host. net::HostPortPair socket_address_; diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc index 91d77dc..4ceeb62 100644 --- a/chrome_frame/protocol_sink_wrap.cc +++ b/chrome_frame/protocol_sink_wrap.cc @@ -96,7 +96,7 @@ ProtocolSinkWrap::~ProtocolSinkWrap() { DVLOG(1) << __FUNCTION__ << base::StringPrintf(" 0x%08X", this); } -ScopedComPtr<IInternetProtocolSink> ProtocolSinkWrap::CreateNewSink( +base::win::ScopedComPtr<IInternetProtocolSink> ProtocolSinkWrap::CreateNewSink( IInternetProtocolSink* sink, ProtData* data) { DCHECK(sink != NULL); DCHECK(data != NULL); @@ -104,7 +104,7 @@ ScopedComPtr<IInternetProtocolSink> ProtocolSinkWrap::CreateNewSink( CComObject<ProtocolSinkWrap>::CreateInstance(&new_sink); new_sink->delegate_ = sink; new_sink->prot_data_ = data; - return ScopedComPtr<IInternetProtocolSink>(new_sink); + return base::win::ScopedComPtr<IInternetProtocolSink>(new_sink); } // IInternetProtocolSink methods @@ -147,10 +147,11 @@ STDMETHODIMP ProtocolSinkWrap::ReportResult(HRESULT result, DWORD error, // Helpers -ScopedComPtr<IBindCtx> BindCtxFromIBindInfo(IInternetBindInfo* bind_info) { +base::win::ScopedComPtr<IBindCtx> BindCtxFromIBindInfo( + IInternetBindInfo* bind_info) { LPOLESTR bind_ctx_string = NULL; ULONG count; - ScopedComPtr<IBindCtx> bind_ctx; + base::win::ScopedComPtr<IBindCtx> bind_ctx; bind_info->GetBindString(BINDSTRING_PTR_BIND_CONTEXT, &bind_ctx_string, 1, &count); if (bind_ctx_string) { @@ -176,7 +177,7 @@ bool ShouldWrapSink(IInternetProtocolSink* sink, const wchar_t* url) { if ((url != StrStrW(url, L"http://")) && (url != StrStrW(url, L"https://"))) return false; - ScopedComPtr<IHttpNegotiate> http_negotiate; + base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; HRESULT hr = DoQueryService(GUID_NULL, sink, http_negotiate.Receive()); if (http_negotiate && !IsSubFrameRequest(http_negotiate)) return true; @@ -186,7 +187,7 @@ bool ShouldWrapSink(IInternetProtocolSink* sink, const wchar_t* url) { // High level helpers bool IsCFRequest(IBindCtx* pbc) { - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(pbc, info.Receive()); if (info && info->chrome_request()) return true; @@ -195,7 +196,7 @@ bool IsCFRequest(IBindCtx* pbc) { } bool HasProtData(IBindCtx* pbc) { - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(pbc, info.Receive()); bool result = false; if (info) @@ -207,7 +208,7 @@ void PutProtData(IBindCtx* pbc, ProtData* data) { // AddRef and Release to avoid a potential leak of a ProtData instance if // FromBindContext fails. data->AddRef(); - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(pbc, info.Receive()); if (info) info->set_prot_data(data); @@ -418,7 +419,7 @@ HRESULT ProtData::ReportProgress(IInternetProtocolSink* delegate, // This may seem awkward. CBinding's implementation of IWinInetHttpInfo // will forward to CTransaction that will forward to the real protocol. // We may ask CTransaction (our protocol_ member) for IWinInetHttpInfo. - ScopedComPtr<IWinInetHttpInfo> info; + base::win::ScopedComPtr<IWinInetHttpInfo> info; info.QueryFrom(delegate); renderer_type_ = DetermineRendererTypeFromMetaData(suggested_mime_type_, url_, info); @@ -552,7 +553,7 @@ void ProtData::FireSuggestedMimeType(IInternetProtocolSink* delegate) { void ProtData::SaveReferrer(IInternetProtocolSink* delegate) { DCHECK(IsChrome(renderer_type_)); - ScopedComPtr<IWinInetHttpInfo> info; + base::win::ScopedComPtr<IWinInetHttpInfo> info; info.QueryFrom(delegate); if (info) { char buffer[4096] = {0}; @@ -644,7 +645,7 @@ STDMETHODIMP Hook_Start(InternetProtocol_Start_Fn orig_start, return E_INVALIDARG; DVLOG_IF(1, url != NULL) << "OnStart: " << url << PiFlags2Str(flags); - ScopedComPtr<IBindCtx> bind_ctx = BindCtxFromIBindInfo(bind_info); + base::win::ScopedComPtr<IBindCtx> bind_ctx = BindCtxFromIBindInfo(bind_info); if (!bind_ctx) { // MSHTML sometimes takes a short path, skips the creation of // moniker and binding, by directly grabbing protocol from InternetSession @@ -664,7 +665,7 @@ STDMETHODIMP Hook_Start(InternetProtocol_Start_Fn orig_start, } if (IsCFRequest(bind_ctx)) { - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_ctx, info.Receive()); DCHECK(info); if (info) { @@ -677,7 +678,7 @@ STDMETHODIMP Hook_Start(InternetProtocol_Start_Fn orig_start, if (prot_data) { DVLOG(1) << "Found existing ProtData!"; prot_data->UpdateUrl(url); - ScopedComPtr<IInternetProtocolSink> new_sink = + base::win::ScopedComPtr<IInternetProtocolSink> new_sink = ProtocolSinkWrap::CreateNewSink(prot_sink, prot_data); return ForwardWrappedHookStart(orig_start, protocol, url, new_sink, bind_info, flags, reserved); @@ -694,7 +695,7 @@ STDMETHODIMP Hook_Start(InternetProtocol_Start_Fn orig_start, prot_data = new ProtData(protocol, read_fun, url); PutProtData(bind_ctx, prot_data); - ScopedComPtr<IInternetProtocolSink> new_sink = + base::win::ScopedComPtr<IInternetProtocolSink> new_sink = ProtocolSinkWrap::CreateNewSink(prot_sink, prot_data); return ForwardWrappedHookStart(orig_start, protocol, url, new_sink, bind_info, flags, reserved); @@ -725,7 +726,7 @@ STDMETHODIMP Hook_StartEx(InternetProtocol_StartEx_Fn orig_start_ex, uri->GetPropertyBSTR(Uri_PROPERTY_ABSOLUTE_URI, url.Receive(), 0); DVLOG_IF(1, url != NULL) << "OnStartEx: " << url << PiFlags2Str(flags); - ScopedComPtr<IBindCtx> bind_ctx = BindCtxFromIBindInfo(bind_info); + base::win::ScopedComPtr<IBindCtx> bind_ctx = BindCtxFromIBindInfo(bind_info); if (!bind_ctx) { // MSHTML sometimes takes a short path, skips the creation of // moniker and binding, by directly grabbing protocol from InternetSession. @@ -745,7 +746,7 @@ STDMETHODIMP Hook_StartEx(InternetProtocol_StartEx_Fn orig_start_ex, } if (IsCFRequest(bind_ctx)) { - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_ctx, info.Receive()); DCHECK(info); if (info) { @@ -758,7 +759,7 @@ STDMETHODIMP Hook_StartEx(InternetProtocol_StartEx_Fn orig_start_ex, if (prot_data) { DVLOG(1) << "Found existing ProtData!"; prot_data->UpdateUrl(url); - ScopedComPtr<IInternetProtocolSink> new_sink = + base::win::ScopedComPtr<IInternetProtocolSink> new_sink = ProtocolSinkWrap::CreateNewSink(prot_sink, prot_data); return ForwardWrappedHookStartEx(orig_start_ex, protocol, uri, new_sink, bind_info, flags, reserved); @@ -775,7 +776,7 @@ STDMETHODIMP Hook_StartEx(InternetProtocol_StartEx_Fn orig_start_ex, prot_data = new ProtData(protocol, read_fun, url); PutProtData(bind_ctx, prot_data); - ScopedComPtr<IInternetProtocolSink> new_sink = + base::win::ScopedComPtr<IInternetProtocolSink> new_sink = ProtocolSinkWrap::CreateNewSink(prot_sink, prot_data); return ForwardWrappedHookStartEx(orig_start_ex, protocol, uri, new_sink, bind_info, flags, reserved); @@ -864,7 +865,7 @@ class FakeProtocol : public CComObjectRootEx<CComSingleThreadModel>, STDMETHOD(LockRequest)(DWORD options) { return S_OK; } STDMETHOD(UnlockRequest)() { return S_OK; } - ScopedComPtr<IInternetProtocol> transaction_; + base::win::ScopedComPtr<IInternetProtocol> transaction_; }; struct FakeFactory : public IClassFactory, @@ -888,7 +889,7 @@ struct FakeFactory : public IClassFactory, }; static void HookTransactionVtable(IInternetProtocol* p) { - ScopedComPtr<IInternetProtocolEx> ex; + base::win::ScopedComPtr<IInternetProtocolEx> ex; ex.QueryFrom(p); HRESULT hr = vtable_patch::PatchInterfaceMethods(p, CTransaction_PatchInfo); @@ -906,7 +907,7 @@ void TransactionHooks::InstallHooks() { CComObjectStackEx<FakeProtocol> prot; CComObjectStackEx<FakeFactory> factory; factory.obj_ = &prot; - ScopedComPtr<IInternetSession> session; + base::win::ScopedComPtr<IInternetSession> session; HRESULT hr = ::CoInternetGetSession(0, session.Receive(), 0); hr = session->RegisterNameSpace(&factory, CLSID_NULL, L"611", 0, 0, 0); DLOG_IF(FATAL, FAILED(hr)) << "Failed to register namespace"; @@ -914,9 +915,9 @@ void TransactionHooks::InstallHooks() { return; do { - ScopedComPtr<IMoniker> mk; - ScopedComPtr<IBindCtx> bc; - ScopedComPtr<IStream> stream; + base::win::ScopedComPtr<IMoniker> mk; + base::win::ScopedComPtr<IBindCtx> bc; + base::win::ScopedComPtr<IStream> stream; hr = ::CreateAsyncBindCtxEx(0, 0, 0, 0, bc.Receive(), 0); DLOG_IF(FATAL, FAILED(hr)) << "CreateAsyncBindCtxEx failed " << hr; if (hr != S_OK) diff --git a/chrome_frame/stream_impl.h b/chrome_frame/stream_impl.h index 9cced3e..454bbb1 100644 --- a/chrome_frame/stream_impl.h +++ b/chrome_frame/stream_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,7 @@ #include <atlbase.h> #include <atlcom.h> -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" // A generic base class for IStream implementation. If provided // with a delegate, it delegated calls to it otherwise can be @@ -35,7 +35,7 @@ class StreamImpl : public IStream { STDMETHOD(Clone)(IStream** stream); protected: - ScopedComPtr<IStream> delegate_; + base::win::ScopedComPtr<IStream> delegate_; private: DISALLOW_COPY_AND_ASSIGN(StreamImpl); diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index 216fe2f..a9e5e36 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -21,9 +21,9 @@ #include "base/win/registry.h" #include "base/win/scoped_handle.h" #include "base/win/windows_version.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths_internal.h" +#include "chrome/common/chrome_switches.h" #include "chrome_frame/utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/clipboard/clipboard.h" @@ -242,7 +242,7 @@ base::ProcessHandle LaunchIE(const std::wstring& url) { int CloseAllIEWindows() { int ret = 0; - ScopedComPtr<IShellWindows> windows; + base::win::ScopedComPtr<IShellWindows> windows; HRESULT hr = ::CoCreateInstance(__uuidof(ShellWindows), NULL, CLSCTX_ALL, IID_IShellWindows, reinterpret_cast<void**>(windows.Receive())); DCHECK(SUCCEEDED(hr)); @@ -252,10 +252,10 @@ int CloseAllIEWindows() { windows->get_Count(&count); VARIANT i = { VT_I4 }; for (i.lVal = 0; i.lVal < count; ++i.lVal) { - ScopedComPtr<IDispatch> folder; + base::win::ScopedComPtr<IDispatch> folder; windows->Item(i, folder.Receive()); if (folder != NULL) { - ScopedComPtr<IWebBrowser2> browser; + base::win::ScopedComPtr<IWebBrowser2> browser; if (SUCCEEDED(browser.QueryFrom(folder))) { bool is_ie = true; HWND window = NULL; @@ -383,7 +383,7 @@ HRESULT LaunchIEAsComServer(IWebBrowser2** web_browser) { if (base::win::GetVersion() == base::win::VERSION_VISTA && GetInstalledIEVersion() == IE_7) { // Create medium integrity browser that will launch IE broker. - ScopedComPtr<IWebBrowser2> medium_integrity_browser; + base::win::ScopedComPtr<IWebBrowser2> medium_integrity_browser; hr = medium_integrity_browser.CreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER); if (FAILED(hr)) diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index 781ba7f..3a44d04 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -17,11 +17,11 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/process_util.h" -#include "base/scoped_comptr_win.h" #include "base/win/registry.h" +#include "base/win/scoped_comptr.h" -#include "chrome_frame/test_utils.h" #include "chrome_frame/test/simulate_input.h" +#include "chrome_frame/test_utils.h" #include "chrome_frame/utils.h" // Include without path to make GYP build see it. @@ -118,7 +118,7 @@ class HungCOMCallDetector } void TearDown() { - ScopedComPtr<IMessageFilter> prev_filter; + base::win::ScopedComPtr<IMessageFilter> prev_filter; CoRegisterMessageFilter(prev_filter_.get(), prev_filter.Receive()); DestroyWindow(); m_hWnd = NULL; @@ -182,7 +182,7 @@ class HungCOMCallDetector // used to detect if outgoing COM calls hung. bool is_hung_; - ScopedComPtr<IMessageFilter> prev_filter_; + base::win::ScopedComPtr<IMessageFilter> prev_filter_; }; // MessageLoopForUI wrapper that runs only for a limited time. diff --git a/chrome_frame/test/chrome_frame_ui_test_utils.cc b/chrome_frame/test/chrome_frame_ui_test_utils.cc index 3fcff06..d1dbd67 100644 --- a/chrome_frame/test/chrome_frame_ui_test_utils.cc +++ b/chrome_frame/test/chrome_frame_ui_test_utils.cc @@ -37,7 +37,7 @@ AccObject::AccObject(IAccessible* accessible, int child_id) : accessible_(accessible), child_id_(child_id) { DCHECK(accessible); if (child_id != CHILDID_SELF) { - ScopedComPtr<IDispatch> dispatch; + base::win::ScopedComPtr<IDispatch> dispatch; // This class does not support referring to a full MSAA object using the // parent object and the child id. HRESULT result = accessible_->get_accChild(child_id_, dispatch.Receive()); @@ -51,7 +51,7 @@ AccObject::AccObject(IAccessible* accessible, int child_id) // static AccObject* AccObject::CreateFromWindow(HWND hwnd) { - ScopedComPtr<IAccessible> accessible; + base::win::ScopedComPtr<IAccessible> accessible; ::AccessibleObjectFromWindow(hwnd, OBJID_CLIENT, IID_IAccessible, reinterpret_cast<void**>(accessible.Receive())); if (accessible) @@ -62,7 +62,7 @@ AccObject* AccObject::CreateFromWindow(HWND hwnd) { // static AccObject* AccObject::CreateFromEvent(HWND hwnd, LONG object_id, LONG child_id) { - ScopedComPtr<IAccessible> accessible; + base::win::ScopedComPtr<IAccessible> accessible; base::win::ScopedVariant acc_child_id; ::AccessibleObjectFromEvent(hwnd, object_id, child_id, accessible.Receive(), acc_child_id.Receive()); @@ -74,7 +74,7 @@ AccObject* AccObject::CreateFromEvent(HWND hwnd, LONG object_id, // static AccObject* AccObject::CreateFromDispatch(IDispatch* dispatch) { if (dispatch) { - ScopedComPtr<IAccessible> accessible; + base::win::ScopedComPtr<IAccessible> accessible; accessible.QueryFrom(dispatch); if (accessible) return new AccObject(accessible); @@ -84,7 +84,7 @@ AccObject* AccObject::CreateFromDispatch(IDispatch* dispatch) { // static AccObject* AccObject::CreateFromPoint(int x, int y) { - ScopedComPtr<IAccessible> accessible; + base::win::ScopedComPtr<IAccessible> accessible; base::win::ScopedVariant child_id; POINT point = {x, y}; ::AccessibleObjectFromPoint(point, accessible.Receive(), child_id.Receive()); @@ -253,7 +253,7 @@ bool AccObject::GetLocationInClient(gfx::Rect* client_location) { AccObject* AccObject::GetParent() { if (IsSimpleElement()) return new AccObject(accessible_); - ScopedComPtr<IDispatch> dispatch; + base::win::ScopedComPtr<IDispatch> dispatch; if (FAILED(accessible_->get_accParent(dispatch.Receive()))) return NULL; return AccObject::CreateFromDispatch(dispatch.get()); @@ -388,7 +388,7 @@ bool AccObject::GetWindowClassName(std::wstring* class_name) { bool AccObject::GetSelectionRange(int* start_offset, int* end_offset) { DCHECK(start_offset); DCHECK(end_offset); - ScopedComPtr<IAccessibleText> accessible_text; + base::win::ScopedComPtr<IAccessibleText> accessible_text; HRESULT hr = DoQueryService(IID_IAccessibleText, accessible_, accessible_text.Receive()); @@ -417,7 +417,7 @@ bool AccObject::GetSelectedText(std::wstring* text) { int start = 0, end = 0; if (!GetSelectionRange(&start, &end)) return false; - ScopedComPtr<IAccessibleText> accessible_text; + base::win::ScopedComPtr<IAccessibleText> accessible_text; HRESULT hr = DoQueryService(IID_IAccessibleText, accessible_, accessible_text.Receive()); @@ -499,7 +499,7 @@ AccObject* AccObject::CreateFromVariant(AccObject* object, // possible, since this class operates under the assumption that if the // child id is not CHILDID_SELF, the object is a simple element. See the // DCHECK in the constructor. - ScopedComPtr<IDispatch> dispatch; + base::win::ScopedComPtr<IDispatch> dispatch; HRESULT result = accessible->get_accChild(variant, dispatch.Receive()); if (result == S_FALSE || result == E_NOINTERFACE) { diff --git a/chrome_frame/test/chrome_frame_ui_test_utils.h b/chrome_frame/test/chrome_frame_ui_test_utils.h index 86ddf34..680195f 100644 --- a/chrome_frame/test/chrome_frame_ui_test_utils.h +++ b/chrome_frame/test/chrome_frame_ui_test_utils.h @@ -12,7 +12,7 @@ #include "base/file_path.h" #include "base/memory/ref_counted.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" #include "base/win/scoped_variant.h" #include "chrome_frame/test/win_event_receiver.h" @@ -173,7 +173,7 @@ class AccObject : public base::RefCounted<AccObject> { // Helper method for posting mouse button messages. bool PostMouseButtonMessages(int button_up, int button_down, int x, int y); - ScopedComPtr<IAccessible> accessible_; + base::win::ScopedComPtr<IAccessible> accessible_; base::win::ScopedVariant child_id_; DISALLOW_COPY_AND_ASSIGN(AccObject); diff --git a/chrome_frame/test/com_message_event_unittest.cc b/chrome_frame/test/com_message_event_unittest.cc index 3494f68..bd8a1ab 100644 --- a/chrome_frame/test/com_message_event_unittest.cc +++ b/chrome_frame/test/com_message_event_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -32,7 +32,7 @@ class ATL_NO_VTABLE MockDumbContainer : STDMETHOD(EnumObjects)(DWORD, IEnumUnknown**) { NOTREACHED(); return E_NOTIMPL; - } + } STDMETHOD(LockContainer)(BOOL) { NOTREACHED(); return E_NOTIMPL; @@ -42,12 +42,12 @@ class ATL_NO_VTABLE MockDumbContainer : TEST(ComMessageEvent, WithDumbContainer) { CComObject<MockDumbContainer>* container_obj = NULL; CComObject<MockDumbContainer>::CreateInstance(&container_obj); - ScopedComPtr<IOleContainer> container(container_obj); + base::win::ScopedComPtr<IOleContainer> container(container_obj); EXPECT_FALSE(!container); CComObject<FriendlyComMessageEvent>* event_obj = NULL; CComObject<FriendlyComMessageEvent>::CreateInstance(&event_obj); - ScopedComPtr<IUnknown> event_ref(event_obj); + base::win::ScopedComPtr<IUnknown> event_ref(event_obj); bool result = event_obj->Initialize(container, "hi", "http://www.foo.com/", "message"); @@ -279,14 +279,14 @@ class ATL_NO_VTABLE MockSmartContainer : TEST(ComMessageEvent, WithSmartContainer) { CComObject<MockSmartContainer>* container_obj = NULL; CComObject<MockSmartContainer>::CreateInstance(&container_obj); - ScopedComPtr<IOleContainer> container(container_obj); + base::win::ScopedComPtr<IOleContainer> container(container_obj); EXPECT_FALSE(!container); CComObject<FriendlyComMessageEvent>* event_obj = NULL; CComObject<FriendlyComMessageEvent>::CreateInstance(&event_obj); - ScopedComPtr<IUnknown> event_ref(event_obj); + base::win::ScopedComPtr<IUnknown> event_ref(event_obj); - bool succeeded = event_obj->Initialize(container, "hi", + bool succeeded = event_obj->Initialize(container, "hi", "http://www.foo.com/", "message"); EXPECT_TRUE(succeeded); EXPECT_FALSE(!event_obj->basic_event()); diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc index 2efd012..1fd9d45 100644 --- a/chrome_frame/test/ie_event_sink.cc +++ b/chrome_frame/test/ie_event_sink.cc @@ -174,13 +174,13 @@ bool IEEventSink::IsCFRendering() { DCHECK(web_browser2_); if (web_browser2_) { - ScopedComPtr<IDispatch> doc; + base::win::ScopedComPtr<IDispatch> doc; web_browser2_->get_Document(doc.Receive()); if (doc) { // Detect if CF is rendering based on whether the document is a // ChromeActiveDocument. Detecting based on hwnd is problematic as // the CF Active Document window may not have been created yet. - ScopedComPtr<IChromeFrame> chrome_frame; + base::win::ScopedComPtr<IChromeFrame> chrome_frame; chrome_frame.QueryFrom(doc); return chrome_frame.get(); } @@ -241,7 +241,7 @@ void IEEventSink::ExpectAddressBarUrl( void IEEventSink::Exec(const GUID* cmd_group_guid, DWORD command_id, DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args) { - ScopedComPtr<IOleCommandTarget> shell_browser_cmd_target; + base::win::ScopedComPtr<IOleCommandTarget> shell_browser_cmd_target; DoQueryService(SID_STopLevelBrowser, web_browser2_, shell_browser_cmd_target.Receive()); ASSERT_TRUE(NULL != shell_browser_cmd_target); @@ -260,7 +260,7 @@ HWND IEEventSink::GetRendererWindow() { HWND renderer_window = NULL; if (IsCFRendering()) { DCHECK(chrome_frame_); - ScopedComPtr<IOleWindow> ole_window; + base::win::ScopedComPtr<IOleWindow> ole_window; ole_window.QueryFrom(chrome_frame_); EXPECT_TRUE(ole_window.get()); @@ -284,12 +284,12 @@ HWND IEEventSink::GetRendererWindow() { } } else { DCHECK(web_browser2_); - ScopedComPtr<IDispatch> doc; + base::win::ScopedComPtr<IDispatch> doc; HRESULT hr = web_browser2_->get_Document(doc.Receive()); EXPECT_HRESULT_SUCCEEDED(hr); EXPECT_TRUE(doc); if (doc) { - ScopedComPtr<IOleWindow> ole_window; + base::win::ScopedComPtr<IOleWindow> ole_window; ole_window.QueryFrom(doc); EXPECT_TRUE(ole_window); if (ole_window) { @@ -306,7 +306,7 @@ HWND IEEventSink::GetRendererWindowSafe() { HWND renderer_window = NULL; if (IsCFRendering()) { DCHECK(chrome_frame_); - ScopedComPtr<IOleWindow> ole_window; + base::win::ScopedComPtr<IOleWindow> ole_window; ole_window.QueryFrom(chrome_frame_); if (ole_window) { @@ -325,10 +325,10 @@ HWND IEEventSink::GetRendererWindowSafe() { } } else { DCHECK(web_browser2_); - ScopedComPtr<IDispatch> doc; + base::win::ScopedComPtr<IDispatch> doc; web_browser2_->get_Document(doc.Receive()); if (doc) { - ScopedComPtr<IOleWindow> ole_window; + base::win::ScopedComPtr<IOleWindow> ole_window; ole_window.QueryFrom(doc); if (ole_window) { ole_window->GetWindow(&renderer_window); @@ -382,12 +382,12 @@ void IEEventSink::ConnectToChromeFrame() { DCHECK(web_browser2_); if (chrome_frame_.get()) return; - ScopedComPtr<IShellBrowser> shell_browser; + base::win::ScopedComPtr<IShellBrowser> shell_browser; DoQueryService(SID_STopLevelBrowser, web_browser2_, shell_browser.Receive()); if (shell_browser) { - ScopedComPtr<IShellView> shell_view; + base::win::ScopedComPtr<IShellView> shell_view; shell_browser->QueryActiveShellView(shell_view.Receive()); if (shell_view) { shell_view->GetItemObject(SVGIO_BACKGROUND, __uuidof(IChromeFrame), @@ -410,7 +410,7 @@ void IEEventSink::DisconnectFromChromeFrame() { // Use a local ref counted copy of the IChromeFrame interface as the // outgoing calls could cause the interface to be deleted due to a message // pump running in the context of the outgoing call. - ScopedComPtr<IChromeFrame> chrome_frame(chrome_frame_); + base::win::ScopedComPtr<IChromeFrame> chrome_frame(chrome_frame_); chrome_frame_.Release(); base::win::ScopedVariant dummy(static_cast<IDispatch*>(NULL)); chrome_frame->put_onmessage(dummy); @@ -450,7 +450,7 @@ STDMETHODIMP_(void) IEEventSink::OnNewWindow2(IDispatch** dispatch, // Since we need to listen on events on the new browser, we create one // if needed. if (!*dispatch) { - ScopedComPtr<IDispatch> new_browser; + base::win::ScopedComPtr<IDispatch> new_browser; HRESULT hr = new_browser.CreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER); DCHECK(SUCCEEDED(hr) && new_browser); @@ -528,7 +528,7 @@ STDMETHODIMP_(void) IEEventSink::OnNewWindow3( // Since we need to listen on events on the new browser, we create one // if needed. if (!*dispatch) { - ScopedComPtr<IDispatch> new_browser; + base::win::ScopedComPtr<IDispatch> new_browser; HRESULT hr = new_browser.CreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER); DCHECK(SUCCEEDED(hr) && new_browser); diff --git a/chrome_frame/test/ie_event_sink.h b/chrome_frame/test/ie_event_sink.h index 41672a7..1346e1c 100644 --- a/chrome_frame/test/ie_event_sink.h +++ b/chrome_frame/test/ie_event_sink.h @@ -10,10 +10,10 @@ #include <exdispid.h> #include <string> -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" -#include "chrome_frame/test_utils.h" #include "chrome_frame/test/simulate_input.h" +#include "chrome_frame/test_utils.h" // Include without path to make GYP build see it. #include "chrome_tab.h" // NOLINT @@ -233,8 +233,8 @@ END_SINK_MAP() HRESULT OnLoadError(const VARIANT* param); HRESULT OnMessage(const VARIANT* param); - ScopedComPtr<IWebBrowser2> web_browser2_; - ScopedComPtr<IChromeFrame> chrome_frame_; + base::win::ScopedComPtr<IWebBrowser2> web_browser2_; + base::win::ScopedComPtr<IChromeFrame> chrome_frame_; DispCallback<IEEventSink> onmessage_; DispCallback<IEEventSink> onloaderror_; DispCallback<IEEventSink> onload_; diff --git a/chrome_frame/test/mock_ie_event_sink_actions.h b/chrome_frame/test/mock_ie_event_sink_actions.h index 58d7006..273517bf 100644 --- a/chrome_frame/test/mock_ie_event_sink_actions.h +++ b/chrome_frame/test/mock_ie_event_sink_actions.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -52,7 +52,7 @@ ACTION_P3(DelayCloseBrowserMock, loop, delay, mock) { } ACTION_P2(ConnectDocPropNotifySink, mock, sink) { - ScopedComPtr<IDispatch> document; + base::win::ScopedComPtr<IDispatch> document; mock->event_sink()->web_browser2()->get_Document(document.Receive()); EXPECT_TRUE(document != NULL); // NOLINT if (document) { diff --git a/chrome_frame/test/mock_ie_event_sink_test.cc b/chrome_frame/test/mock_ie_event_sink_test.cc index 99ccfc4..8eddc4c 100644 --- a/chrome_frame/test/mock_ie_event_sink_test.cc +++ b/chrome_frame/test/mock_ie_event_sink_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,8 +6,8 @@ #include <sstream> -#include "base/win/scoped_variant.h" #include "base/utf_string_conversions.h" +#include "base/win/scoped_variant.h" #include "chrome_frame/test/mock_ie_event_sink_actions.h" // Needed for CreateFunctor. @@ -157,10 +157,10 @@ void MockIEEventSink::ExpectAnyNavigations() { } void MockIEEventSink::ExpectDocumentReadystate(int ready_state) { - ScopedComPtr<IWebBrowser2> browser(event_sink_->web_browser2()); + base::win::ScopedComPtr<IWebBrowser2> browser(event_sink_->web_browser2()); EXPECT_TRUE(browser != NULL); if (browser) { - ScopedComPtr<IDispatch> document; + base::win::ScopedComPtr<IDispatch> document; browser->get_Document(document.Receive()); EXPECT_TRUE(document != NULL); if (document) { diff --git a/chrome_frame/test/mock_ie_event_sink_test.h b/chrome_frame/test/mock_ie_event_sink_test.h index b40400d..cd9113b 100644 --- a/chrome_frame/test/mock_ie_event_sink_test.h +++ b/chrome_frame/test/mock_ie_event_sink_test.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -203,7 +203,7 @@ class MockPropertyNotifySinkListener : public PropertyNotifySinkListener { private: CComObject<PropertyNotifySinkImpl>* sink_; DWORD cookie_; - ScopedComPtr<IUnknown> event_source_; + base::win::ScopedComPtr<IUnknown> event_source_; }; // Allows tests to observe when processes exit. diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc index 3dfa0ba..82385a5 100644 --- a/chrome_frame/test/navigation_test.cc +++ b/chrome_frame/test/navigation_test.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> -#include "base/scoped_comptr_win.h" #include "base/test/test_file_util.h" +#include "base/win/scoped_comptr.h" #include "base/win/windows_version.h" #include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/chrome_frame_ui_test_utils.h" @@ -277,7 +277,7 @@ TEST_P(FullTabNavigationTest, BackForwardAnchor) { // dialog appears. TEST_P(FullTabNavigationTest, RestrictedSite) { // Add the server to restricted sites zone. - ScopedComPtr<IInternetSecurityManager> security_manager; + base::win::ScopedComPtr<IInternetSecurityManager> security_manager; HRESULT hr = security_manager.CreateInstance(CLSID_InternetSecurityManager); ASSERT_HRESULT_SUCCEEDED(hr); hr = security_manager->SetZoneMapping(URLZONE_UNTRUSTED, diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index bba43c8..a4bd592 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -16,14 +16,13 @@ #include "base/file_version_info.h" #include "base/i18n/icu_util.h" #include "base/path_service.h" -#include "base/scoped_comptr_win.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/threading/platform_thread.h" +#include "base/win/scoped_comptr.h" #include "base/win/scoped_handle.h" #include "chrome/browser/automation/automation_provider_list.h" #include "chrome/browser/chrome_content_browser_client.h" -#include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/proxy_config_dictionary.h" @@ -36,6 +35,7 @@ #include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "chrome/renderer/chrome_content_renderer_client.h" #include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/net/test_automation_resource_message_filter.h" #include "chrome_frame/test/simulate_input.h" @@ -91,7 +91,7 @@ bool PromptAfterSetup() { // #pragma comment(lib, "oleacc.lib")). bool SetFocusToAccessibleWindow(HWND hwnd) { bool ret = false; - ScopedComPtr<IAccessible> acc; + base::win::ScopedComPtr<IAccessible> acc; AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, IID_IAccessible, reinterpret_cast<void**>(acc.Receive())); if (acc) { diff --git a/chrome_frame/test/perf/silverlight.cc b/chrome_frame/test/perf/silverlight.cc index d5d95df..6ce7a0e 100644 --- a/chrome_frame/test/perf/silverlight.cc +++ b/chrome_frame/test/perf/silverlight.cc @@ -1,10 +1,12 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + #include <atlbase.h> #include <atlwin.h> #include <atlhost.h> -#include "base/scoped_comptr_win.h" + +#include "base/win/scoped_comptr.h" #include "chrome_frame/test/perf/chrome_frame_perftest.h" interface IXcpControlDownloadCallback; @@ -128,7 +130,7 @@ class SilverlightContainer : return hr; } - ScopedComPtr<IAxWinHostWindow> host_; + base::win::ScopedComPtr<IAxWinHostWindow> host_; }; // Create and in-place Silverlight control. Should be extended to do something @@ -156,7 +158,7 @@ TEST(ChromeFramePerf, DISABLED_HostSilverlight) { WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE); EXPECT_TRUE(host.m_hWnd != NULL); - ScopedComPtr<IDispatch> disp; + base::win::ScopedComPtr<IDispatch> disp; HRESULT hr = host.QueryControl(disp.Receive()); EXPECT_HRESULT_SUCCEEDED(hr); disp.Release(); diff --git a/chrome_frame/test/reliability/page_load_test.cc b/chrome_frame/test/reliability/page_load_test.cc index e08817e..e001c76 100644 --- a/chrome_frame/test/reliability/page_load_test.cc +++ b/chrome_frame/test/reliability/page_load_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -181,7 +181,7 @@ class PageLoadTest : public testing::Test { chrome_frame_test::TimedMsgLoop message_loop; // Launch IE. - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; hr = chrome_frame_test::LaunchIEAsComServer(web_browser2.Receive()); EXPECT_HRESULT_SUCCEEDED(hr); EXPECT_TRUE(web_browser2.get() != NULL); diff --git a/chrome_frame/test/urlmon_moniker_integration_test.cc b/chrome_frame/test/urlmon_moniker_integration_test.cc index 4bf977f..99c0357 100644 --- a/chrome_frame/test/urlmon_moniker_integration_test.cc +++ b/chrome_frame/test/urlmon_moniker_integration_test.cc @@ -5,13 +5,13 @@ #include <atlbase.h> #include <atlcom.h> -#include "base/scoped_comptr_win.h" -#include "base/win/scoped_handle.h" #include "base/threading/thread.h" +#include "base/win/scoped_comptr.h" +#include "base/win/scoped_handle.h" #include "chrome_frame/bho.h" //#include "chrome_frame/urlmon_moniker.h" -#include "chrome_frame/test/test_server.h" #include "chrome_frame/test/chrome_frame_test_utils.h" +#include "chrome_frame/test/test_server.h" #include "chrome_frame/test/urlmon_moniker_tests.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -175,14 +175,14 @@ class UrlmonMonikerTestCallback { HRESULT CreateUrlMonikerAndBindToStorage(const wchar_t* url, IBindCtx** bind_ctx) { - ScopedComPtr<IMoniker> moniker; + base::win::ScopedComPtr<IMoniker> moniker; HRESULT hr = CreateURLMoniker(NULL, url, moniker.Receive()); EXPECT_TRUE(moniker != NULL); if (moniker) { - ScopedComPtr<IBindCtx> context; + base::win::ScopedComPtr<IBindCtx> context; ::CreateAsyncBindCtx(0, callback(), NULL, context.Receive()); DCHECK(context); - ScopedComPtr<IStream> stream; + base::win::ScopedComPtr<IStream> stream; hr = moniker->BindToStorage(context, NULL, IID_IStream, reinterpret_cast<void**>(stream.Receive())); if (SUCCEEDED(hr) && bind_ctx) @@ -215,7 +215,7 @@ TEST_F(UrlmonMonikerTest, BindToStorageSynchronous) { callback.SetCallbackExpectations( UrlmonMonikerTestCallback::REQUEST_SYNCHRONOUS, S_OK, false); - ScopedComPtr<IBindCtx> bind_ctx; + base::win::ScopedComPtr<IBindCtx> bind_ctx; HRESULT hr = callback.CreateUrlMonikerAndBindToStorage(test_url, bind_ctx.Receive()); // The download should have happened synchronously, so we don't expect @@ -241,7 +241,7 @@ TEST_F(UrlmonMonikerTest, BindToStorageAsynchronous) { callback.SetCallbackExpectations( UrlmonMonikerTestCallback::REQUEST_ASYNCHRONOUS, S_OK, true); - ScopedComPtr<IBindCtx> bind_ctx; + base::win::ScopedComPtr<IBindCtx> bind_ctx; HRESULT hr = callback.CreateUrlMonikerAndBindToStorage(test_url, bind_ctx.Receive()); EXPECT_EQ(MK_S_ASYNCHRONOUS, hr); @@ -292,7 +292,7 @@ TEST_F(UrlmonMonikerTest, BindToStorageSwitchContent) { if (request_data) { EXPECT_EQ(request_data->GetCachedContentSize(), arraysize(kTestContent) - 1); - ScopedComPtr<IStream> stream; + base::win::ScopedComPtr<IStream> stream; request_data->GetResetCachedContentStream(stream.Receive()); EXPECT_TRUE(stream != NULL); if (stream) { diff --git a/chrome_frame/test/urlmon_moniker_unittest.cc b/chrome_frame/test/urlmon_moniker_unittest.cc index d644be7..f7e0f04 100644 --- a/chrome_frame/test/urlmon_moniker_unittest.cc +++ b/chrome_frame/test/urlmon_moniker_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,10 +7,10 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "base/scoped_comptr_win.h" -#include "chrome_frame/urlmon_bind_status_callback.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/urlmon_moniker_tests.h" +#include "chrome_frame/urlmon_bind_status_callback.h" using chrome_frame_test::ScopedVirtualizeHklmAndHkcu; using testing::Return; @@ -38,7 +38,7 @@ class MonikerPatchTest : public testing::Test { static bool StringToStream(const std::string& data, IStream** ret) { EXPECT_TRUE(!data.empty()); - ScopedComPtr<IStream> stream; + base::win::ScopedComPtr<IStream> stream; HRESULT hr = CreateStreamOnHGlobal(NULL, TRUE, stream.Receive()); EXPECT_HRESULT_SUCCEEDED(hr); if (FAILED(hr)) { @@ -136,7 +136,7 @@ TEST_F(MonikerPatchTest, SniffDataMetaTag) { ASSERT_TRUE(ReadFileAsString(kSmallHtmlMetaTag, &small_html_meta_tag)); ASSERT_TRUE(ReadFileAsString(kSmallHtmlNoMetaTag, &small_html_no_meta_tag)); - ScopedComPtr<IStream> stream_with_meta, stream_no_meta; + base::win::ScopedComPtr<IStream> stream_with_meta, stream_no_meta; ASSERT_TRUE(StringToStream(small_html_meta_tag, stream_with_meta.Receive())); ASSERT_TRUE(StringToStream(small_html_no_meta_tag, stream_no_meta.Receive())); @@ -159,7 +159,7 @@ TEST_F(MonikerPatchTest, SniffDataMetaTag) { // case 1: callback reads data in 1 read TEST_F(MonikerPatchTest, SniffDataPlayback1) { std::string small_html_meta_tag; - ScopedComPtr<IStream> stream_with_meta; + base::win::ScopedComPtr<IStream> stream_with_meta; SniffData sniffer; EXPECT_HRESULT_SUCCEEDED(sniffer.InitializeCache(std::wstring())); @@ -202,7 +202,7 @@ TEST_F(MonikerPatchTest, SniffDataPlayback1) { // case 2: callback reads data in 2 reads. TEST_F(MonikerPatchTest, SniffDataPlayback2) { std::string small_html_meta_tag; - ScopedComPtr<IStream> stream_with_meta; + base::win::ScopedComPtr<IStream> stream_with_meta; SniffData sniffer; EXPECT_HRESULT_SUCCEEDED(sniffer.InitializeCache(std::wstring())); diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index f060155..d4633d1 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -369,7 +369,7 @@ HRESULT BSCBStorageBind::MayPlayBack(DWORD flags) { if (data_sniffer_.is_cache_valid()) { if (data_sniffer_.is_chrome()) { - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_ctx_, info.Receive()); DCHECK(info); if (info) { diff --git a/chrome_frame/urlmon_bind_status_callback.h b/chrome_frame/urlmon_bind_status_callback.h index 8d8f4c4..dc31039 100644 --- a/chrome_frame/urlmon_bind_status_callback.h +++ b/chrome_frame/urlmon_bind_status_callback.h @@ -78,7 +78,7 @@ class SniffData { return (size_ != 0); } - ScopedComPtr<IStream> cache_; + base::win::ScopedComPtr<IStream> cache_; std::wstring url_; RendererType renderer_type_; size_t size_; diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc index b7cc23d..12ce098 100644 --- a/chrome_frame/urlmon_moniker.cc +++ b/chrome_frame/urlmon_moniker.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,8 +11,8 @@ #include "base/utf_string_conversions.h" #include "chrome_frame/bho.h" #include "chrome_frame/bind_context_info.h" -#include "chrome_frame/exception_barrier.h" #include "chrome_frame/chrome_active_document.h" +#include "chrome_frame/exception_barrier.h" #include "chrome_frame/urlmon_bind_status_callback.h" #include "chrome_frame/utils.h" #include "chrome_frame/vtable_patch_manager.h" @@ -38,11 +38,11 @@ HRESULT NavigationManager::NavigateToCurrentUrlInCF(IBrowserService* browser) { MarkBrowserOnThreadForCFNavigation(browser); HRESULT hr = S_OK; - ScopedComPtr<IShellBrowser> shell_browser; - ScopedComPtr<IBindCtx> bind_context; + base::win::ScopedComPtr<IShellBrowser> shell_browser; + base::win::ScopedComPtr<IBindCtx> bind_context; hr = ::CreateAsyncBindCtxEx(NULL, 0, NULL, NULL, bind_context.Receive(), 0); - ScopedComPtr<IMoniker> moniker; + base::win::ScopedComPtr<IMoniker> moniker; DCHECK(bind_context); if (SUCCEEDED(hr) && SUCCEEDED(hr = ::CreateURLMonikerEx(NULL, url_.c_str(), moniker.Receive(), @@ -100,7 +100,7 @@ bool MonikerPatch::Initialize() { return true; } - ScopedComPtr<IMoniker> moniker; + base::win::ScopedComPtr<IMoniker> moniker; HRESULT hr = ::CreateURLMoniker(NULL, L"http://localhost/", moniker.Receive()); DCHECK(SUCCEEDED(hr)); @@ -133,7 +133,7 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) { return false; } - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context, info.Receive()); DCHECK(info); if (info && info->chrome_request()) { @@ -152,10 +152,10 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) { // Check whether request comes from MSHTML by checking for IInternetBindInfo. // We prefer to avoid wrapping if BindToStorage is called from AcroPDF.dll // (as a result of OnObjectAvailable) - ScopedComPtr<IUnknown> bscb_holder; + base::win::ScopedComPtr<IUnknown> bscb_holder; if (S_OK == bind_context->GetObjectParam(L"_BSCB_Holder_", bscb_holder.Receive())) { - ScopedComPtr<IBindStatusCallback> bscb; + base::win::ScopedComPtr<IBindStatusCallback> bscb; if (S_OK != DoQueryService(IID_IBindStatusCallback, bscb_holder, bscb.Receive())) return false; @@ -163,7 +163,7 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) { if (!bscb.get()) return false; - ScopedComPtr<IInternetBindInfo> bind_info; + base::win::ScopedComPtr<IInternetBindInfo> bind_info; if (S_OK != bind_info.QueryFrom(bscb)) return false; } @@ -171,10 +171,10 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) { // TODO(ananta) // Use the IsSubFrameRequest function to determine if a request is a top // level request. Something like this. - // ScopedComPtr<IUnknown> bscb_holder; + // base::win::ScopedComPtr<IUnknown> bscb_holder; // bind_context->GetObjectParam(L"_BSCB_Holder_", bscb_holder.Receive()); // if (bscb_holder) { - // ScopedComPtr<IHttpNegotiate> http_negotiate; + // base::win::ScopedComPtr<IHttpNegotiate> http_negotiate; // http_negotiate.QueryFrom(bscb_holder); // if (http_negotiate && !IsSubFrameRequest(http_negotiate)) // return true; @@ -201,7 +201,7 @@ HRESULT MonikerPatch::BindToObject(IMoniker_BindToObject_Fn original, HRESULT hr = S_OK; // Bind context is marked for switch when we sniff data in BSCBStorageBind // and determine that the renderer to be used is Chrome. - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_ctx, info.Receive()); DCHECK(info); if (info) { diff --git a/chrome_frame/urlmon_upload_data_stream_unittest.cc b/chrome_frame/urlmon_upload_data_stream_unittest.cc index efa8f1b..8bab45a 100644 --- a/chrome_frame/urlmon_upload_data_stream_unittest.cc +++ b/chrome_frame/urlmon_upload_data_stream_unittest.cc @@ -5,7 +5,7 @@ #include "gtest/gtest.h" #include "base/memory/ref_counted.h" -#include "base/scoped_comptr_win.h" +#include "base/win/scoped_comptr.h" #include "chrome_frame/urlmon_upload_data_stream.h" TEST(UrlmonUploadDataStreamTest, TestBasicRead) { @@ -20,7 +20,7 @@ TEST(UrlmonUploadDataStreamTest, TestBasicRead) { ASSERT_TRUE(SUCCEEDED(hr)); upload_stream->Initialize(upload_data.get()); - ScopedComPtr<IStream> upload_istream(upload_stream); + base::win::ScopedComPtr<IStream> upload_istream(upload_stream); char buffer[500]; memset(buffer, 0, 500); @@ -55,7 +55,7 @@ TEST(UrlmonUploadDataStreamTest, TestBigRead) { ASSERT_TRUE(SUCCEEDED(hr)); upload_stream->Initialize(upload_data.get()); - ScopedComPtr<IStream> upload_istream(upload_stream); + base::win::ScopedComPtr<IStream> upload_istream(upload_stream); char big_rcv_buffer[kBigBufferLength]; int write_pos = 0; @@ -89,7 +89,7 @@ TEST(UrlmonUploadDataStreamTest, TestStat) { ASSERT_TRUE(SUCCEEDED(hr)); upload_stream->Initialize(upload_data.get()); - ScopedComPtr<IStream> upload_istream(upload_stream); + base::win::ScopedComPtr<IStream> upload_istream(upload_stream); STATSTG statstg; hr = upload_stream->Stat(&statstg, STATFLAG_NONAME); @@ -110,7 +110,7 @@ TEST(UrlmonUploadDataStreamTest, TestRepeatedRead) { ASSERT_TRUE(SUCCEEDED(hr)); upload_stream->Initialize(upload_data.get()); - ScopedComPtr<IStream> upload_istream(upload_stream); + base::win::ScopedComPtr<IStream> upload_istream(upload_stream); char buffer[500]; memset(buffer, 0, 500); @@ -145,7 +145,7 @@ TEST(UrlmonUploadDataStreamTest, TestZeroRead) { ASSERT_TRUE(SUCCEEDED(hr)); upload_stream->Initialize(upload_data.get()); - ScopedComPtr<IStream> upload_istream(upload_stream); + base::win::ScopedComPtr<IStream> upload_istream(upload_stream); char buffer[500]; memset(buffer, 0, 500); diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 3af5833..a8cdec8 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -4,8 +4,8 @@ #include "chrome_frame/urlmon_url_request.h" -#include <wininet.h> #include <urlmon.h> +#include <wininet.h> #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -14,14 +14,14 @@ #include "base/stringprintf.h" #include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" +#include "chrome/common/automation_messages.h" #include "chrome_frame/bind_context_info.h" #include "chrome_frame/chrome_frame_activex_base.h" #include "chrome_frame/extra_system_apis.h" #include "chrome_frame/html_utils.h" -#include "chrome_frame/urlmon_url_request_private.h" #include "chrome_frame/urlmon_upload_data_stream.h" +#include "chrome_frame/urlmon_url_request_private.h" #include "chrome_frame/utils.h" -#include "chrome/common/automation_messages.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" @@ -185,7 +185,7 @@ void UrlmonUrlRequest::TerminateBind(TerminateBindCallback* callback) { // should get E_PENDING back and then later we'll get that call // to OnDataAvailable. std::string data; - ScopedComPtr<IStream> read_stream(pending_data_); + base::win::ScopedComPtr<IStream> read_stream(pending_data_); HRESULT hr; while ((hr = ReadStream(read_stream, 0xffff, &data)) == S_OK) { // Just drop the data. @@ -219,7 +219,7 @@ size_t UrlmonUrlRequest::SendDataToDelegate(size_t bytes_to_read) { // where we can get a call to OnDataAvailable while inside Read and // in our OnDataAvailable call, we can release the stream object // while still using it. - ScopedComPtr<IStream> pending(pending_data_); + base::win::ScopedComPtr<IStream> pending(pending_data_); HRESULT hr = ReadStream(pending, bytes_to_read, &read_data); if (read_data.empty()) pending_read_size_ = pending_data_read_save; @@ -298,7 +298,7 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress, // If we receive a redirect for the initial pending request initiated // when our document loads we should stash it away and inform Chrome // accordingly when it requests data for the original URL. - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context_, info.Receive()); DCHECK(info); GURL previously_redirected(info ? info->GetUrl() : std::wstring()); @@ -805,16 +805,16 @@ HRESULT UrlmonUrlRequest::StartAsyncDownload() { } if (SUCCEEDED(hr)) { - ScopedComPtr<IStream> stream; + base::win::ScopedComPtr<IStream> stream; // BindToStorage may complete synchronously. // We still get all the callbacks - OnStart/StopBinding, this may result // in destruction of our object. It's fine but we access some members // below for debug info. :) - ScopedComPtr<IHttpSecurity> self(this); + base::win::ScopedComPtr<IHttpSecurity> self(this); // Inform our moniker patch this binding should not be tortured. - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context_, info.Receive()); DCHECK(info); if (info) @@ -871,7 +871,7 @@ void UrlmonUrlRequest::TerminateTransaction() { // on this with the special flags 0x2000000 cleanly releases the // transaction. static const int kUrlmonTerminateTransactionFlags = 0x2000000; - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_context_, info.Receive()); DCHECK(info); if (info && info->protocol()) { @@ -964,7 +964,7 @@ void UrlmonUrlRequestManager::SetInfoForUrl(const std::wstring& url, DCHECK(start_url.is_valid()); DCHECK(pending_request_ == NULL); - ScopedComPtr<BindContextInfo> info; + base::win::ScopedComPtr<BindContextInfo> info; BindContextInfo::FromBindContext(bind_ctx, info.Receive()); DCHECK(info); IStream* cache = info ? info->cache() : NULL; diff --git a/chrome_frame/urlmon_url_request_private.h b/chrome_frame/urlmon_url_request_private.h index 60ca118..498fb5d 100644 --- a/chrome_frame/urlmon_url_request_private.h +++ b/chrome_frame/urlmon_url_request_private.h @@ -228,11 +228,11 @@ class UrlmonUrlRequest }; Status status_; - ScopedComPtr<IBinding> binding_; - ScopedComPtr<IMoniker> moniker_; - ScopedComPtr<IBindCtx> bind_context_; - ScopedComPtr<IStream> cache_; - ScopedComPtr<IStream> pending_data_; + base::win::ScopedComPtr<IBinding> binding_; + base::win::ScopedComPtr<IMoniker> moniker_; + base::win::ScopedComPtr<IBindCtx> bind_context_; + base::win::ScopedComPtr<IStream> cache_; + base::win::ScopedComPtr<IStream> pending_data_; size_t pending_read_size_; base::PlatformThreadId thread_; diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 1db94dc..69c4b31 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,7 +42,6 @@ #include "chrome_tab.h" // NOLINT using base::win::RegKey; -using base::win::ScopedComPtr; // Note that these values are all lower case and are compared to // lower-case-transformed values. @@ -467,7 +466,7 @@ FilePath GetIETemporaryFilesFolder() { HRESULT hr = SHGetFolderLocation(NULL, CSIDL_INTERNET_CACHE, NULL, SHGFP_TYPE_CURRENT, &tif_pidl); if (SUCCEEDED(hr) && tif_pidl) { - ScopedComPtr<IShellFolder> parent_folder; + base::win::ScopedComPtr<IShellFolder> parent_folder; LPITEMIDLIST relative_pidl = NULL; hr = SHBindToParent(tif_pidl, IID_IShellFolder, reinterpret_cast<void**>(parent_folder.Receive()), @@ -798,7 +797,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, DCHECK(moniker); DCHECK(bind_ctx); - ScopedComPtr<IWebBrowser2> web_browser2; + base::win::ScopedComPtr<IWebBrowser2> web_browser2; HRESULT hr = DoQueryService(SID_SWebBrowserApp, browser, web_browser2.Receive()); DCHECK(web_browser2); @@ -862,7 +861,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, // HlinkSimpleNavigateToMoniker(moniker, url, NULL, host, bind_context, // NULL, 0, 0); - ScopedComPtr<IUriContainer> uri_container; + base::win::ScopedComPtr<IUriContainer> uri_container; hr = uri_container.QueryFrom(moniker); base::win::ScopedVariant headers_var; @@ -878,7 +877,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, &IID_IWebBrowserPriv2IE8XPBeta, }; - ScopedComPtr<IWebBrowserPriv2Common, NULL> browser_priv2; + base::win::ScopedComPtr<IWebBrowserPriv2Common, NULL> browser_priv2; for (int i = 0; i < arraysize(interface_ids) && browser_priv2 == NULL; ++i) { hr = web_browser2.QueryInterface(*interface_ids[i], @@ -888,7 +887,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, DCHECK(browser_priv2); if (browser_priv2) { - ScopedComPtr<IUri> uri_obj; + base::win::ScopedComPtr<IUri> uri_obj; uri_container->GetIUri(uri_obj.Receive()); DCHECK(uri_obj); @@ -913,7 +912,7 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, LPOLESTR url = NULL; if (SUCCEEDED(hr = moniker->GetDisplayName(bind_ctx, NULL, &url))) { DVLOG(1) << __FUNCTION__ << " " << url; - ScopedComPtr<IWebBrowserPriv> browser_priv; + base::win::ScopedComPtr<IWebBrowserPriv> browser_priv; if (SUCCEEDED(hr = browser_priv.QueryFrom(web_browser2))) { GURL target_url(url); // On IE6 if the original URL has a fragment then the navigation @@ -1021,14 +1020,14 @@ bool IsSubFrameRequest(IUnknown* service_provider) { // We need to be able to get at an IWebBrowser2 if we are to decide whether // this request originates from a non-top-level frame. - ScopedComPtr<IWebBrowser2> web_browser; + base::win::ScopedComPtr<IWebBrowser2> web_browser; HRESULT hr = DoQueryService(IID_ITargetFrame2, service_provider, web_browser.Receive()); bool is_sub_frame_request = false; if (web_browser) { // Now check to see if we are in a sub-frame. - ScopedComPtr<IHTMLWindow2> current_frame, parent_frame; + base::win::ScopedComPtr<IHTMLWindow2> current_frame, parent_frame; hr = DoQueryService(IID_IHTMLWindow2, service_provider, current_frame.Receive()); if (current_frame) { @@ -1181,7 +1180,7 @@ std::string GetHttpHeadersFromBinding(IBinding* binding) { return std::string(); } - ScopedComPtr<IWinInetHttpInfo> info; + base::win::ScopedComPtr<IWinInetHttpInfo> info; if (FAILED(info.QueryFrom(binding))) { DLOG(WARNING) << "Failed to QI for IWinInetHttpInfo"; return std::string(); @@ -1199,7 +1198,7 @@ int GetHttpResponseStatusFromBinding(IBinding* binding) { int http_status = 0; - ScopedComPtr<IWinInetHttpInfo> info; + base::win::ScopedComPtr<IWinInetHttpInfo> info; if (SUCCEEDED(info.QueryFrom(binding))) { char status[10] = {0}; DWORD buf_size = sizeof(status); @@ -1632,13 +1631,13 @@ bool IsChromeFrameDocument(IWebBrowser2* web_browser) { if (!web_browser) return false; - ScopedComPtr<IDispatch> doc; + base::win::ScopedComPtr<IDispatch> doc; web_browser->get_Document(doc.Receive()); if (doc) { // Detect if CF is rendering based on whether the document is a // ChromeActiveDocument. Detecting based on hwnd is problematic as // the CF Active Document window may not have been created yet. - ScopedComPtr<IChromeFrame> chrome_frame; + base::win::ScopedComPtr<IChromeFrame> chrome_frame; chrome_frame.QueryFrom(doc); return chrome_frame.get() != NULL; } |