1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // MeasurePageLoadTimeBHO.h : Declaration of the CMeasurePageLoadTimeBHO
7 #include "resource.h" // main symbols
9 #include <shlguid.h> // IID_IWebBrowser2, DIID_DWebBrowserEvents2, et
10 #include <exdispid.h> // DISPID_DOCUMENTCOMPLETE, etc.
14 #include "MeasurePageLoadTime.h"
17 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
18 #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM objects and allow use of its single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
23 // CMeasurePageLoadTimeBHO
25 class ATL_NO_VTABLE CMeasurePageLoadTimeBHO
:
26 public CComObjectRootEx
<CComSingleThreadModel
>,
27 public CComCoClass
<CMeasurePageLoadTimeBHO
, &CLSID_MeasurePageLoadTimeBHO
>,
28 public IObjectWithSiteImpl
<CMeasurePageLoadTimeBHO
>,
29 public IDispatchImpl
<IMeasurePageLoadTimeBHO
, &IID_IMeasurePageLoadTimeBHO
, &LIBID_MeasurePageLoadTimeLib
, /*wMajor =*/ 1, /*wMinor =*/ 0>,
30 public IDispEventImpl
<1, CMeasurePageLoadTimeBHO
, &DIID_DWebBrowserEvents2
, &LIBID_SHDocVw
, 1, 1>
33 CMeasurePageLoadTimeBHO()
37 DECLARE_REGISTRY_RESOURCEID(IDR_MEASUREPAGELOADTIMEBHO
)
39 DECLARE_NOT_AGGREGATABLE(CMeasurePageLoadTimeBHO
)
41 BEGIN_COM_MAP(CMeasurePageLoadTimeBHO
)
42 COM_INTERFACE_ENTRY(IMeasurePageLoadTimeBHO
)
43 COM_INTERFACE_ENTRY(IDispatch
)
44 COM_INTERFACE_ENTRY(IObjectWithSite
)
47 BEGIN_SINK_MAP(CMeasurePageLoadTimeBHO
)
48 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2
, DISPID_DOCUMENTCOMPLETE
, OnDocumentComplete
)
52 void STDMETHODCALLTYPE
OnDocumentComplete(IDispatch
*pDisp
, VARIANT
*pvarURL
);
53 STDMETHOD(SetSite
)(IUnknown
*pUnkSite
);
55 DECLARE_PROTECT_FINAL_CONSTRUCT()
57 HRESULT
FinalConstruct()
66 void ProcessPageTimeRequests(void);
67 void VisitNextURL(void);
71 CComPtr
<IWebBrowser2
> m_spWebBrowser
;
74 // Handle to global interface table
77 // Handle to event to signal when navigation completes
80 // Socket for accepting incoming connections
83 // Socket for communicating with remote peers
84 SOCKET m_sockTransport
;
87 OBJECT_ENTRY_AUTO(__uuidof(MeasurePageLoadTimeBHO
), CMeasurePageLoadTimeBHO
)