| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/loader/buffered_resource_handler.h" | 5 #include "content/browser/loader/buffered_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 net::URLRequest* request, | 92 net::URLRequest* request, |
| 93 bool is_content_initiated, | 93 bool is_content_initiated, |
| 94 bool must_download, | 94 bool must_download, |
| 95 uint32 id, | 95 uint32 id, |
| 96 scoped_ptr<DownloadSaveInfo> save_info, | 96 scoped_ptr<DownloadSaveInfo> save_info, |
| 97 const DownloadUrlParameters::OnStartedCallback& started_cb) override { | 97 const DownloadUrlParameters::OnStartedCallback& started_cb) override { |
| 98 return scoped_ptr<ResourceHandler>(new TestResourceHandler).Pass(); | 98 return scoped_ptr<ResourceHandler>(new TestResourceHandler).Pass(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( | 101 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( |
| 102 const base::FilePath& plugin_path, |
| 102 net::URLRequest* request, | 103 net::URLRequest* request, |
| 103 ResourceResponse* response, | 104 ResourceResponse* response, |
| 104 std::string* payload) override { | 105 std::string* payload) override { |
| 105 if (stream_has_handler_) { | 106 if (stream_has_handler_) { |
| 106 intercepted_as_stream_ = true; | 107 intercepted_as_stream_ = true; |
| 107 return scoped_ptr<ResourceHandler>(new TestResourceHandler).Pass(); | 108 return scoped_ptr<ResourceHandler>(new TestResourceHandler).Pass(); |
| 108 } else { | 109 } else { |
| 109 return scoped_ptr<ResourceHandler>(); | 110 return scoped_ptr<ResourceHandler>(); |
| 110 } | 111 } |
| 111 } | 112 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 allow_download = true; | 278 allow_download = true; |
| 278 must_download = false; | 279 must_download = false; |
| 279 resource_type = RESOURCE_TYPE_MAIN_FRAME; | 280 resource_type = RESOURCE_TYPE_MAIN_FRAME; |
| 280 EXPECT_FALSE( | 281 EXPECT_FALSE( |
| 281 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 282 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
| 282 } | 283 } |
| 283 | 284 |
| 284 } // namespace | 285 } // namespace |
| 285 | 286 |
| 286 } // namespace content | 287 } // namespace content |
| OLD | NEW |