OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "remoting/client/plugin/pepper_url_request.h" | 5 #include "remoting/client/plugin/pepper_url_request.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ptr_util.h" |
9 #include "ppapi/cpp/url_response_info.h" | 10 #include "ppapi/cpp/url_response_info.h" |
10 | 11 |
11 // Read buffer we allocate per read when reading response from | 12 // Read buffer we allocate per read when reading response from |
12 // URLLoader. | 13 // URLLoader. |
13 static const int kReadSize = 1024; | 14 static const int kReadSize = 1024; |
14 | 15 |
15 namespace remoting { | 16 namespace remoting { |
16 | 17 |
17 PepperUrlRequest::PepperUrlRequest(pp::InstanceHandle pp_instance, | 18 PepperUrlRequest::PepperUrlRequest(pp::InstanceHandle pp_instance, |
18 UrlRequest::Type type, | 19 UrlRequest::Type type, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 101 } |
101 | 102 |
102 base::ResetAndReturn(&on_result_callback_) | 103 base::ResetAndReturn(&on_result_callback_) |
103 .Run(Result(url_loader_.GetResponseInfo().GetStatusCode(), response_)); | 104 .Run(Result(url_loader_.GetResponseInfo().GetStatusCode(), response_)); |
104 } | 105 } |
105 | 106 |
106 PepperUrlRequestFactory::PepperUrlRequestFactory(pp::InstanceHandle pp_instance) | 107 PepperUrlRequestFactory::PepperUrlRequestFactory(pp::InstanceHandle pp_instance) |
107 : pp_instance_(pp_instance) {} | 108 : pp_instance_(pp_instance) {} |
108 PepperUrlRequestFactory::~PepperUrlRequestFactory() {} | 109 PepperUrlRequestFactory::~PepperUrlRequestFactory() {} |
109 | 110 |
110 scoped_ptr<UrlRequest> PepperUrlRequestFactory::CreateUrlRequest( | 111 std::unique_ptr<UrlRequest> PepperUrlRequestFactory::CreateUrlRequest( |
111 UrlRequest::Type type, | 112 UrlRequest::Type type, |
112 const std::string& url) { | 113 const std::string& url) { |
113 return make_scoped_ptr(new PepperUrlRequest(pp_instance_, type, url)); | 114 return base::WrapUnique(new PepperUrlRequest(pp_instance_, type, url)); |
114 } | 115 } |
115 | 116 |
116 } // namespace remoting | 117 } // namespace remoting |
OLD | NEW |