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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 2821093002: Remove URLRequestJob::GetResponseCode implementations from chrome/ (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc ('k') | 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 (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 <utility> 5 #include <utility>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2932 int ReadRawData(net::IOBuffer* buf, int buf_size) override { 2932 int ReadRawData(net::IOBuffer* buf, int buf_size) override {
2933 int bytes_read = 2933 int bytes_read =
2934 std::min(static_cast<size_t>(buf_size), 2934 std::min(static_cast<size_t>(buf_size),
2935 strlen(network_time::kGoodTimeResponseBody) - data_offset_); 2935 strlen(network_time::kGoodTimeResponseBody) - data_offset_);
2936 memcpy(buf->data(), network_time::kGoodTimeResponseBody + data_offset_, 2936 memcpy(buf->data(), network_time::kGoodTimeResponseBody + data_offset_,
2937 bytes_read); 2937 bytes_read);
2938 data_offset_ += bytes_read; 2938 data_offset_ += bytes_read;
2939 return bytes_read; 2939 return bytes_read;
2940 } 2940 }
2941 2941
2942 int GetResponseCode() const override { return 200; }
2943
2944 void GetResponseInfo(net::HttpResponseInfo* info) override { 2942 void GetResponseInfo(net::HttpResponseInfo* info) override {
2945 std::string headers; 2943 std::string headers;
2946 headers.append( 2944 headers.append(
2947 "HTTP/1.1 200 OK\n" 2945 "HTTP/1.1 200 OK\n"
2948 "Content-type: text/plain\n"); 2946 "Content-type: text/plain\n");
2949 headers.append(base::StringPrintf( 2947 headers.append(base::StringPrintf(
2950 "Content-Length: %1d\n", 2948 "Content-Length: %1d\n",
2951 static_cast<int>(strlen(network_time::kGoodTimeResponseBody)))); 2949 static_cast<int>(strlen(network_time::kGoodTimeResponseBody))));
2952 info->headers = 2950 info->headers =
2953 new net::HttpResponseHeaders(net::HttpUtil::AssembleRawHeaders( 2951 new net::HttpResponseHeaders(net::HttpUtil::AssembleRawHeaders(
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
4449 4447
4450 // Visit a page over https that contains a frame with a redirect. 4448 // Visit a page over https that contains a frame with a redirect.
4451 4449
4452 // XMLHttpRequest insecure content in synchronous mode. 4450 // XMLHttpRequest insecure content in synchronous mode.
4453 4451
4454 // XMLHttpRequest insecure content in asynchronous mode. 4452 // XMLHttpRequest insecure content in asynchronous mode.
4455 4453
4456 // XMLHttpRequest over bad ssl in synchronous mode. 4454 // XMLHttpRequest over bad ssl in synchronous mode.
4457 4455
4458 // XMLHttpRequest over OK ssl in synchronous mode. 4456 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/certificate_reporting_service_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698