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

Side by Side Diff: chrome/browser/devtools/devtools_network_controller.h

Issue 1429113003: [DevTools] Narrow down DevToolsNetworkTransaction surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix Created 5 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_network_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_ 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 15
16 class DevToolsNetworkConditions; 16 class DevToolsNetworkConditions;
17 class DevToolsNetworkInterceptor; 17 class DevToolsNetworkInterceptor;
18 class DevToolsNetworkTransaction;
19 18
20 // DevToolsNetworkController tracks DevToolsNetworkTransactions. 19 // DevToolsNetworkController manages interceptors identified by client id
20 // and their throttling conditions.
21 class DevToolsNetworkController { 21 class DevToolsNetworkController {
22 public: 22 public:
23 DevToolsNetworkController(); 23 DevToolsNetworkController();
24 virtual ~DevToolsNetworkController(); 24 virtual ~DevToolsNetworkController();
25 25
26 // Applies network emulation configuration. 26 // Applies network emulation configuration.
27 void SetNetworkState( 27 void SetNetworkState(
28 const std::string& client_id, 28 const std::string& client_id,
29 scoped_ptr<DevToolsNetworkConditions> conditions); 29 scoped_ptr<DevToolsNetworkConditions> conditions);
30 30
31 base::WeakPtr<DevToolsNetworkInterceptor> GetInterceptor( 31 base::WeakPtr<DevToolsNetworkInterceptor> GetInterceptor(
32 DevToolsNetworkTransaction* transaction); 32 const std::string& client_id);
33 33
34 private: 34 private:
35 using InterceptorMap = 35 using InterceptorMap =
36 base::ScopedPtrHashMap<std::string, 36 base::ScopedPtrHashMap<std::string,
37 scoped_ptr<DevToolsNetworkInterceptor>>; 37 scoped_ptr<DevToolsNetworkInterceptor>>;
38 38
39 scoped_ptr<DevToolsNetworkInterceptor> default_interceptor_; 39 scoped_ptr<DevToolsNetworkInterceptor> default_interceptor_;
40 scoped_ptr<DevToolsNetworkInterceptor> appcache_interceptor_; 40 scoped_ptr<DevToolsNetworkInterceptor> appcache_interceptor_;
41 InterceptorMap interceptors_; 41 InterceptorMap interceptors_;
42 base::ThreadChecker thread_checker_; 42 base::ThreadChecker thread_checker_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController); 44 DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkController);
45 }; 45 };
46 46
47 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_ 47 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_NETWORK_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_network_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698