summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webresponse_impl.h
blob: 83260e3f22448dbe0952b897d2f12057d2f6cd48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_GLUE_WEBRESPONSEIMPL_H__
#define WEBKIT_GLUE_WEBRESPONSEIMPL_H__

#include <string>

#include "googleurl/src/gurl.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webresponse.h"

#include "ResourceResponse.h"

class WebResponseImpl : public WebResponse {
 public:
   WebResponseImpl() { }
   explicit WebResponseImpl(const WebCore::ResourceResponse& response)
      : response_(response) { }
   
  virtual ~WebResponseImpl() { }

  // Get the URL.
  virtual GURL GetURL() const {
    return webkit_glue::KURLToGURL(response_.url());
  }

  // Get the http status code.
  virtual int GetHttpStatusCode() const { return response_.httpStatusCode(); }

  // Get the security info (state of the SSL connection).
  virtual std::string GetSecurityInfo() const {
    return webkit_glue::CStringToStdString(response_.getSecurityInfo());
  }

  void set_resource_response(const WebCore::ResourceResponse& response) {
    response_ = response;
  }

 private:
  WebCore::ResourceResponse response_;

  DISALLOW_EVIL_CONSTRUCTORS(WebResponseImpl);
};

#endif  // #ifndef WEBKIT_GLUE_WEBRESPONSEIMPL_H__