| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/fetcher/data_fetcher.h" | 5 #include "mojo/fetcher/data_fetcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 13 #include "mojo/public/cpp/system/data_pipe.h" |
| 13 #include "net/base/data_url.h" | 14 #include "net/base/data_url.h" |
| 14 #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" | |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 namespace fetcher { | 17 namespace fetcher { |
| 18 | 18 |
| 19 ScopedDataPipeConsumerHandle CreateConsumerHandleForString( | 19 ScopedDataPipeConsumerHandle CreateConsumerHandleForString( |
| 20 const std::string& data) { | 20 const std::string& data) { |
| 21 if (data.size() > std::numeric_limits<uint32_t>::max()) | 21 if (data.size() > std::numeric_limits<uint32_t>::max()) |
| 22 return ScopedDataPipeConsumerHandle(); | 22 return ScopedDataPipeConsumerHandle(); |
| 23 uint32_t num_bytes = static_cast<uint32_t>(data.size()); | 23 uint32_t num_bytes = static_cast<uint32_t>(data.size()); |
| 24 MojoCreateDataPipeOptions options; | 24 MojoCreateDataPipeOptions options; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool DataFetcher::PeekFirstLine(std::string* line) { | 106 bool DataFetcher::PeekFirstLine(std::string* line) { |
| 107 // This is only called for 'mojo magic' (i.e. detecting shebang'ed | 107 // This is only called for 'mojo magic' (i.e. detecting shebang'ed |
| 108 // content-handler. Since HasMojoMagic() returns false above, this should | 108 // content-handler. Since HasMojoMagic() returns false above, this should |
| 109 // never be reached. | 109 // never be reached. |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace fetcher | 114 } // namespace fetcher |
| 115 } // namespace mojo | 115 } // namespace mojo |
| OLD | NEW |