| 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 "content/browser/devtools/devtools_io_context.h" | 5 #include "content/browser/devtools/devtools_io_context.h" | 
| 6 | 6 | 
| 7 #include "base/base64.h" | 7 #include "base/base64.h" | 
| 8 #include "base/containers/queue.h" | 8 #include "base/containers/queue.h" | 
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" | 
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 36 | 36 | 
| 37 base::SequencedTaskRunner* impl_task_runner() { | 37 base::SequencedTaskRunner* impl_task_runner() { | 
| 38   constexpr base::TaskTraits kBlockingTraits = {base::MayBlock(), | 38   constexpr base::TaskTraits kBlockingTraits = {base::MayBlock(), | 
| 39                                                 base::TaskPriority::BACKGROUND}; | 39                                                 base::TaskPriority::BACKGROUND}; | 
| 40   static base::LazySequencedTaskRunner s_sequenced_task_unner = | 40   static base::LazySequencedTaskRunner s_sequenced_task_unner = | 
| 41       LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER(kBlockingTraits); | 41       LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER(kBlockingTraits); | 
| 42   return s_sequenced_task_unner.Get().get(); | 42   return s_sequenced_task_unner.Get().get(); | 
| 43 } | 43 } | 
| 44 | 44 | 
| 45 using storage::BlobReader; | 45 using storage::BlobReader; | 
| 46 |  | 
| 47 unsigned s_last_stream_handle = 0; | 46 unsigned s_last_stream_handle = 0; | 
| 48 | 47 | 
| 49 class TempFileStream : public DevToolsIOContext::RWStream { | 48 class TempFileStream : public DevToolsIOContext::RWStream { | 
| 50  public: | 49  public: | 
| 51   TempFileStream(); | 50   TempFileStream(); | 
| 52 | 51 | 
| 53   void Read(off_t position, size_t max_size, ReadCallback callback) override; | 52   void Read(off_t position, size_t max_size, ReadCallback callback) override; | 
| 54   void Close(bool invoke_pending_callbacks) override {} | 53   void Close(bool invoke_pending_callbacks) override {} | 
| 55   void Append(std::unique_ptr<std::string> data) override; | 54   void Append(std::unique_ptr<std::string> data) override; | 
| 56   const std::string& handle() override { return handle_; } | 55   const std::string& handle() override { return handle_; } | 
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 523   return true; | 522   return true; | 
| 524 } | 523 } | 
| 525 | 524 | 
| 526 void DevToolsIOContext::DiscardAllStreams() { | 525 void DevToolsIOContext::DiscardAllStreams() { | 
| 527   for (auto& entry : streams_) | 526   for (auto& entry : streams_) | 
| 528     entry.second->Close(true); | 527     entry.second->Close(true); | 
| 529   return streams_.clear(); | 528   return streams_.clear(); | 
| 530 } | 529 } | 
| 531 | 530 | 
| 532 }  // namespace content | 531 }  // namespace content | 
| OLD | NEW | 
|---|