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

Delta Between Two Patch Sets: src/plugin/PluginWbPassThrough.cpp

Issue 4974480757620736: Issue #1356 - Improve detection of the issuer of the request (Closed)
Left Patch Set: Reorder stuff in BeginningTransaction for clarity. Created Nov. 5, 2014, 10:01 a.m.
Right Patch Set: Rename the parameter Created Nov. 5, 2014, 4:51 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginWbPassThrough.h ('k') | src/plugin/SinkPolicy.inl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginWbPassThrough.h" 3 #include "PluginWbPassThrough.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #include "PluginFilter.h" 6 #include "PluginFilter.h"
7 #include "PluginSettings.h" 7 #include "PluginSettings.h"
8 #include "PluginClass.h" 8 #include "PluginClass.h"
9 #include "PluginSystem.h" 9 #include "PluginSystem.h"
10 #include <WinInet.h> 10 #include <WinInet.h>
11 #include "wtypes.h" 11 #include "wtypes.h"
12 #include "../shared/Utils.h" 12 #include "../shared/Utils.h"
13 13
14 namespace 14 namespace
15 { 15 {
16 std::string g_blockedByABPPage = "<!DOCTYPE html>" 16 std::string g_blockedByABPPage = "<!DOCTYPE html>"
17 "<html>" 17 "<html>"
18 "<body>" 18 "<body>"
19 "<!-- blocked by AdblockPlus -->" 19 "<!-- blocked by AdblockPlus -->"
20 "</body>" 20 "</body>"
21 "</html>"; 21 "</html>";
22 22
23 template <class T> 23 template <class T>
24 T ExtractHttpHeader(const T& allHeaders, const T& targetHeaderName, const T& d elimiter) 24 T ExtractHttpHeader(const T& allHeaders, const T& targetHeaderNameWithColon, c onst T& delimiter)
25 { 25 {
26 auto targetHeaderBeginsAt = allHeaders.find(targetHeaderName); 26 auto targetHeaderBeginsAt = allHeaders.find(targetHeaderNameWithColon);
27 if (targetHeaderBeginsAt == T::npos) 27 if (targetHeaderBeginsAt == T::npos)
28 { 28 {
29 return T(); 29 return T();
30 } 30 }
31 targetHeaderBeginsAt += targetHeaderName.length(); 31 targetHeaderBeginsAt += targetHeaderNameWithColon.length();
32 auto targetHeaderEndsAt = allHeaders.find(delimiter, targetHeaderBeginsAt); 32 auto targetHeaderEndsAt = allHeaders.find(delimiter, targetHeaderBeginsAt);
33 if (targetHeaderEndsAt == T::npos) 33 if (targetHeaderEndsAt == T::npos)
34 { 34 {
35 return T(); 35 return T();
36 } 36 }
37 return allHeaders.substr(targetHeaderBeginsAt, targetHeaderEndsAt - targetHe aderBeginsAt); 37 return allHeaders.substr(targetHeaderBeginsAt, targetHeaderEndsAt - targetHe aderBeginsAt);
38 } 38 }
39 39
40 std::string ExtractHttpAcceptHeader(IInternetProtocol* internetProtocol) 40 std::string ExtractHttpAcceptHeader(IInternetProtocol* internetProtocol)
41 { 41 {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 375
376 STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options) 376 STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options)
377 { 377 {
378 return BaseClass::LockRequest(options); 378 return BaseClass::LockRequest(options);
379 } 379 }
380 380
381 STDMETHODIMP WBPassthru::UnlockRequest() 381 STDMETHODIMP WBPassthru::UnlockRequest()
382 { 382 {
383 return BaseClass::UnlockRequest(); 383 return BaseClass::UnlockRequest();
384 } 384 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld