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

Unified Diff: chrome/browser/net/load_timing_observer.h

Issue 4118004: Update NetLog to be thread safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Requires threadsafe observers Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/load_timing_observer.h
===================================================================
--- chrome/browser/net/load_timing_observer.h (revision 65207)
+++ chrome/browser/net/load_timing_observer.h (working copy)
@@ -43,8 +43,6 @@
LoadTimingObserver();
~LoadTimingObserver();
- URLRequestRecord* GetURLRequestRecord(uint32 source_id);
-
// Observer implementation:
virtual void OnAddEntry(net::NetLog::EventType type,
const base::TimeTicks& time,
@@ -61,6 +59,8 @@
FRIEND_TEST_ALL_PREFIXES(LoadTimingObserverTest,
SocketRecord);
+ // Note that |lock_| must be acquired before calling all of the following
+ // functions.
void OnAddURLRequestEntry(net::NetLog::EventType type,
const base::TimeTicks& time,
const net::NetLog::Source& source,
@@ -79,9 +79,12 @@
net::NetLog::EventPhase phase,
net::NetLog::EventParameters* params);
- URLRequestRecord* CreateURLRequestRecord(uint32 source_id);
- void DeleteURLRequestRecord(uint32 source_id);
+ // |lock_| must be aquired for as long as the returned |URLRequestRecord*|
+ // is in use.
+ URLRequestRecord* GetURLRequestRecord(uint32 source_id);
+ Lock lock_;
+
typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap;
typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap;
typedef base::hash_map<uint32, SocketRecord> SocketToRecordMap;

Powered by Google App Engine
This is Rietveld 408576698