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

Unified Diff: src/plugin/PluginMimeFilterClient.cpp

Issue 5032147387678720: NoIssue - Refactor HTTP and HTTPS namespaces registration
Patch Set: Fix the renaming patchset Created April 24, 2015, 11:57 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
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginMimeFilterClient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginMimeFilterClient.cpp
===================================================================
deleted file mode 100644
--- a/src/plugin/PluginMimeFilterClient.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "PluginStdAfx.h"
-
-#include "PluginMimeFilterClient.h"
-#include "PluginClient.h"
-#include "PluginWbPassThrough.h"
-
-
-typedef PassthroughAPP::CMetaFactory<PassthroughAPP::CComClassFactoryProtocol,WBPassthru> MetaFactory;
-
-
-CPluginMimeFilterClient::CPluginMimeFilterClient() : m_spCFHTTP(NULL), m_spCFHTTPS(NULL)
-{
- // Should only be called once
- // We register mime filters here
- // Register asynchronous protocol
- CComPtr<IInternetSession> spSession;
- HRESULT hr = ::CoInternetGetSession(0, &spSession, 0);
- if (FAILED(hr) || !spSession)
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_GET_INTERNET_SESSION, "MimeClient::CoInternetGetSession failed");
- return;
- }
-
- hr = MetaFactory::CreateInstance(CLSID_HttpProtocol, &m_spCFHTTP);
- if (FAILED(hr) || !m_spCFHTTP)
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_CREATE_HTTP_INSTANCE, "MimeClient::CreateInstance failed");
- return;
- }
-
- hr = spSession->RegisterNameSpace(m_spCFHTTP, CLSID_HttpProtocol, L"http", 0, 0, 0);
- if (FAILED(hr))
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_REGISTER_HTTP_NAMESPACE, "MimeClient::RegisterNameSpace failed");
- return;
- }
-
- hr = MetaFactory::CreateInstance(CLSID_HttpSProtocol, &m_spCFHTTPS);
- if (FAILED(hr) || !m_spCFHTTPS)
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_CREATE_HTTPS_INSTANCE, "MimeClient::CreateInstance failed");
- return;
- }
-
- hr = spSession->RegisterNameSpace(m_spCFHTTPS, CLSID_HttpSProtocol, L"https", 0, 0, 0);
- if (FAILED(hr))
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_REGISTER_HTTPS_NAMESPACE, "MimeClient::RegisterNameSpace failed");
- return;
- }
-
-}
-
-
-CPluginMimeFilterClient::~CPluginMimeFilterClient()
-{
- CComPtr<IInternetSession> spSession;
-
- ::CoInternetGetSession(0, &spSession, 0);
- if (spSession)
- {
- spSession->UnregisterNameSpace(m_spCFHTTP, L"http");
- if (m_spCFHTTP != NULL)
- {
- m_spCFHTTP.Release();
- m_spCFHTTP = NULL;
- }
- spSession->UnregisterNameSpace(m_spCFHTTPS, L"https");
- if (m_spCFHTTPS != NULL)
- {
- m_spCFHTTPS.Release();
- m_spCFHTTPS = NULL;
- }
-
- }
-}
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginMimeFilterClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld