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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 } else { | 653 } else { |
654 client_->didFinishLoading( | 654 client_->didFinishLoading( |
655 loader_, (completion_time - TimeTicks()).InSecondsF(), | 655 loader_, (completion_time - TimeTicks()).InSecondsF(), |
656 total_transfer_size); | 656 total_transfer_size); |
657 } | 657 } |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 bool WebURLLoaderImpl::Context::CanHandleDataURLRequestLocally() const { | 661 bool WebURLLoaderImpl::Context::CanHandleDataURLRequestLocally() const { |
662 GURL url = request_.url(); | 662 GURL url = request_.url(); |
663 if (!url.SchemeIs("data")) | 663 if (!url.SchemeIs(url::kDataScheme)) |
664 return false; | 664 return false; |
665 | 665 |
666 // The fast paths for data URL, Start() and HandleDataURL(), don't support | 666 // The fast paths for data URL, Start() and HandleDataURL(), don't support |
667 // the downloadToFile option. | 667 // the downloadToFile option. |
668 if (request_.downloadToFile()) | 668 if (request_.downloadToFile()) |
669 return false; | 669 return false; |
670 | 670 |
671 // Optimize for the case where we can handle a data URL locally. We must | 671 // Optimize for the case where we can handle a data URL locally. We must |
672 // skip this for data URLs targetted at frames since those could trigger a | 672 // skip this for data URLs targetted at frames since those could trigger a |
673 // download. | 673 // download. |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 int intra_priority_value) { | 903 int intra_priority_value) { |
904 context_->DidChangePriority(new_priority, intra_priority_value); | 904 context_->DidChangePriority(new_priority, intra_priority_value); |
905 } | 905 } |
906 | 906 |
907 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 907 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
908 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 908 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
909 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 909 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
910 } | 910 } |
911 | 911 |
912 } // namespace content | 912 } // namespace content |
OLD | NEW |