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

Side by Side Diff: chrome/browser/devtools/devtools_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: Addressed comments Created 6 years, 8 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_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13
14 class DevToolsNetworkTransaction;
15 class GURL;
16 class Profile;
17
18 namespace content {
19 class BrowserContext;
mmenke 2014/04/21 17:16:51 This doesn't seem to be used.
eustas 2014/04/22 14:23:09 Done.
20 class ResourceContext;
21 } // namespace content
mmenke 2014/04/21 17:16:51 optional nit: I don't believe the close namespace
eustas 2014/04/22 14:23:09 Done.
22
23 // DevToolsNetworkController tracks DevToolsNetworkTransactions.
24 class DevToolsNetworkController {
25
mmenke 2014/04/21 17:16:51 nit: There's generally no linebreak here
eustas 2014/04/22 14:23:09 Done.
26 public:
27 DevToolsNetworkController();
28 virtual ~DevToolsNetworkController();
29
30 void AddTransaction(DevToolsNetworkTransaction* transaction);
31
32 void RemoveTransaction(DevToolsNetworkTransaction* transaction);
33
34 // Disables / reenables network. |id| should be DevToolsAgentHost GUID.
mmenke 2014/04/21 17:16:51 nit: id -> client_id
eustas 2014/04/22 14:23:09 Done.
35 static void DisableNetwork(
36 Profile* profile,
37 const std::string& client_id,
38 bool disable_network);
39
40 static void DisableNetworkOnIO(
41 content::ResourceContext* resource_context,
42 const std::string& client_id,
43 bool disable_network);
44
45 void DisableNetwork(
46 const std::string& client_id,
47 bool disable_network);
48
49 bool ShouldFail(const DevToolsNetworkTransaction* transaction);
50
51 private:
52 typedef std::set<DevToolsNetworkTransaction*> Transactions;
53 Transactions transactions_;
54
55 typedef std::set<std::string> Clients;
56 Clients clients_;
57
58 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController);
59 };
60
61 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698