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

Unified Diff: chrome_frame/protocol_sink_wrap.h

Issue 259025: Add the chromeframe tag to the user agent header at runtime instead of static... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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_frame/http_negotiate.cc ('k') | chrome_frame/protocol_sink_wrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/protocol_sink_wrap.h
===================================================================
--- chrome_frame/protocol_sink_wrap.h (revision 29337)
+++ chrome_frame/protocol_sink_wrap.h (working copy)
@@ -9,6 +9,7 @@
#include <urlmon.h>
#include <atlbase.h>
#include <atlcom.h>
+
#include <map>
#include <string>
@@ -17,6 +18,7 @@
#include "base/scoped_comptr_win.h"
#include "googleurl/src/gurl.h"
#include "chrome_frame/ie8_types.h"
+#include "chrome_frame/utils.h"
#include "chrome_frame/vtable_patch_manager.h"
// Typedefs for IInternetProtocol and related methods that we patch.
@@ -60,11 +62,6 @@
public IUriContainer {
public:
-#define COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(x) \
- COM_INTERFACE_ENTRY_FUNC(_ATL_IIDOF(x), \
- offsetofclass(x, _ComMapClass), \
- IfDelegateSupports)
-
BEGIN_COM_MAP(ProtocolSinkWrap)
COM_INTERFACE_ENTRY(IInternetProtocolSink)
COM_INTERFACE_ENTRY(IInternetBindInfo)
@@ -77,7 +74,7 @@
COM_INTERFACE_ENTRY(IInternetPriority)
COM_INTERFACE_ENTRY(IWrappedProtocol)
COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(IUriContainer)
- COM_INTERFACE_ENTRY_FUNC_BLIND(0, CheckOutgoingInterface)
+ COM_INTERFACE_BLIND_DELEGATE()
END_COM_MAP()
ProtocolSinkWrap();
@@ -94,17 +91,17 @@
static void UnpatchProtocolHandlers();
// IInternetProtocol/Ex patches.
- static HRESULT STDMETHODCALLTYPE OnStart(InternetProtocol_Start_Fn orig_start,
+ static STDMETHODIMP OnStart(InternetProtocol_Start_Fn orig_start,
IInternetProtocol* protocol, LPCWSTR url,
IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info,
DWORD flags, HANDLE_PTR reserved);
- static HRESULT STDMETHODCALLTYPE OnStartEx(
+ static STDMETHODIMP OnStartEx(
InternetProtocol_StartEx_Fn orig_start_ex, IInternetProtocolEx* protocol,
IUri* uri, IInternetProtocolSink* prot_sink,
IInternetBindInfo* bind_info, DWORD flags, HANDLE_PTR reserved);
- static HRESULT STDMETHODCALLTYPE OnRead(InternetProtocol_Read_Fn orig_read,
+ static STDMETHODIMP OnRead(InternetProtocol_Read_Fn orig_read,
IInternetProtocol* protocol, void* buffer, ULONG size, ULONG* size_read);
// IInternetProtocolSink methods
@@ -155,6 +152,10 @@
// ITransProtocolSink, // Undocumented
// ITransactionInternal, // undocumented
+ IInternetProtocolSink* delegate() const {
+ return delegate_;
+ }
+
protected:
enum RendererType {
UNDETERMINED,
@@ -172,10 +173,6 @@
static ScopedComPtr<IInternetProtocolSink> MaybeWrapSink(
IInternetProtocol* protocol, IInternetProtocolSink* prot_sink,
const wchar_t* url);
- static HRESULT WINAPI CheckOutgoingInterface(void* obj, REFIID iid,
- LPVOID* ret, DWORD cookie);
- static HRESULT WINAPI IfDelegateSupports(void* obj, REFIID iid,
- LPVOID* ret, DWORD cookie);
void DetermineRendererType();
HRESULT OnReadImpl(void* buffer, ULONG size, ULONG* size_read,
@@ -207,15 +204,16 @@
// http://b/issue?id=2102171 for details.
// Remember original sink
- CComPtr<IInternetProtocolSink> delegate_;
+ ScopedComPtr<IInternetProtocolSink> delegate_;
+
// Cannot take a reference on the protocol.
IInternetProtocol* protocol_;
RendererType renderer_type_;
// Buffer for accumulated data including 1 extra for NULL-terminator
char buffer_[kMaxContentSniffLength + 1];
- unsigned long buffer_size_;
- unsigned long buffer_pos_;
+ unsigned long buffer_size_; // NOLINT
+ unsigned long buffer_pos_; // NOLINT
// Accumulated result
bool is_saved_result_;
@@ -236,6 +234,4 @@
DISALLOW_COPY_AND_ASSIGN(ProtocolSinkWrap);
};
-
#endif // CHROME_FRAME_PROTOCOL_SINK_WRAP_H_
-
« no previous file with comments | « chrome_frame/http_negotiate.cc ('k') | chrome_frame/protocol_sink_wrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698