~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/net/instaweb/rewriter/public/url_input_resource.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2010 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
 
 
17
 
// Author: sligocki@google.com (Shawn Ligocki)
18
 
//
19
 
// Input resource created based on a network resource.
20
 
 
21
 
#ifndef NET_INSTAWEB_REWRITER_PUBLIC_URL_INPUT_RESOURCE_H_
22
 
#define NET_INSTAWEB_REWRITER_PUBLIC_URL_INPUT_RESOURCE_H_
23
 
 
24
 
#include "net/instaweb/http/public/request_context.h"
25
 
#include "net/instaweb/rewriter/public/cacheable_resource_base.h"
26
 
#include "net/instaweb/util/public/basictypes.h"
27
 
#include "net/instaweb/util/public/string_util.h"
28
 
#include "pagespeed/kernel/base/string.h"  // for GoogleString
29
 
 
30
 
namespace net_instaweb {
31
 
struct ContentType;
32
 
class RequestHeaders;
33
 
class RewriteDriver;
34
 
class Statistics;
35
 
 
36
 
class UrlInputResource : public CacheableResourceBase {
37
 
 public:
38
 
  // Created only from RewriteDriver::CreateInputResource*
39
 
  virtual ~UrlInputResource();
40
 
 
41
 
  static void InitStats(Statistics* stats);
42
 
 
43
 
 private:
44
 
  friend class RewriteDriver;
45
 
  friend class UrlInputResourceTest;
46
 
  UrlInputResource(RewriteDriver* rewrite_driver,
47
 
                   const ContentType* type,
48
 
                   const StringPiece& url,
49
 
                   bool is_authorized_domain);
50
 
 
51
 
  virtual void PrepareRequest(const RequestContextPtr& request_context,
52
 
                              RequestHeaders* headers);
53
 
 
54
 
  // If the resource is from a domain that is not explicitly authorized,
55
 
  // the domain for the resource is stored in origin_ by the constructor
56
 
  // so that when PrepareRequest is eventually called, this domain can be
57
 
  // temporarily authorized for fetching purposes. Note that this is done
58
 
  // to support inlining of unauthorized resources into the HTML, which is
59
 
  // considered to be a safe action.
60
 
  GoogleString origin_;
61
 
 
62
 
  DISALLOW_COPY_AND_ASSIGN(UrlInputResource);
63
 
};
64
 
 
65
 
}  // namespace net_instaweb
66
 
 
67
 
#endif  // NET_INSTAWEB_REWRITER_PUBLIC_URL_INPUT_RESOURCE_H_