Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
measurement_proxy_url_namer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
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
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
19 
20 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_MEASUREMENT_PROXY_URL_NAMER_H_
21 #define NET_INSTAWEB_REWRITER_PUBLIC_MEASUREMENT_PROXY_URL_NAMER_H_
22 
24 
28 
29 namespace net_instaweb {
30 
31 class GoogleUrl;
32 class RewriteOptions;
33 
40  public:
41  MeasurementProxyUrlNamer(const GoogleString& top_origin,
42  const GoogleString& password);
43  ~MeasurementProxyUrlNamer() override;
44 
45  bool Decode(const GoogleUrl& request_url,
46  const RewriteOptions* rewrite_options,
47  GoogleString* decoded) const override;
48 
49  static bool DecodePathDetails(const GoogleUrl& request_url,
50  StringPiece* config,
51  StringPiece* config_domain,
52  StringPiece* password,
53  GoogleString* res_url);
54 
55  bool IsAuthorized(const GoogleUrl& request_url,
56  const RewriteOptions& options) const override {
58  return true;
59  }
60 
61  ProxyExtent ProxyMode() const override { return ProxyExtent::kInputOnly; }
62  bool IsProxyEncoded(const GoogleUrl& url) const override;
63 
64  private:
65  GoogleString top_origin_;
66  GoogleString password_;
67 
68 
69 };
70 
71 }
72 
73 #endif
Definition: url_namer.h:38
class GoogleUrl
Definition: google_url.h:58
ProxyExtent
Definition: url_namer.h:47
bool IsAuthorized(const GoogleUrl &request_url, const RewriteOptions &options) const override
Definition: measurement_proxy_url_namer.h:55
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
ProxyExtent ProxyMode() const override
Definition: measurement_proxy_url_namer.h:61
bool IsProxyEncoded(const GoogleUrl &url) const override
Definition: measurement_proxy_url_namer.h:39
Definition: rewrite_options.h:84
bool Decode(const GoogleUrl &request_url, const RewriteOptions *rewrite_options, GoogleString *decoded) const override