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

Unified Diff: sync/internal_api/http_bridge.cc

Issue 195973002: Change DCHECK_IS_ON() to DCHECK_IS_ON (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep a comment Created 6 years, 9 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
« no previous file with comments | « net/spdy/spdy_write_queue.cc ('k') | ui/gfx/font_list_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/http_bridge.cc
diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc
index 12cfda889c330601cb1e261c6be2f0ae95c5ae51..59d04fa831d93a48217c72280cb2f1e6672cff23 100644
--- a/sync/internal_api/http_bridge.cc
+++ b/sync/internal_api/http_bridge.cc
@@ -198,13 +198,15 @@ void HttpBridge::SetExtraRequestHeaders(const char * headers) {
}
void HttpBridge::SetURL(const char* url, int port) {
+#if DCHECK_IS_ON
DCHECK_EQ(base::MessageLoop::current(), created_on_loop_);
- if (DCHECK_IS_ON()) {
+ {
base::AutoLock lock(fetch_state_lock_);
DCHECK(!fetch_state_.request_completed);
}
DCHECK(url_for_request_.is_empty())
<< "HttpBridge::SetURL called more than once?!";
+#endif
GURL temp(url);
GURL::Replacements replacements;
std::string port_str = base::IntToString(port);
@@ -216,13 +218,15 @@ void HttpBridge::SetURL(const char* url, int port) {
void HttpBridge::SetPostPayload(const char* content_type,
int content_length,
const char* content) {
+#if DCHECK_IS_ON
DCHECK_EQ(base::MessageLoop::current(), created_on_loop_);
- if (DCHECK_IS_ON()) {
+ {
base::AutoLock lock(fetch_state_lock_);
DCHECK(!fetch_state_.request_completed);
}
DCHECK(content_type_.empty()) << "Bridge payload already set.";
DCHECK_GE(content_length, 0) << "Content length < 0";
+#endif
content_type_ = content_type;
if (!content || (content_length == 0)) {
DCHECK_EQ(content_length, 0);
@@ -235,13 +239,15 @@ void HttpBridge::SetPostPayload(const char* content_type,
}
bool HttpBridge::MakeSynchronousPost(int* error_code, int* response_code) {
+#if DCHECK_IS_ON
DCHECK_EQ(base::MessageLoop::current(), created_on_loop_);
- if (DCHECK_IS_ON()) {
+ {
base::AutoLock lock(fetch_state_lock_);
DCHECK(!fetch_state_.request_completed);
}
DCHECK(url_for_request_.is_valid()) << "Invalid URL for request";
DCHECK(!content_type_.empty()) << "Payload not set";
+#endif
if (!network_task_runner_->PostTask(
FROM_HERE,
« no previous file with comments | « net/spdy/spdy_write_queue.cc ('k') | ui/gfx/font_list_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698