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

Side by Side Diff: content/public/browser/browser_thread.h

Issue 2921343002: Improve documentation and tests for base::OnTaskRunnerDeleter. (Closed)
Patch Set: rm unused include Created 3 years, 6 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
« no previous file with comments | « base/sequenced_task_runner_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // 307 //
308 // ... 308 // ...
309 // private: 309 // private:
310 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; 310 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>;
311 // friend class base::DeleteHelper<Foo>; 311 // friend class base::DeleteHelper<Foo>;
312 // 312 //
313 // ~Foo(); 313 // ~Foo();
314 // 314 //
315 // Sample usage with scoped_ptr: 315 // Sample usage with scoped_ptr:
316 // std::unique_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr; 316 // std::unique_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr;
317 //
318 // Note: when migrating BrowserThreads to TaskScheduler based
319 // SequencedTaskRunners these map to base::OnTaskRunnerDeleter.
317 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; 320 struct DeleteOnUIThread : public DeleteOnThread<UI> { };
318 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; 321 struct DeleteOnIOThread : public DeleteOnThread<IO> { };
319 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; 322 struct DeleteOnFileThread : public DeleteOnThread<FILE> { };
320 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; 323 struct DeleteOnDBThread : public DeleteOnThread<DB> { };
321 324
322 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. 325 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails.
323 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); 326 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected);
324 327
325 private: 328 private:
326 friend class BrowserThreadImpl; 329 friend class BrowserThreadImpl;
327 330
328 BrowserThread() {} 331 BrowserThread() {}
329 DISALLOW_COPY_AND_ASSIGN(BrowserThread); 332 DISALLOW_COPY_AND_ASSIGN(BrowserThread);
330 }; 333 };
331 334
332 } // namespace content 335 } // namespace content
333 336
334 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 337 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
OLDNEW
« no previous file with comments | « base/sequenced_task_runner_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698