| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 shell()->web_contents()->GetBrowserContext())->GetQuotaManager()); | 118 shell()->web_contents()->GetBrowserContext())->GetQuotaManager()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { | 121 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { |
| 122 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 122 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 123 BrowserThread::PostTask( | 123 BrowserThread::PostTask( |
| 124 BrowserThread::IO, FROM_HERE, | 124 BrowserThread::IO, FROM_HERE, |
| 125 base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm)); | 125 base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm)); |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 128 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 129 qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback()); | 129 qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback()); |
| 130 // Don't return until the quota has been set. | 130 // Don't return until the quota has been set. |
| 131 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( | 131 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( |
| 132 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 132 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
| 133 ASSERT_TRUE(helper->Run()); | 133 ASSERT_TRUE(helper->Run()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 virtual int64 RequestDiskUsage() { | 136 virtual int64 RequestDiskUsage() { |
| 137 PostTaskAndReplyWithResult( | 137 PostTaskAndReplyWithResult( |
| 138 GetContext()->TaskRunner(), | 138 GetContext()->TaskRunner(), |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 command_line->AppendSwitch(switches::kSingleProcess); | 839 command_line->AppendSwitch(switches::kSingleProcess); |
| 840 } | 840 } |
| 841 }; | 841 }; |
| 842 | 842 |
| 843 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 843 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
| 844 RenderThreadShutdownTest) { | 844 RenderThreadShutdownTest) { |
| 845 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 845 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
| 846 } | 846 } |
| 847 | 847 |
| 848 } // namespace content | 848 } // namespace content |
| OLD | NEW |