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

Unified Diff: net/base/capturing_net_log_observer.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « net/base/capturing_net_log_observer.h ('k') | net/base/chunked_upload_data_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/capturing_net_log_observer.cc
diff --git a/net/base/capturing_net_log_observer.cc b/net/base/capturing_net_log_observer.cc
deleted file mode 100644
index da99852043088a3d337f22f34024f737e6f560c6..0000000000000000000000000000000000000000
--- a/net/base/capturing_net_log_observer.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/base/capturing_net_log_observer.h"
-
-#include "base/values.h"
-
-namespace net {
-
-CapturingNetLogObserver::CapturingNetLogObserver() {}
-
-CapturingNetLogObserver::~CapturingNetLogObserver() {}
-
-void CapturingNetLogObserver::GetEntries(
- CapturedNetLogEntry::List* entry_list) const {
- base::AutoLock lock(lock_);
- *entry_list = captured_entries_;
-}
-
-void CapturingNetLogObserver::GetEntriesForSource(
- NetLog::Source source,
- CapturedNetLogEntry::List* entry_list) const {
- base::AutoLock lock(lock_);
- entry_list->clear();
- for (CapturedNetLogEntry::List::const_iterator entry =
- captured_entries_.begin();
- entry != captured_entries_.end(); ++entry) {
- if (entry->source.id == source.id)
- entry_list->push_back(*entry);
- }
-}
-
-size_t CapturingNetLogObserver::GetSize() const {
- base::AutoLock lock(lock_);
- return captured_entries_.size();
-}
-
-void CapturingNetLogObserver::Clear() {
- base::AutoLock lock(lock_);
- captured_entries_.clear();
-}
-
-void CapturingNetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
- // Using Dictionaries instead of Values makes checking values a little
- // simpler.
- base::DictionaryValue* param_dict = nullptr;
- base::Value* param_value = entry.ParametersToValue();
- if (param_value && !param_value->GetAsDictionary(&param_dict))
- delete param_value;
-
- // Only need to acquire the lock when accessing class variables.
- base::AutoLock lock(lock_);
- captured_entries_.push_back(
- CapturedNetLogEntry(entry.type(),
- base::TimeTicks::Now(),
- entry.source(),
- entry.phase(),
- scoped_ptr<base::DictionaryValue>(param_dict)));
-}
-
-} // namespace net
« no previous file with comments | « net/base/capturing_net_log_observer.h ('k') | net/base/chunked_upload_data_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698