summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 18:09:12 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 18:09:12 +0000
commite28b0fbbcde1c08e4dfbff7d4bd8e1f292892b9c (patch)
treef95fb6c3e7fad45259ac16ca3c8fccc9fde5d312 /base
parent8416157dd9a3e5bd61f605e1d420d8cf6a4ef9ca (diff)
downloadchromium_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 'base')
-rw-r--r--base/scoped_bstr_win.h6
-rw-r--r--base/scoped_variant_win.cc11
-rw-r--r--base/scoped_variant_win.h7
3 files changed, 20 insertions, 4 deletions
diff --git a/base/scoped_bstr_win.h b/base/scoped_bstr_win.h
index 96979b5..04f27e1 100644
--- a/base/scoped_bstr_win.h
+++ b/base/scoped_bstr_win.h
@@ -5,13 +5,11 @@
#ifndef BASE_SCOPED_BSTR_WIN_H_
#define BASE_SCOPED_BSTR_WIN_H_
-#include "base/basictypes.h" // needed to pick up OS_WIN
-
-#include "base/logging.h"
-
#include <windows.h>
#include <oleauto.h>
+#include "base/logging.h"
+
// Manages a BSTR string pointer.
// The class interface is based on scoped_ptr.
class ScopedBstr {
diff --git a/base/scoped_variant_win.cc b/base/scoped_variant_win.cc
index 6593a477..dd4bceb 100644
--- a/base/scoped_variant_win.cc
+++ b/base/scoped_variant_win.cc
@@ -28,6 +28,12 @@ ScopedVariant::ScopedVariant(int value, VARTYPE vt) {
var_.lVal = value;
}
+ScopedVariant::ScopedVariant(double value, VARTYPE vt) {
+ DCHECK(vt == VT_R8 || vt == VT_DATE);
+ var_.vt = vt;
+ var_.dblVal = value;
+}
+
ScopedVariant::ScopedVariant(IDispatch* dispatch) {
var_.vt = VT_EMPTY;
Set(dispatch);
@@ -38,6 +44,11 @@ ScopedVariant::ScopedVariant(IUnknown* unknown) {
Set(unknown);
}
+ScopedVariant::ScopedVariant(SAFEARRAY* safearray) {
+ var_.vt = VT_EMPTY;
+ Set(safearray);
+}
+
ScopedVariant::ScopedVariant(const VARIANT& var) {
var_.vt = VT_EMPTY;
Set(var);
diff --git a/base/scoped_variant_win.h b/base/scoped_variant_win.h
index 909e4da..4436ca9 100644
--- a/base/scoped_variant_win.h
+++ b/base/scoped_variant_win.h
@@ -40,12 +40,19 @@ class ScopedVariant {
// VARIANT.lVal (32 bit sized field).
explicit ScopedVariant(int value, VARTYPE vt = VT_I4);
+ // Creates a new double-precision type variant. |vt| must be either VT_R8
+ // or VT_DATE.
+ explicit ScopedVariant(double value, VARTYPE vt = VT_R8);
+
// VT_DISPATCH
explicit ScopedVariant(IDispatch* dispatch);
// VT_UNKNOWN
explicit ScopedVariant(IUnknown* unknown);
+ // SAFEARRAY
+ explicit ScopedVariant(SAFEARRAY* safearray);
+
// Copies the variant.
explicit ScopedVariant(const VARIANT& var);