summaryrefslogtreecommitdiffstats
path: root/chrome/browser/devtools/devtools_network_transaction_factory.h
diff options
context:
space:
mode:
authoreustas@chromium.org <eustas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 16:03:08 +0000
committereustas@chromium.org <eustas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 16:03:08 +0000
commita4205207e8e6bba4ebe0946b9d0b34abe946065f (patch)
treed3eb03bd5a2b18d30be9a887bc0291e4a93ce455 /chrome/browser/devtools/devtools_network_transaction_factory.h
parentdbe9bfab6e9b264b1b339e8c1c422f0b5dfa2a6c (diff)
downloadchromium_src-a4205207e8e6bba4ebe0946b9d0b34abe946065f.zip
chromium_src-a4205207e8e6bba4ebe0946b9d0b34abe946065f.tar.gz
chromium_src-a4205207e8e6bba4ebe0946b9d0b34abe946065f.tar.bz2
Add the ability for DevTools to wrap network transactions.
The eventual goal is to allow it to simulate flaky network connections. Docs: https://docs.google.com/a/google.com/document/d/1SkuWqLYIUpMDI05n7vgx8zdkunyUsxGs9tvUPDOqEJY/edit https://docs.google.com/a/google.com/document/d/19O_UeUfCFZg5cEnH5jkkZ6_tqsfaLQLYUEIGyXw3oTo/edit BUG=245436 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273584 Review URL: https://codereview.chromium.org/182993003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/devtools/devtools_network_transaction_factory.h')
-rw-r--r--chrome/browser/devtools/devtools_network_transaction_factory.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/browser/devtools/devtools_network_transaction_factory.h b/chrome/browser/devtools/devtools_network_transaction_factory.h
new file mode 100644
index 0000000..9faec2c
--- /dev/null
+++ b/chrome/browser/devtools/devtools_network_transaction_factory.h
@@ -0,0 +1,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_