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

Side by Side Diff: chrome/browser/android/rlz/rlz_ping_handler.cc

Issue 2890413003: Explicitly use bool instead of jboolean (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/android/rlz/rlz_ping_handler.h" 5 #include "chrome/browser/android/rlz/rlz_ping_handler.h"
6 6
7 #include "base/android/callback_android.h" 7 #include "base/android/callback_android.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 url_fetcher_->SetMaxRetriesOn5xx(kMaxRetries); 99 url_fetcher_->SetMaxRetriesOn5xx(kMaxRetries);
100 url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); 100 url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
101 url_fetcher_->SetAutomaticallyRetryOn5xx(true); 101 url_fetcher_->SetAutomaticallyRetryOn5xx(true);
102 url_fetcher_->SetRequestContext(request_context_.get()); 102 url_fetcher_->SetRequestContext(request_context_.get());
103 url_fetcher_->Start(); 103 url_fetcher_->Start();
104 } 104 }
105 105
106 void RlzPingHandler::OnURLFetchComplete(const net::URLFetcher* source) { 106 void RlzPingHandler::OnURLFetchComplete(const net::URLFetcher* source) {
107 DCHECK_EQ(source, url_fetcher_.get()); 107 DCHECK_EQ(source, url_fetcher_.get());
108 108
109 jboolean valid = false; 109 bool valid = false;
110 if (!source->GetStatus().is_success() || 110 if (!source->GetStatus().is_success() ||
111 source->GetResponseCode() != net::HTTP_OK) { 111 source->GetResponseCode() != net::HTTP_OK) {
112 LOG(WARNING) << base::StringPrintf("Rlz endpoint responded with code %d.", 112 LOG(WARNING) << base::StringPrintf("Rlz endpoint responded with code %d.",
113 source->GetResponseCode()); 113 source->GetResponseCode());
114 } else { 114 } else {
115 std::string response; 115 std::string response;
116 source->GetResponseAsString(&response); 116 source->GetResponseAsString(&response);
117 int response_length = -1; 117 int response_length = -1;
118 valid = rlz_lib::IsPingResponseValid(response.c_str(), &response_length); 118 valid = rlz_lib::IsPingResponseValid(response.c_str(), &response_length);
119 } 119 }
(...skipping 16 matching lines...) Expand all
136 handler->Ping(j_brand, j_language, j_events, j_id, j_callback); 136 handler->Ping(j_brand, j_language, j_events, j_id, j_callback);
137 } 137 }
138 138
139 // Register native methods 139 // Register native methods
140 bool RegisterRlzPingHandler(JNIEnv* env) { 140 bool RegisterRlzPingHandler(JNIEnv* env) {
141 return RegisterNativesImpl(env); 141 return RegisterNativesImpl(env);
142 } 142 }
143 143
144 } // namespace android 144 } // namespace android
145 } // namespace chrome 145 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698