| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ |
| 6 #define NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ | 6 #define NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" |
| 9 |
| 8 namespace net { | 10 namespace net { |
| 9 | 11 |
| 10 class HttpCache; | 12 class HttpCache; |
| 11 class HttpTransaction; | 13 class HttpTransaction; |
| 12 | 14 |
| 13 // An interface to a class that can create HttpTransaction objects. | 15 // An interface to a class that can create HttpTransaction objects. |
| 14 class HttpTransactionFactory { | 16 class HttpTransactionFactory { |
| 15 public: | 17 public: |
| 16 virtual ~HttpTransactionFactory() {} | 18 virtual ~HttpTransactionFactory() {} |
| 17 | 19 |
| 18 // Creates a HttpTransaction object. | 20 // Creates a HttpTransaction object. On success, saves the new |
| 19 virtual HttpTransaction* CreateTransaction() = 0; | 21 // transaction to |*trans| and returns OK. |
| 22 virtual int CreateTransaction(scoped_ptr<HttpTransaction>* trans) = 0; |
| 20 | 23 |
| 21 // Returns the associated cache if any (may be NULL). | 24 // Returns the associated cache if any (may be NULL). |
| 22 virtual HttpCache* GetCache() = 0; | 25 virtual HttpCache* GetCache() = 0; |
| 23 | 26 |
| 24 // Suspends the creation of new transactions. If |suspend| is false, creation | 27 // Suspends the creation of new transactions. If |suspend| is false, creation |
| 25 // of new transactions is resumed. | 28 // of new transactions is resumed. |
| 26 virtual void Suspend(bool suspend) = 0; | 29 virtual void Suspend(bool suspend) = 0; |
| 27 }; | 30 }; |
| 28 | 31 |
| 29 } // namespace net | 32 } // namespace net |
| 30 | 33 |
| 31 #endif // NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ | 34 #endif // NET_HTTP_HTTP_TRANSACTION_FACTORY_H__ |
| OLD | NEW |