OLD | NEW |
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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Foo, BrowserThread::DeleteOnIOThread> { | 278 // Foo, BrowserThread::DeleteOnIOThread> { |
279 // | 279 // |
280 // ... | 280 // ... |
281 // private: | 281 // private: |
282 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 282 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
283 // friend class base::DeleteHelper<Foo>; | 283 // friend class base::DeleteHelper<Foo>; |
284 // | 284 // |
285 // ~Foo(); | 285 // ~Foo(); |
286 // | 286 // |
287 // Sample usage with scoped_ptr: | 287 // Sample usage with scoped_ptr: |
288 // scoped_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr; | 288 // std::unique_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr; |
289 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; | 289 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; |
290 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; | 290 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; |
291 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; | 291 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; |
292 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; | 292 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; |
293 | 293 |
294 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. | 294 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. |
295 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); | 295 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); |
296 | 296 |
297 private: | 297 private: |
298 friend class BrowserThreadImpl; | 298 friend class BrowserThreadImpl; |
299 | 299 |
300 BrowserThread() {} | 300 BrowserThread() {} |
301 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 301 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
302 }; | 302 }; |
303 | 303 |
304 } // namespace content | 304 } // namespace content |
305 | 305 |
306 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 306 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |