| 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 <stddef.h> | 5 #include <stddef.h> | 
| 6 | 6 | 
| 7 #include <map> | 7 #include <map> | 
| 8 | 8 | 
| 9 #include "base/callback.h" | 9 #include "base/callback.h" | 
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" | 
| 11 #include "base/memory/ref_counted_delete_on_message_loop.h" | 11 #include "base/memory/ref_counted_delete_on_message_loop.h" | 
| 12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" | 
| 13 | 13 | 
| 14 namespace content { | 14 namespace content { | 
| 15 namespace devtools { |  | 
| 16 | 15 | 
| 17 class DevToolsIOContext { | 16 class DevToolsIOContext { | 
| 18  public: | 17  public: | 
| 19   class Stream : public base::RefCountedDeleteOnMessageLoop<Stream> { | 18   class Stream : public base::RefCountedDeleteOnMessageLoop<Stream> { | 
| 20    public: | 19    public: | 
| 21     enum Status { | 20     enum Status { | 
| 22       StatusSuccess, | 21       StatusSuccess, | 
| 23       StatusEOF, | 22       StatusEOF, | 
| 24       StatusFailure | 23       StatusFailure | 
| 25     }; | 24     }; | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
| 54   scoped_refptr<Stream> CreateTempFileBackedStream(); | 53   scoped_refptr<Stream> CreateTempFileBackedStream(); | 
| 55   scoped_refptr<Stream> GetByHandle(const std::string& handle); | 54   scoped_refptr<Stream> GetByHandle(const std::string& handle); | 
| 56   bool Close(const std::string& handle); | 55   bool Close(const std::string& handle); | 
| 57   void DiscardAllStreams(); | 56   void DiscardAllStreams(); | 
| 58 | 57 | 
| 59  private: | 58  private: | 
| 60   using StreamsMap = std::map<std::string, scoped_refptr<Stream>>; | 59   using StreamsMap = std::map<std::string, scoped_refptr<Stream>>; | 
| 61   StreamsMap streams_; | 60   StreamsMap streams_; | 
| 62 }; | 61 }; | 
| 63 | 62 | 
| 64 }  // namespace devtools |  | 
| 65 }  // namespace content | 63 }  // namespace content | 
| OLD | NEW | 
|---|