| Index: net/ssl/default_channel_id_store.h
|
| diff --git a/net/ssl/default_server_bound_cert_store.h b/net/ssl/default_channel_id_store.h
|
| similarity index 72%
|
| rename from net/ssl/default_server_bound_cert_store.h
|
| rename to net/ssl/default_channel_id_store.h
|
| index 61282182f8e584b9207be06418ee3f8e2e3d70ae..9cf20d20d8e6429adf21aeee0e3cd68de52097c7 100644
|
| --- a/net/ssl/default_server_bound_cert_store.h
|
| +++ b/net/ssl/default_channel_id_store.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_
|
| -#define NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_
|
| +#ifndef NET_SSL_DEFAULT_CHANNEL_ID_STORE_H_
|
| +#define NET_SSL_DEFAULT_CHANNEL_ID_STORE_H_
|
|
|
| #include <map>
|
| #include <string>
|
| @@ -16,7 +16,7 @@
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "net/base/net_export.h"
|
| -#include "net/ssl/server_bound_cert_store.h"
|
| +#include "net/ssl/channel_id_store.h"
|
|
|
| namespace net {
|
|
|
| @@ -25,37 +25,37 @@ namespace net {
|
| // and synchronizes server bound certs to an optional permanent storage that
|
| // implements the PersistentStore interface. The use case is described in
|
| // http://balfanz.github.com/tls-obc-spec/draft-balfanz-tls-obc-00.html
|
| -class NET_EXPORT DefaultServerBoundCertStore : public ServerBoundCertStore {
|
| +class NET_EXPORT DefaultChannelIDStore : public ChannelIDStore {
|
| public:
|
| class PersistentStore;
|
|
|
| - // The key for each ServerBoundCert* in ServerBoundCertMap is the
|
| + // The key for each ChannelID* in ChannelIDMap is the
|
| // corresponding server.
|
| - typedef std::map<std::string, ServerBoundCert*> ServerBoundCertMap;
|
| + typedef std::map<std::string, ChannelID*> ChannelIDMap;
|
|
|
| // The store passed in should not have had Init() called on it yet. This
|
| // class will take care of initializing it. The backing store is NOT owned by
|
| // this class, but it must remain valid for the duration of the
|
| - // DefaultServerBoundCertStore's existence. If |store| is NULL, then no
|
| + // DefaultChannelIDStore's existence. If |store| is NULL, then no
|
| // backing store will be updated.
|
| - explicit DefaultServerBoundCertStore(PersistentStore* store);
|
| + explicit DefaultChannelIDStore(PersistentStore* store);
|
|
|
| - virtual ~DefaultServerBoundCertStore();
|
| + virtual ~DefaultChannelIDStore();
|
|
|
| - // ServerBoundCertStore implementation.
|
| - virtual int GetServerBoundCert(
|
| + // ChannelIDStore implementation.
|
| + virtual int GetChannelID(
|
| const std::string& server_identifier,
|
| base::Time* expiration_time,
|
| std::string* private_key_result,
|
| std::string* cert_result,
|
| const GetCertCallback& callback) OVERRIDE;
|
| - virtual void SetServerBoundCert(
|
| + virtual void SetChannelID(
|
| const std::string& server_identifier,
|
| base::Time creation_time,
|
| base::Time expiration_time,
|
| const std::string& private_key,
|
| const std::string& cert) OVERRIDE;
|
| - virtual void DeleteServerBoundCert(
|
| + virtual void DeleteChannelID(
|
| const std::string& server_identifier,
|
| const base::Closure& callback) OVERRIDE;
|
| virtual void DeleteAllCreatedBetween(
|
| @@ -63,18 +63,18 @@ class NET_EXPORT DefaultServerBoundCertStore : public ServerBoundCertStore {
|
| base::Time delete_end,
|
| const base::Closure& callback) OVERRIDE;
|
| virtual void DeleteAll(const base::Closure& callback) OVERRIDE;
|
| - virtual void GetAllServerBoundCerts(
|
| + virtual void GetAllChannelIDs(
|
| const GetCertListCallback& callback) OVERRIDE;
|
| virtual int GetCertCount() OVERRIDE;
|
| virtual void SetForceKeepSessionState() OVERRIDE;
|
|
|
| private:
|
| class Task;
|
| - class GetServerBoundCertTask;
|
| - class SetServerBoundCertTask;
|
| - class DeleteServerBoundCertTask;
|
| + class GetChannelIDTask;
|
| + class SetChannelIDTask;
|
| + class DeleteChannelIDTask;
|
| class DeleteAllCreatedBetweenTask;
|
| - class GetAllServerBoundCertsTask;
|
| + class GetAllChannelIDsTask;
|
|
|
| static const size_t kMaxCerts;
|
|
|
| @@ -102,20 +102,20 @@ class NET_EXPORT DefaultServerBoundCertStore : public ServerBoundCertStore {
|
| void InitStore();
|
|
|
| // Callback for backing store loading completion.
|
| - void OnLoaded(scoped_ptr<ScopedVector<ServerBoundCert> > certs);
|
| + void OnLoaded(scoped_ptr<ScopedVector<ChannelID> > certs);
|
|
|
| // Syncronous methods which do the actual work. Can only be called after
|
| // initialization is complete.
|
| - void SyncSetServerBoundCert(
|
| + void SyncSetChannelID(
|
| const std::string& server_identifier,
|
| base::Time creation_time,
|
| base::Time expiration_time,
|
| const std::string& private_key,
|
| const std::string& cert);
|
| - void SyncDeleteServerBoundCert(const std::string& server_identifier);
|
| + void SyncDeleteChannelID(const std::string& server_identifier);
|
| void SyncDeleteAllCreatedBetween(base::Time delete_begin,
|
| base::Time delete_end);
|
| - void SyncGetAllServerBoundCerts(ServerBoundCertList* cert_list);
|
| + void SyncGetAllChannelIDs(ChannelIDList* cert_list);
|
|
|
| // Add |task| to |waiting_tasks_|.
|
| void EnqueueTask(scoped_ptr<Task> task);
|
| @@ -125,13 +125,13 @@ class NET_EXPORT DefaultServerBoundCertStore : public ServerBoundCertStore {
|
|
|
| // Deletes the cert for the specified server, if such a cert exists, from the
|
| // in-memory store. Deletes it from |store_| if |store_| is not NULL.
|
| - void InternalDeleteServerBoundCert(const std::string& server);
|
| + void InternalDeleteChannelID(const std::string& server);
|
|
|
| // Takes ownership of *cert.
|
| // Adds the cert for the specified server to the in-memory store. Deletes it
|
| // from |store_| if |store_| is not NULL.
|
| - void InternalInsertServerBoundCert(const std::string& server_identifier,
|
| - ServerBoundCert* cert);
|
| + void InternalInsertChannelID(const std::string& server_identifier,
|
| + ChannelID* cert);
|
|
|
| // Indicates whether the cert store has been initialized. This happens
|
| // lazily in InitIfNecessary().
|
| @@ -147,20 +147,20 @@ class NET_EXPORT DefaultServerBoundCertStore : public ServerBoundCertStore {
|
|
|
| scoped_refptr<PersistentStore> store_;
|
|
|
| - ServerBoundCertMap server_bound_certs_;
|
| + ChannelIDMap channel_ids_;
|
|
|
| - base::WeakPtrFactory<DefaultServerBoundCertStore> weak_ptr_factory_;
|
| + base::WeakPtrFactory<DefaultChannelIDStore> weak_ptr_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(DefaultServerBoundCertStore);
|
| + DISALLOW_COPY_AND_ASSIGN(DefaultChannelIDStore);
|
| };
|
|
|
| -typedef base::RefCountedThreadSafe<DefaultServerBoundCertStore::PersistentStore>
|
| +typedef base::RefCountedThreadSafe<DefaultChannelIDStore::PersistentStore>
|
| RefcountedPersistentStore;
|
|
|
| -class NET_EXPORT DefaultServerBoundCertStore::PersistentStore
|
| +class NET_EXPORT DefaultChannelIDStore::PersistentStore
|
| : public RefcountedPersistentStore {
|
| public:
|
| - typedef base::Callback<void(scoped_ptr<ScopedVector<ServerBoundCert> >)>
|
| + typedef base::Callback<void(scoped_ptr<ScopedVector<ChannelID> >)>
|
| LoadedCallback;
|
|
|
| // Initializes the store and retrieves the existing certs. This will be
|
| @@ -169,9 +169,9 @@ class NET_EXPORT DefaultServerBoundCertStore::PersistentStore
|
| // The |loaded_callback| must not be called synchronously.
|
| virtual void Load(const LoadedCallback& loaded_callback) = 0;
|
|
|
| - virtual void AddServerBoundCert(const ServerBoundCert& cert) = 0;
|
| + virtual void AddChannelID(const ChannelID& cert) = 0;
|
|
|
| - virtual void DeleteServerBoundCert(const ServerBoundCert& cert) = 0;
|
| + virtual void DeleteChannelID(const ChannelID& cert) = 0;
|
|
|
| // When invoked, instructs the store to keep session related data on
|
| // destruction.
|
| @@ -189,4 +189,4 @@ class NET_EXPORT DefaultServerBoundCertStore::PersistentStore
|
|
|
| } // namespace net
|
|
|
| -#endif // NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_
|
| +#endif // NET_SSL_DEFAULT_CHANNEL_ID_STORE_H_
|
|
|