Chromium Code Reviews| Index: content/browser/streams/stream_context.cc |
| diff --git a/content/browser/streams/stream_context.cc b/content/browser/streams/stream_context.cc |
| index ca77df1722ce3692f489f9474ebd5751bbe41e8a..e68d0bfc35ed5b659b3d9e7091155c917a3bb1aa 100644 |
| --- a/content/browser/streams/stream_context.cc |
| +++ b/content/browser/streams/stream_context.cc |
| @@ -41,4 +41,15 @@ void StreamContext::InitializeOnIOThread() { |
| StreamContext::~StreamContext() {} |
| +void StreamContext::DeleteOnCorrectThread() const { |
|
darin (slow to review)
2013/03/11 20:26:41
I'm really not a big fan of test-only code like th
|
| + // In many tests, there isn't a valid IO thread. In that case, just delete on |
| + // the current thread. |
| + if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && |
| + !BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| + BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| + return; |
| + } |
| + delete this; |
| +} |
| + |
| } // namespace content |