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/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/third_party/icu/icu_utf.h" | 11 #include "base/third_party/icu/icu_utf.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 namespace devtools { | |
16 | 15 |
17 namespace { | 16 namespace { |
18 unsigned s_last_stream_handle = 0; | 17 unsigned s_last_stream_handle = 0; |
19 } | 18 } |
20 | 19 |
21 using Stream = DevToolsIOContext::Stream; | 20 using Stream = DevToolsIOContext::Stream; |
22 | 21 |
23 Stream::Stream() | 22 Stream::Stream() |
24 : base::RefCountedDeleteOnMessageLoop<Stream>( | 23 : base::RefCountedDeleteOnMessageLoop<Stream>( |
25 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), | 24 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 132 } |
134 | 133 |
135 bool DevToolsIOContext::Close(const std::string& handle) { | 134 bool DevToolsIOContext::Close(const std::string& handle) { |
136 return streams_.erase(handle) == 1; | 135 return streams_.erase(handle) == 1; |
137 } | 136 } |
138 | 137 |
139 void DevToolsIOContext::DiscardAllStreams() { | 138 void DevToolsIOContext::DiscardAllStreams() { |
140 return streams_.clear(); | 139 return streams_.clear(); |
141 } | 140 } |
142 | 141 |
143 } // namespace devtools | |
144 } // namespace content | 142 } // namespace content |
OLD | NEW |