diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 18:09:12 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 18:09:12 +0000 |
commit | e28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c (patch) | |
tree | f95fb6c3e7fad45259ac16ca3c8fccc9fde5d312 /chrome/browser/history | |
parent | 8416157dd9a3e5bd61f605e1d420d8cf6a4ef9ca (diff) | |
download | chromium_src-e28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c.zip chromium_src-e28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c.tar.gz chromium_src-e28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c.tar.bz2 |
Use Scoped[Bstr,ComPtr,Variant] instead of their ATL equivalents to reduce dependencies on ATL.
BUG=5027
TEST=none
Review URL: http://codereview.chromium.org/200045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25879 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/history_publisher_win.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/chrome/browser/history/history_publisher_win.cc b/chrome/browser/history/history_publisher_win.cc index 54e9da4..cbde619 100644 --- a/chrome/browser/history/history_publisher_win.cc +++ b/chrome/browser/history/history_publisher_win.cc @@ -10,7 +10,10 @@ #include <wtypes.h> #include "base/registry.h" +#include "base/scoped_bstr_win.h" #include "base/scoped_comptr_win.h" +#include "base/scoped_variant_win.h" +#include "base/string_util.h" #include "base/time.h" #include "googleurl/src/gurl.h" @@ -107,30 +110,29 @@ void HistoryPublisher::PublishDataToIndexers(const PageData& page_data) CComSafeArray<unsigned char> thumbnail_arr; if (page_data.thumbnail) { - for(size_t i = 0; i < page_data.thumbnail->size(); ++i) + for (size_t i = 0; i < page_data.thumbnail->size(); ++i) thumbnail_arr.Add((*page_data.thumbnail)[i]); } // Send data to registered indexers. - for(size_t i = 0; i < indexers_.size(); ++i) { - indexers_[i]->SendPageData( - CComVariant(var_time, VT_DATE), - CComBSTR(page_data.url.spec().c_str()), - CComBSTR(page_data.html), - CComBSTR(page_data.title), - CComBSTR(page_data.thumbnail_format), - CComVariant(thumbnail_arr.m_psa)); + ScopedVariant time(var_time, VT_DATE); + ScopedBstr url(ASCIIToWide(page_data.url.spec()).c_str()); + ScopedBstr html(page_data.html); + ScopedBstr title(page_data.title); + ScopedBstr format(ASCIIToWide(page_data.thumbnail_format).c_str()); + ScopedVariant psa(thumbnail_arr.m_psa); + for (size_t i = 0; i < indexers_.size(); ++i) { + indexers_[i]->SendPageData(time, url, html, title, format, psa); } } void HistoryPublisher::DeleteUserHistoryBetween(const base::Time& begin_time, const base::Time& end_time) const { - double var_begin_time = TimeToUTCVariantTime(begin_time); - double var_end_time = TimeToUTCVariantTime(end_time); - for(size_t i = 0; i < indexers_.size(); ++i) { - indexers_[i]->DeleteUserHistoryBetween(CComVariant(var_begin_time, VT_DATE), - CComVariant(var_end_time, VT_DATE)); + ScopedVariant var_begin_time(TimeToUTCVariantTime(begin_time), VT_DATE); + ScopedVariant var_end_time(TimeToUTCVariantTime(end_time), VT_DATE); + for (size_t i = 0; i < indexers_.size(); ++i) { + indexers_[i]->DeleteUserHistoryBetween(var_begin_time, var_end_time); } } |