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

Unified Diff: chrome/browser/history/history_publisher_win.cc

Issue 200045: Use Scoped[Bstr,ComPtr,Variant] instead of their ATL equivalents to reduce de... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_accessibility.cc ('k') | chrome/browser/importer/ie_importer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_publisher_win.cc
===================================================================
--- chrome/browser/history/history_publisher_win.cc (revision 25862)
+++ chrome/browser/history/history_publisher_win.cc (working copy)
@@ -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 @@
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);
tommi (sloooow) - chröme 2009/09/10 20:22:42 one more absolute nit... you might want to surroun
+ 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);
}
}
« no previous file with comments | « chrome/browser/browser_accessibility.cc ('k') | chrome/browser/importer/ie_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698