Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ios/web/public/test/test_web_thread_bundle.h" | |
| 6 | |
| 7 #include "content/public/test/test_browser_thread_bundle.h" | |
| 8 | |
| 9 namespace web { | |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 int TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions(int options) { | |
| 14 int result = 0; | |
| 15 if (options & TestWebThreadBundle::IO_MAINLOOP) | |
| 16 result |= content::TestBrowserThreadBundle::IO_MAINLOOP; | |
| 17 if (options & TestWebThreadBundle::REAL_DB_THREAD) | |
| 18 result |= content::TestBrowserThreadBundle::REAL_DB_THREAD; | |
| 19 if (options & TestWebThreadBundle::REAL_FILE_THREAD) | |
| 20 result |= content::TestBrowserThreadBundle::REAL_FILE_THREAD; | |
| 21 if (options & TestWebThreadBundle::REAL_FILE_USER_BLOCKING_THREAD) | |
| 22 result |= content::TestBrowserThreadBundle::REAL_FILE_USER_BLOCKING_THREAD; | |
| 23 if (options & TestWebThreadBundle::REAL_CACHE_THREAD) | |
| 24 result |= content::TestBrowserThreadBundle::REAL_CACHE_THREAD; | |
| 25 if (options & TestWebThreadBundle::REAL_IO_THREAD) | |
| 26 result |= content::TestBrowserThreadBundle::REAL_IO_THREAD; | |
| 27 return result; | |
| 28 } | |
| 29 | |
| 30 } // namespace | |
| 31 | |
| 32 class TestWebThreadBundleImpl { | |
| 33 public: | |
| 34 explicit TestWebThreadBundleImpl(int options) | |
| 35 : test_browser_thread_bundle_( | |
| 36 TestBrowserThreadBundleOptionsFromTestWebThreadBundleOptions( | |
| 37 options)) {} | |
| 38 | |
| 39 private: | |
| 40 content::TestBrowserThreadBundle test_browser_thread_bundle_; | |
| 41 }; | |
|
jochen (gone - plz use gerrit)
2014/12/22 14:34:05
nit. DISALLOW_COPY_AND_ASSIGN()
sdefresne
2014/12/22 14:50:31
Done.
| |
| 42 | |
| 43 TestWebThreadBundle::TestWebThreadBundle() | |
| 44 : impl_(new TestWebThreadBundleImpl(DEFAULT)) { | |
| 45 } | |
| 46 | |
| 47 TestWebThreadBundle::TestWebThreadBundle(int options) | |
| 48 : impl_(new TestWebThreadBundleImpl(options)) { | |
| 49 } | |
| 50 | |
| 51 TestWebThreadBundle::~TestWebThreadBundle() { | |
| 52 } | |
| 53 | |
| 54 } // namespace web | |
| OLD | NEW |