Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Side by Side Diff: content/browser/devtools/devtools_io_context.cc

Issue 2591963004: Transform RefCountedDeleteOnMessageLoop to RefCountedDeleteOnSequence. (Closed)
Patch Set: similarity Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 15
16 namespace { 16 namespace {
17 unsigned s_last_stream_handle = 0; 17 unsigned s_last_stream_handle = 0;
18 } 18 }
19 19
20 using Stream = DevToolsIOContext::Stream; 20 using Stream = DevToolsIOContext::Stream;
21 21
22 Stream::Stream() 22 Stream::Stream()
23 : base::RefCountedDeleteOnMessageLoop<Stream>( 23 : base::RefCountedDeleteOnSequence<Stream>(
24 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), 24 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)),
25 handle_(base::UintToString(++s_last_stream_handle)), 25 handle_(base::UintToString(++s_last_stream_handle)),
26 had_errors_(false), 26 had_errors_(false),
27 last_read_pos_(0) {} 27 last_read_pos_(0) {}
28 28
29 Stream::~Stream() { 29 Stream::~Stream() {
30 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 30 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
31 } 31 }
32 32
33 bool Stream::InitOnFileThreadIfNeeded() { 33 bool Stream::InitOnFileThreadIfNeeded() {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 bool DevToolsIOContext::Close(const std::string& handle) { 134 bool DevToolsIOContext::Close(const std::string& handle) {
135 return streams_.erase(handle) == 1; 135 return streams_.erase(handle) == 1;
136 } 136 }
137 137
138 void DevToolsIOContext::DiscardAllStreams() { 138 void DevToolsIOContext::DiscardAllStreams() {
139 return streams_.clear(); 139 return streams_.clear();
140 } 140 }
141 141
142 } // namespace content 142 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_io_context.h ('k') | content/browser/devtools/protocol/io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698