summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.h
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 19:48:36 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 19:48:36 +0000
commit3eb07da6e868e49e28cb5a6d8a57037f2c45a20e (patch)
treeb9e05e275e38b176b1473e0f9e66075706ca238b /chrome_frame/utils.h
parent55750b57e30ecc9f3657d1ebd08853e232ba4e23 (diff)
downloadchromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.zip
chromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.tar.gz
chromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.tar.bz2
TEST=new tests added.
Review URL: http://codereview.chromium.org/545093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.h')
-rw-r--r--chrome_frame/utils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h
index f42062c..e90a0d4 100644
--- a/chrome_frame/utils.h
+++ b/chrome_frame/utils.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/thread.h"
// utils.h : Various utility functions and classes
@@ -315,6 +316,25 @@ STDMETHODIMP QueryInterfaceIfDelegateSupports(void* obj, REFIID iid,
extern const wchar_t kChromeFrameHeadlessMode[];
+// Thread that enters STA and has a UI message loop.
+class STAThread : public base::Thread {
+ public:
+ explicit STAThread(const char *name) : Thread(name) {}
+ bool Start() {
+ return StartWithOptions(Options(MessageLoop::TYPE_UI, 0));
+ }
+ protected:
+ // Called just prior to starting the message loop
+ virtual void Init() {
+ ::CoInitialize(0);
+ }
+
+ // Called just after the message loop ends
+ virtual void CleanUp() {
+ ::CoUninitialize();
+ }
+};
+
// The urls retrieved from the IMoniker interface don't contain the anchor
// portion of the actual url navigated to. This function checks whether the
// url passed in the bho_url parameter contains an anchor and if yes checks