| OLD | NEW |
| 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 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2871 int ReadRawData(net::IOBuffer* buf, int buf_size) override { | 2871 int ReadRawData(net::IOBuffer* buf, int buf_size) override { |
| 2872 int bytes_read = | 2872 int bytes_read = |
| 2873 std::min(static_cast<size_t>(buf_size), | 2873 std::min(static_cast<size_t>(buf_size), |
| 2874 strlen(network_time::kGoodTimeResponseBody) - data_offset_); | 2874 strlen(network_time::kGoodTimeResponseBody) - data_offset_); |
| 2875 memcpy(buf->data(), network_time::kGoodTimeResponseBody + data_offset_, | 2875 memcpy(buf->data(), network_time::kGoodTimeResponseBody + data_offset_, |
| 2876 bytes_read); | 2876 bytes_read); |
| 2877 data_offset_ += bytes_read; | 2877 data_offset_ += bytes_read; |
| 2878 return bytes_read; | 2878 return bytes_read; |
| 2879 } | 2879 } |
| 2880 | 2880 |
| 2881 int GetResponseCode() const override { return 200; } | |
| 2882 | |
| 2883 void GetResponseInfo(net::HttpResponseInfo* info) override { | 2881 void GetResponseInfo(net::HttpResponseInfo* info) override { |
| 2884 std::string headers; | 2882 std::string headers; |
| 2885 headers.append( | 2883 headers.append( |
| 2886 "HTTP/1.1 200 OK\n" | 2884 "HTTP/1.1 200 OK\n" |
| 2887 "Content-type: text/plain\n"); | 2885 "Content-type: text/plain\n"); |
| 2888 headers.append(base::StringPrintf( | 2886 headers.append(base::StringPrintf( |
| 2889 "Content-Length: %1d\n", | 2887 "Content-Length: %1d\n", |
| 2890 static_cast<int>(strlen(network_time::kGoodTimeResponseBody)))); | 2888 static_cast<int>(strlen(network_time::kGoodTimeResponseBody)))); |
| 2891 info->headers = | 2889 info->headers = |
| 2892 new net::HttpResponseHeaders(net::HttpUtil::AssembleRawHeaders( | 2890 new net::HttpResponseHeaders(net::HttpUtil::AssembleRawHeaders( |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3889 | 3887 |
| 3890 // Visit a page over https that contains a frame with a redirect. | 3888 // Visit a page over https that contains a frame with a redirect. |
| 3891 | 3889 |
| 3892 // XMLHttpRequest insecure content in synchronous mode. | 3890 // XMLHttpRequest insecure content in synchronous mode. |
| 3893 | 3891 |
| 3894 // XMLHttpRequest insecure content in asynchronous mode. | 3892 // XMLHttpRequest insecure content in asynchronous mode. |
| 3895 | 3893 |
| 3896 // XMLHttpRequest over bad ssl in synchronous mode. | 3894 // XMLHttpRequest over bad ssl in synchronous mode. |
| 3897 | 3895 |
| 3898 // XMLHttpRequest over OK ssl in synchronous mode. | 3896 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |