Have pretty_print.py find histograms.xml.
[chromium-blink-merge.git] / net / socket_stream / socket_stream_job_manager.h
blobaa0cd4093446f5811c1ba3c6270bf8b74d580403
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_JOB_MANAGER_H_
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_JOB_MANAGER_H_
8 #include <map>
9 #include <string>
11 #include "net/socket_stream/socket_stream.h"
12 #include "net/socket_stream/socket_stream_job.h"
14 template <typename T> struct DefaultSingletonTraits;
15 class GURL;
17 namespace net {
19 class SocketStreamJobManager {
20 public:
21 // Returns the singleton instance.
22 static SocketStreamJobManager* GetInstance();
24 SocketStreamJob* CreateJob(
25 const GURL& url, SocketStream::Delegate* delegate) const;
27 SocketStreamJob::ProtocolFactory* RegisterProtocolFactory(
28 const std::string& scheme, SocketStreamJob::ProtocolFactory* factory);
30 private:
31 friend struct DefaultSingletonTraits<SocketStreamJobManager>;
32 typedef std::map<std::string, SocketStreamJob::ProtocolFactory*> FactoryMap;
34 SocketStreamJobManager();
35 ~SocketStreamJobManager();
37 mutable base::Lock lock_;
38 FactoryMap factories_;
40 DISALLOW_COPY_AND_ASSIGN(SocketStreamJobManager);
43 } // namespace net
45 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_JOB_MANAGER_H_