Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: chrome/browser/net/network_controller.h

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split controller and factory Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef CHROME_BROWSER_NET_NETWORK_CONTROLLER_H_
6 #define CHROME_BROWSER_NET_NETWORK_CONTROLLER_H_
7
8 #include <string>
9
10 #include "base/containers/hash_tables.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13
14 class NetworkTransaction;
15 class GURL;
16 class Profile;
17
18 namespace content {
19 class BrowserContext;
20 class ResourceContext;
21 } // namespace content
22
23 // NetworkController tracks NetworkTransactions.
24 class NetworkController {
25
26 public:
27 NetworkController();
28 virtual ~NetworkController();
29
30 void AddTransaction(
31 uint64 transaction_id,
32 NetworkTransaction* transaction);
33
34 void RemoveTransaction(uint64 transaction_id);
35
36 static void DisableNetwork(
37 Profile* profile,
38 const std::string& client_id,
39 bool disable_network);
40
41 static void DisableNetworkOnIO(
42 content::ResourceContext* resourceContext,
43 const std::string& client_id,
44 bool disable_network);
45
46 void DisableNetwork(
47 const std::string& client_id,
48 bool disable_network);
49
50 bool IsBlockedURL(const GURL& url);
51
52 private:
53 typedef base::hash_map<uint64, NetworkTransaction*> Transactions;
54 Transactions transactions_;
55
56 typedef base::hash_set<std::string> ClientsSet;
57 ClientsSet clients_set_;
58
59 DISALLOW_COPY_AND_ASSIGN(NetworkController);
60 };
61
62 #endif // CHROME_BROWSER_NET_NETWORK_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698