| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "net/ssl/ssl_key_logger.h" | 5 #include "net/ssl/ssl_key_logger.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" |
| 14 #include "base/sequence_checker.h" | 15 #include "base/sequence_checker.h" |
| 15 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 | 19 |
| 19 // An object which lives on the background SequencedTaskRunner and performs the | 20 // An object which lives on the background SequencedTaskRunner and performs the |
| 20 // blocking file operations. | 21 // blocking file operations. |
| 21 class SSLKeyLogger::Core { | 22 class SSLKeyLogger::Core { |
| 22 public: | 23 public: |
| 23 Core() { sequence_checker_.DetachFromSequence(); } | 24 Core() { sequence_checker_.DetachFromSequence(); } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 task_runner_->DeleteSoon(FROM_HERE, core_.release()); | 60 task_runner_->DeleteSoon(FROM_HERE, core_.release()); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void SSLKeyLogger::WriteLine(const std::string& line) { | 63 void SSLKeyLogger::WriteLine(const std::string& line) { |
| 63 task_runner_->PostTask( | 64 task_runner_->PostTask( |
| 64 FROM_HERE, | 65 FROM_HERE, |
| 65 base::Bind(&Core::WriteLine, base::Unretained(core_.get()), line)); | 66 base::Bind(&Core::WriteLine, base::Unretained(core_.get()), line)); |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace net | 69 } // namespace net |
| OLD | NEW |