2
* Copyright 2013 Google Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
// Author: morlovich@google.com (Maksim Orlovich)
19
// Contains UserAgentSensitiveTestFetcher, which appends the UA string as a
20
// query param before delegating to another fetcher. Meant for use in
23
#ifndef NET_INSTAWEB_HTTP_PUBLIC_UA_SENSITIVE_TEST_FETCHER_H_
24
#define NET_INSTAWEB_HTTP_PUBLIC_UA_SENSITIVE_TEST_FETCHER_H_
26
#include "net/instaweb/http/public/url_async_fetcher.h"
27
#include "pagespeed/kernel/base/basictypes.h"
28
#include "pagespeed/kernel/base/string.h"
30
namespace net_instaweb {
35
// A helper fetcher that adds in UA to the URL, so we can use
36
// MockUrlAsyncFetcher w/UA-sensitive things. It also enforces the
38
class UserAgentSensitiveTestFetcher : public UrlAsyncFetcher {
40
explicit UserAgentSensitiveTestFetcher(UrlAsyncFetcher* base_fetcher);
41
virtual void Fetch(const GoogleString& url,
42
MessageHandler* message_handler,
45
virtual bool SupportsHttps() const;
48
UrlAsyncFetcher* base_fetcher_;
50
DISALLOW_COPY_AND_ASSIGN(UserAgentSensitiveTestFetcher);
53
} // namespace net_instaweb
55
#endif // NET_INSTAWEB_HTTP_PUBLIC_UA_SENSITIVE_TEST_FETCHER_H_