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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc

Issue 657313003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/safe_browsing/phishing_classifier.h" 5 #include "chrome/renderer/safe_browsing/phishing_classifier.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 embedded_test_server()->base_url().ReplaceComponents(replace_host)); 186 embedded_test_server()->base_url().ReplaceComponents(replace_host));
187 } 187 }
188 188
189 scoped_ptr<net::test_server::HttpResponse> 189 scoped_ptr<net::test_server::HttpResponse>
190 HandleRequest(const net::test_server::HttpRequest& request) { 190 HandleRequest(const net::test_server::HttpRequest& request) {
191 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 191 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
192 new net::test_server::BasicHttpResponse()); 192 new net::test_server::BasicHttpResponse());
193 http_response->set_code(net::HTTP_OK); 193 http_response->set_code(net::HTTP_OK);
194 http_response->set_content_type("text/html"); 194 http_response->set_content_type("text/html");
195 http_response->set_content(response_content_); 195 http_response->set_content(response_content_);
196 return http_response.PassAs<net::test_server::HttpResponse>(); 196 return http_response.Pass();
197 } 197 }
198 198
199 std::string response_content_; 199 std::string response_content_;
200 scoped_ptr<Scorer> scorer_; 200 scoped_ptr<Scorer> scorer_;
201 scoped_ptr<PhishingClassifier> classifier_; 201 scoped_ptr<PhishingClassifier> classifier_;
202 MockFeatureExtractorClock* clock_; // Owned by classifier_. 202 MockFeatureExtractorClock* clock_; // Owned by classifier_.
203 content::RoutingIDManglingDisabler mangling_disabler_; 203 content::RoutingIDManglingDisabler mangling_disabler_;
204 204
205 // Features that are in the model. 205 // Features that are in the model.
206 const std::string url_tld_token_net_; 206 const std::string url_tld_token_net_;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Now set the scorer. 298 // Now set the scorer.
299 classifier_->set_phishing_scorer(scorer_.get()); 299 classifier_->set_phishing_scorer(scorer_.get());
300 EXPECT_TRUE(classifier_->is_ready()); 300 EXPECT_TRUE(classifier_->is_ready());
301 301
302 // Set a NULL scorer, which turns detection back off. 302 // Set a NULL scorer, which turns detection back off.
303 classifier_->set_phishing_scorer(NULL); 303 classifier_->set_phishing_scorer(NULL);
304 EXPECT_FALSE(classifier_->is_ready()); 304 EXPECT_FALSE(classifier_->is_ready());
305 } 305 }
306 306
307 } // namespace safe_browsing 307 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698