summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_request_info.h
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 05:46:24 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 05:46:24 +0000
commit1d89a82f68b6981928c0d32cf8ec37e3b07b5b9e (patch)
tree944c1af45521b01498fae7f92a3657277e152ca6 /chrome/browser/ssl/ssl_request_info.h
parent8dfc98d0c2e7291a1a0d215bb34bd891680e46f5 (diff)
downloadchromium_src-1d89a82f68b6981928c0d32cf8ec37e3b07b5b9e.zip
chromium_src-1d89a82f68b6981928c0d32cf8ec37e3b07b5b9e.tar.gz
chromium_src-1d89a82f68b6981928c0d32cf8ec37e3b07b5b9e.tar.bz2
Refactor the inner classes from SSLManager to their own files to reduce the complexity of SSLManager. Heading towards unit testability of this code.
TBR=jcampan TEST=No functionality change. Review URL: http://codereview.chromium.org/113391 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_request_info.h')
-rw-r--r--chrome/browser/ssl/ssl_request_info.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/chrome/browser/ssl/ssl_request_info.h b/chrome/browser/ssl/ssl_request_info.h
new file mode 100644
index 0000000..bd1544a
--- /dev/null
+++ b/chrome/browser/ssl/ssl_request_info.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2009 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 CHROME_BROWSER_SSL_SSL_REQUEST_INFO_H_
+#define CHROME_BROWSER_SSL_SSL_REQUEST_INFO_H_
+
+#include <string>
+
+#include "chrome/common/filter_policy.h"
+#include "googleurl/src/gurl.h"
+#include "webkit/glue/resource_type.h"
+
+class SSLManager;
+
+// SSLRequestInfo wraps up the information SSLPolicy needs about a request in
+// order to update our security IU. SSLRequestInfo is RefCounted in case we
+// need to deal with the request asynchronously.
+class SSLRequestInfo : public base::RefCounted<SSLRequestInfo> {
+ public:
+ SSLRequestInfo(SSLManager* manager,
+ const GURL& url,
+ ResourceType::Type resource_type,
+ const std::string& frame_origin,
+ const std::string& main_frame_origin,
+ FilterPolicy::Type filter_policy,
+ int pid,
+ int ssl_cert_id,
+ int ssl_cert_status)
+ : manager_(manager),
+ url_(url),
+ resource_type_(resource_type),
+ frame_origin_(frame_origin),
+ main_frame_origin_(main_frame_origin),
+ filter_policy_(filter_policy),
+ pid_(pid),
+ ssl_cert_id_(ssl_cert_id),
+ ssl_cert_status_(ssl_cert_status) {
+ }
+
+ SSLManager* manager() const { return manager_; }
+ const GURL& url() const { return url_; }
+ ResourceType::Type resource_type() const { return resource_type_; }
+ const std::string& frame_origin() const { return frame_origin_; }
+ const std::string& main_frame_origin() const { return main_frame_origin_; }
+ FilterPolicy::Type filter_policy() const { return filter_policy_; }
+ int pid() const { return pid_; }
+ int ssl_cert_id() const { return ssl_cert_id_; }
+ int ssl_cert_status() const { return ssl_cert_status_; }
+
+ private:
+ SSLManager* manager_;
+ GURL url_;
+ ResourceType::Type resource_type_;
+ std::string frame_origin_;
+ std::string main_frame_origin_;
+ FilterPolicy::Type filter_policy_;
+ int pid_;
+ int ssl_cert_id_;
+ int ssl_cert_status_;
+
+ DISALLOW_COPY_AND_ASSIGN(SSLRequestInfo);
+};
+
+#endif // CHROME_BROWSER_SSL_SSL_REQUEST_INFO_H_