| Index: components/cronet/android/cronet_url_request_context_adapter.h
|
| diff --git a/components/cronet/android/cronet_url_request_context_adapter.h b/components/cronet/android/cronet_url_request_context_adapter.h
|
| index 664c8f39689fc10a974aafd5083c91cb26c7b420..400c64077cb2df7bdf127dc164bc07426e98370d 100644
|
| --- a/components/cronet/android/cronet_url_request_context_adapter.h
|
| +++ b/components/cronet/android/cronet_url_request_context_adapter.h
|
| @@ -36,6 +36,7 @@
|
| class ProxyConfigService;
|
| class SdchOwner;
|
| class URLRequestContext;
|
| +class WriteToFileNetLogObserver;
|
| class FileNetLogObserver;
|
| } // namespace net
|
|
|
| @@ -81,10 +82,8 @@
|
|
|
| net::URLRequestContext* GetURLRequestContext();
|
|
|
| - // TODO(xunjieli): Keep only one version of StartNetLog().
|
| -
|
| - // Starts NetLog logging to file. This can be called on any thread.
|
| - // Return false if |jfile_name| cannot be opened.
|
| + // Starts NetLog logging to file. This can be called on any thread. Returns
|
| + // false if it fails to open log file.
|
| bool StartNetLogToFile(JNIEnv* env,
|
| const base::android::JavaParamRef<jobject>& jcaller,
|
| const base::android::JavaParamRef<jstring>& jfile_name,
|
| @@ -200,18 +199,17 @@
|
| bool include_socket_bytes,
|
| int size);
|
|
|
| - // Same as StartNetLogToFile, but called only on the network thread.
|
| - void StartNetLogOnNetworkThread(const base::FilePath& file_path,
|
| - bool include_socket_bytes);
|
| -
|
| - // Stops NetLog logging on the network thread.
|
| - void StopNetLogOnNetworkThread();
|
| + // Stops NetLog logging to file by calling StopObserving() and destroying
|
| + // the |bounded_file_observer_|.
|
| + void StopBoundedFileNetLogOnNetworkThread();
|
|
|
| // Callback for StopObserving() that unblocks the Java ConditionVariable and
|
| // signals that it is safe to access the NetLog files.
|
| void StopNetLogCompleted();
|
|
|
| - std::unique_ptr<base::DictionaryValue> GetNetLogInfo() const;
|
| + // Helper method to stop NetLog logging to file. This can be called on any
|
| + // thread. This will flush any remaining writes to disk.
|
| + void StopNetLogHelper();
|
|
|
| // Network thread is owned by |this|, but is destroyed from java thread.
|
| base::Thread* network_thread_;
|
| @@ -219,7 +217,12 @@
|
| // File thread should be destroyed last.
|
| std::unique_ptr<base::Thread> file_thread_;
|
|
|
| - std::unique_ptr<net::FileNetLogObserver> net_log_file_observer_;
|
| + // |write_to_file_observer_| should only be accessed with
|
| + // |write_to_file_observer_lock_|.
|
| + std::unique_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_;
|
| + base::Lock write_to_file_observer_lock_;
|
| +
|
| + std::unique_ptr<net::FileNetLogObserver> bounded_file_observer_;
|
|
|
| // |pref_service_| should outlive the HttpServerPropertiesManager owned by
|
| // |context_|.
|
| @@ -237,9 +240,6 @@
|
| // Context config is only valid until context is initialized.
|
| std::unique_ptr<URLRequestContextConfig> context_config_;
|
|
|
| - // Effective experimental options. Kept for NetLog.
|
| - std::unique_ptr<base::DictionaryValue> effective_experimental_options_;
|
| -
|
| // A queue of tasks that need to be run after context has been initialized.
|
| std::queue<base::Closure> tasks_waiting_for_context_;
|
| bool is_context_initialized_;
|
|
|