summaryrefslogtreecommitdiffstats
path: root/chrome/browser/devtools/devtools_network_transaction_factory.h
blob: 9faec2c9c6c55c0896542939e109b0cc8b2f7932 (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
// Copyright 2014 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_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_FACTORY_H_
#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_FACTORY_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/request_priority.h"
#include "net/http/http_transaction_factory.h"

class DevToolsNetworkController;

namespace net {
class HttpCache;
class HttpNetworkSession;
class HttpTransaction;
}

// NetworkTransactionFactory wraps HttpNetworkTransactions.
class DevToolsNetworkTransactionFactory : public net::HttpTransactionFactory {
 public:
  DevToolsNetworkTransactionFactory(
      DevToolsNetworkController* controller,
      net::HttpNetworkSession* session);
  virtual ~DevToolsNetworkTransactionFactory();

  // net::HttpTransactionFactory methods:
  virtual int CreateTransaction(
      net::RequestPriority priority,
      scoped_ptr<net::HttpTransaction>* trans) OVERRIDE;
  virtual net::HttpCache* GetCache() OVERRIDE;
  virtual net::HttpNetworkSession* GetSession() OVERRIDE;

 private:
  DevToolsNetworkController* controller_;
  scoped_ptr<net::HttpTransactionFactory> network_layer_;

  DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransactionFactory);
};

#endif  // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_TRANSACTION_FACTORY_H_