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: components/cronet/ios/cronet_environment.h

Issue 2465303002: [cronet] make startNetLogToFile write to correct file (Closed)
Patch Set: fix kapishnikov nits Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 5 #ifndef COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
6 #define COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 6 #define COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void Start(); 53 void Start();
54 54
55 // The full user-agent. 55 // The full user-agent.
56 std::string user_agent(); 56 std::string user_agent();
57 57
58 // Get global UMA histogram deltas. 58 // Get global UMA histogram deltas.
59 std::vector<uint8_t> GetHistogramDeltas(); 59 std::vector<uint8_t> GetHistogramDeltas();
60 60
61 // Creates a new net log (overwrites existing file with this name). If 61 // Creates a new net log (overwrites existing file with this name). If
62 // actively logging, this call is ignored. 62 // actively logging, this call is ignored.
63 void StartNetLog(base::FilePath::StringType file_name, bool log_bytes); 63 bool StartNetLog(base::FilePath::StringType file_name, bool log_bytes);
64 // Stops logging and flushes file. If not currently logging this call is 64 // Stops logging and flushes file. If not currently logging this call is
65 // ignored. 65 // ignored.
66 void StopNetLog(); 66 void StopNetLog();
67 67
68 void AddQuicHint(const std::string& host, int port, int alternate_port); 68 void AddQuicHint(const std::string& host, int port, int alternate_port);
69 69
70 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and 70 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and
71 // |forced_quic_origin_|. These only have any effect before Start() is 71 // |forced_quic_origin_|. These only have any effect before Start() is
72 // called. 72 // called.
73 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; } 73 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; }
(...skipping 30 matching lines...) Expand all
104 104
105 private: 105 private:
106 // Performs initialization tasks that must happen on the network thread. 106 // Performs initialization tasks that must happen on the network thread.
107 void InitializeOnNetworkThread(); 107 void InitializeOnNetworkThread();
108 108
109 // Runs a closure on the file user blocking thread. 109 // Runs a closure on the file user blocking thread.
110 void PostToFileUserBlockingThread(const tracked_objects::Location& from_here, 110 void PostToFileUserBlockingThread(const tracked_objects::Location& from_here,
111 const base::Closure& task); 111 const base::Closure& task);
112 112
113 // Helper methods that start/stop net logging on the network thread. 113 // Helper methods that start/stop net logging on the network thread.
114 void StartNetLogOnNetworkThread(const base::FilePath::StringType& file_name, 114 void StartNetLogOnNetworkThread(base::ScopedFILE file, bool log_bytes);
mef 2016/11/17 15:58:48 Add #include "base/files/scoped_file.h".
lilyhoughton 2016/11/22 20:48:42 Done.
115 bool log_bytes);
116 void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event); 115 void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event);
117 116
118 // Returns the HttpNetworkSession object from the passed in 117 // Returns the HttpNetworkSession object from the passed in
119 // URLRequestContext or NULL if none exists. 118 // URLRequestContext or NULL if none exists.
120 net::HttpNetworkSession* GetHttpNetworkSession( 119 net::HttpNetworkSession* GetHttpNetworkSession(
121 net::URLRequestContext* context); 120 net::URLRequestContext* context);
122 121
123 bool http2_enabled_; 122 bool http2_enabled_;
124 bool quic_enabled_; 123 bool quic_enabled_;
125 std::string accept_language_; 124 std::string accept_language_;
(...skipping 17 matching lines...) Expand all
143 bool user_agent_partial_; 142 bool user_agent_partial_;
144 std::unique_ptr<net::NetLog> net_log_; 143 std::unique_ptr<net::NetLog> net_log_;
145 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; 144 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_;
146 145
147 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); 146 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment);
148 }; 147 };
149 148
150 } // namespace cronet 149 } // namespace cronet
151 150
152 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 151 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698