blob: 6bfc35ead920343b3bca005f6d0af1f44393bdf4 [file] [log] [blame]
// Copyright 2016 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "cobalt/network/cobalt_net_log.h"
#include <algorithm>
#include "base/logging.h"
#include "base/values.h"
namespace cobalt {
namespace network {
CobaltNetLog::CobaltNetLog(const base::FilePath& log_path,
net::NetLogCaptureMode capture_mode) {
net_log_logger_.reset(new NetLogLogger(log_path));
net_log_logger_->StartObserving(this, capture_mode);
}
CobaltNetLog::~CobaltNetLog() {
// Remove the observers we own before we're destroyed.
if (net_log_logger_.get()) RemoveObserver(net_log_logger_.get());
}
} // namespace network
} // namespace cobalt