Chromecast Android buildfix: rework CommandLine initialization logic.
[chromium-blink-merge.git] / net / tools / gdig / file_net_log.h
blob0f858bbea3f68a59f3213a965f2376841174e85e
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_TOOLS_GDIG_FILE_NET_LOG_H_
6 #define NET_TOOLS_GDIG_FILE_NET_LOG_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/synchronization/lock.h"
12 #include "base/time/time.h"
13 #include "net/base/net_log.h"
15 namespace net {
17 // FileNetLogObserver is a simple implementation of NetLog::ThreadSafeObserver
18 // that prints out all the events received into the stream passed
19 // to the constructor.
20 class FileNetLogObserver : public NetLog::ThreadSafeObserver {
21 public:
22 explicit FileNetLogObserver(FILE* destination);
23 virtual ~FileNetLogObserver();
25 // NetLog::ThreadSafeObserver implementation:
26 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
28 private:
29 FILE* const destination_;
30 base::Lock lock_;
32 base::Time first_event_time_;
35 } // namespace net
37 #endif // NET_TOOLS_GDIG_FILE_NET_LOG_H_