OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/log_private/log_private_api.h" | 5 #include "chrome/browser/extensions/api/log_private/log_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 return file->reset(file_ptr); | 280 return file->reset(file_ptr); |
281 } | 281 } |
282 | 282 |
283 void LogPrivateAPI::StartObservingNetEvents( | 283 void LogPrivateAPI::StartObservingNetEvents( |
284 IOThread* io_thread, | 284 IOThread* io_thread, |
285 base::ScopedFILE* file) { | 285 base::ScopedFILE* file) { |
286 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 286 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
287 if (!file->get()) | 287 if (!file->get()) |
288 return; | 288 return; |
289 | 289 |
290 net_log_logger_.reset(new net::NetLogLogger()); | 290 net_log_logger_.reset(new net::WriteToFileNetLogObserver()); |
291 net_log_logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES); | 291 net_log_logger_->set_log_level(net::NetLog::LOG_ALL_BUT_BYTES); |
292 net_log_logger_->StartObserving(io_thread->net_log(), file->Pass(), nullptr, | 292 net_log_logger_->StartObserving(io_thread->net_log(), file->Pass(), nullptr, |
293 nullptr); | 293 nullptr); |
294 } | 294 } |
295 | 295 |
296 void LogPrivateAPI::MaybeStartNetInternalLogging( | 296 void LogPrivateAPI::MaybeStartNetInternalLogging( |
297 const std::string& caller_extension_id, | 297 const std::string& caller_extension_id, |
298 IOThread* io_thread, | 298 IOThread* io_thread, |
299 api::log_private::EventSink event_sink) { | 299 api::log_private::EventSink event_sink) { |
300 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 300 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 entry->SetBoolean("isDirectory", false); | 539 entry->SetBoolean("isDirectory", false); |
540 base::ListValue* entry_list = new base::ListValue(); | 540 base::ListValue* entry_list = new base::ListValue(); |
541 entry_list->Append(entry); | 541 entry_list->Append(entry); |
542 response->Set("entries", entry_list); | 542 response->Set("entries", entry_list); |
543 response->SetBoolean("multiple", false); | 543 response->SetBoolean("multiple", false); |
544 SetResult(response.release()); | 544 SetResult(response.release()); |
545 SendResponse(succeeded); | 545 SendResponse(succeeded); |
546 } | 546 } |
547 | 547 |
548 } // namespace extensions | 548 } // namespace extensions |
OLD | NEW |