Chromium Code Reviews| Index: components/safe_json_parser/safe_json_parser.cc |
| diff --git a/components/safe_json_parser/safe_json_parser.cc b/components/safe_json_parser/safe_json_parser.cc |
| index 3f6444ff128dccc9df8ad3da3431a2e2e8489313..0a724a654f9c7380d6227d15548660924ff310dc 100644 |
| --- a/components/safe_json_parser/safe_json_parser.cc |
| +++ b/components/safe_json_parser/safe_json_parser.cc |
| @@ -31,10 +31,14 @@ SafeJsonParser::SafeJsonParser(const std::string& unsafe_json, |
| } |
| void SafeJsonParser::Start() { |
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - BrowserThread::PostTask( |
| - BrowserThread::IO, FROM_HERE, |
| - base::Bind(&SafeJsonParser::StartWorkOnIOThread, this)); |
| + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + BrowserThread::PostTask( |
| + BrowserThread::IO, FROM_HERE, |
| + base::Bind(&SafeJsonParser::StartWorkOnIOThread, this)); |
| + } else { |
| + StartWorkOnIOThread(); |
| + } |
|
Ryan Sleevi
2015/06/29 11:58:13
As discussed - follow up on the other CL
|
| } |
| SafeJsonParser::~SafeJsonParser() { |