Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginWbPassThrough.cpp

Issue 5748224216268800: No issue - some cleanup in PluginWbPassThrough (Closed)
Patch Set: Created Nov. 13, 2014, 10:20 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/PluginWbPassThrough.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginWbPassThrough.cpp
===================================================================
--- a/src/plugin/PluginWbPassThrough.cpp
+++ b/src/plugin/PluginWbPassThrough.cpp
@@ -13,7 +13,7 @@
namespace
{
- std::string g_blockedByABPPage = "<!DOCTYPE html>"
+ const std::string g_blockedByABPPage = "<!DOCTYPE html>"
"<html>"
"<body>"
"<!-- blocked by AdblockPlus -->"
@@ -43,7 +43,7 @@
// only HTTP_QUERY_RAW_HEADERS_CRLF | HTTP_QUERY_FLAG_REQUEST_HEADERS does work.
ATL::CComPtr<IWinInetHttpInfo> winInetHttpInfo;
HRESULT hr = internetProtocol->QueryInterface(&winInetHttpInfo);
- if (FAILED(hr))
+ if (FAILED(hr) || !winInetHttpInfo)
{
return "";
}
@@ -181,11 +181,7 @@
HRESULT WBPassthruSink::OnRead(void* pv, ULONG cb, ULONG* pcbRead)
{
- if (pv == nullptr)
- {
- return E_POINTER;
- }
- if (pcbRead == nullptr)
+ if (!pv || !pcbRead)
{
return E_POINTER;
}
@@ -278,6 +274,10 @@
STDMETHODIMP WBPassthruSink::BeginningTransaction(LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR* pszAdditionalHeaders)
{
+ if (!szURL || !szHeaders)
Oleksandr 2014/11/19 02:34:59 Why can't szHeaders be nullptr? I think it may hap
sergei 2014/11/19 11:05:02 May be it can. I assumed that if it's [in] paramet
+ {
+ return E_POINTER;
+ }
std::wstring src = szURL;
DEBUG_GENERAL(ToCString(src));
@@ -390,14 +390,4 @@
{
WBPassthruSink* pSink = GetSink();
return pSink->OnRead(pv, cb, pcbRead);
-}
-
-STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options)
-{
- return BaseClass::LockRequest(options);
-}
-
-STDMETHODIMP WBPassthru::UnlockRequest()
-{
- return BaseClass::UnlockRequest();
}
« no previous file with comments | « src/plugin/PluginWbPassThrough.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld