Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: components/safe_json_parser/safe_json_parser.cc

Issue 1100003006: Certificate Transparency: Fetching of Signed Tree Heads (DRAFT) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revised design, addressed some comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698