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

Unified Diff: components/cronet/android/cronet_url_request_context_adapter.h

Issue 2035313008: [Cronet] Make StartNetLog and StopNetLog synchronous in Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f76b097bb94face9a9bfe6cbbaf82b6444943d05..19be851659a788b3e1c05883ba25d2ad88865dff 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.h
+++ b/components/cronet/android/cronet_url_request_context_adapter.h
@@ -76,11 +76,14 @@ class CronetURLRequestContextAdapter
net::URLRequestContext* GetURLRequestContext();
+ // Starts NetLog logging to file. This can be called on any thread.
void StartNetLogToFile(JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller,
const base::android::JavaParamRef<jstring>& jfile_name,
jboolean jlog_all);
+ // Stops NetLog logging to file. This can be called on any thread. This will
+ // flush any remaining writes to disk.
void StopNetLog(JNIEnv* env,
const base::android::JavaParamRef<jobject>& jcaller);
@@ -124,11 +127,6 @@ class CronetURLRequestContextAdapter
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const;
- void StartNetLogToFileOnNetworkThread(const std::string& file_name,
- bool log_all);
-
- void StopNetLogOnNetworkThread();
-
// Gets the file thread. Create one if there is none.
base::Thread* GetFileThread();
@@ -160,9 +158,10 @@ class CronetURLRequestContextAdapter
// File thread should be destroyed last.
std::unique_ptr<base::Thread> file_thread_;
- // |write_to_file_observer_| and |context_| should only be accessed on
- // network thread.
+ // |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_;
// |pref_service_| should outlive the HttpServerPropertiesManager owned by
// |context_|.
« no previous file with comments | « no previous file | components/cronet/android/cronet_url_request_context_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698