Index: chrome/browser/devtools/devtools_network_controller.h |
diff --git a/chrome/browser/devtools/devtools_network_controller.h b/chrome/browser/devtools/devtools_network_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..38b7f5652bbdf5dccbed394ff3a02b034d778e96 |
--- /dev/null |
+++ b/chrome/browser/devtools/devtools_network_controller.h |
@@ -0,0 +1,69 @@ |
+// Copyright (c) 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_CONTROLLER_H_ |
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_ |
+ |
+#include "base/containers/hash_tables.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
+#include "net/http/http_transaction_factory.h" |
+ |
+class DevToolsNetworkTransaction; |
+class GURL; |
+class Profile; |
+ |
+namespace net { |
+class HttpNetworkSession; |
+class HttpTransaction; |
+enum RequestPriority; |
+} // namespace net |
mmenke
2014/03/11 21:16:53
nit: Two spaces before comment.
eustas
2014/03/12 15:38:33
Done.
|
+ |
+namespace content { |
+class BrowserContext; |
+} // namespace content |
mmenke
2014/03/11 21:16:53
nit: Two spaces before comment.
eustas
2014/03/12 15:38:33
Done.
|
+ |
+// DevToolsNetworkController wraps and tracks HttpNetworkTrancactions. |
mmenke
2014/03/11 21:16:53
nit: HttpNetworkTrancactions -> HttpNetworkTransa
eustas
2014/03/12 15:38:33
Done.
|
+class DevToolsNetworkController |
+ : public net::HttpTransactionFactory { |
+ |
+ public: |
+ explicit DevToolsNetworkController(net::HttpNetworkSession* session); |
+ virtual ~DevToolsNetworkController(); |
+ |
+ static void SetBlockedDomains( |
+ Profile* profile, |
+ const std::string& id, |
+ const std::vector<std::string>& blocked_domains); |
mmenke
2014/03/11 21:16:53
I am a little concerned that this is working at th
eustas
2014/03/12 15:38:33
Service Worker and AppCache are the main reasons w
mmenke
2014/03/12 15:59:27
I had completely forgotten about remote debugging.
|
+ |
+ bool IsBlockedURL(const GURL& url); |
+ |
+ void RemoveTransaction(const std::string& id); |
+ void SetBlockedDomainsOnIO( |
+ const std::string& id, |
+ const std::vector<std::string>& blocked_domains); |
+ |
+ // 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: |
+ scoped_ptr<net::HttpTransactionFactory> network_layer_; |
+ |
+ typedef base::hash_map<std::string, DevToolsNetworkTransaction*> Transactions; |
+ Transactions transactions_; |
+ |
+ typedef std::vector<std::string> BlockedDomains; |
+ typedef base::hash_map<std::string, BlockedDomains*> BlockedDomainsMap; |
+ BlockedDomainsMap blocked_domains_map_; |
+ |
+ base::WeakPtrFactory<DevToolsNetworkController> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController); |
+}; |
+ |
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_ |