OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/pepper/url_response_info_util.h" | 5 #include "content/renderer/pepper/url_response_info_util.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 WebString file_path = response.downloadFilePath(); | 92 WebString file_path = response.downloadFilePath(); |
93 if (!file_path.isEmpty()) { | 93 if (!file_path.isEmpty()) { |
94 base::FilePath external_path = blink::WebStringToFilePath(file_path); | 94 base::FilePath external_path = blink::WebStringToFilePath(file_path); |
95 // TODO(teravest): Write a utility function to create resource hosts in the | 95 // TODO(teravest): Write a utility function to create resource hosts in the |
96 // renderer and browser. | 96 // renderer and browser. |
97 PepperFileRefRendererHost* renderer_host = | 97 PepperFileRefRendererHost* renderer_host = |
98 new PepperFileRefRendererHost(host_impl, pp_instance, 0, external_path); | 98 new PepperFileRefRendererHost(host_impl, pp_instance, 0, external_path); |
99 int renderer_pending_host_id = | 99 int renderer_pending_host_id = |
100 host_impl->GetPpapiHost()->AddPendingResourceHost( | 100 host_impl->GetPpapiHost()->AddPendingResourceHost( |
101 scoped_ptr<ppapi::host::ResourceHost>(renderer_host)); | 101 std::unique_ptr<ppapi::host::ResourceHost>(renderer_host)); |
102 | 102 |
103 std::vector<IPC::Message> create_msgs; | 103 std::vector<IPC::Message> create_msgs; |
104 create_msgs.push_back(PpapiHostMsg_FileRef_CreateForRawFS(external_path)); | 104 create_msgs.push_back(PpapiHostMsg_FileRef_CreateForRawFS(external_path)); |
105 host_impl->CreateBrowserResourceHosts(pp_instance, | 105 host_impl->CreateBrowserResourceHosts(pp_instance, |
106 create_msgs, | 106 create_msgs, |
107 base::Bind(&DidCreateResourceHosts, | 107 base::Bind(&DidCreateResourceHosts, |
108 data, | 108 data, |
109 external_path, | 109 external_path, |
110 renderer_pending_host_id, | 110 renderer_pending_host_id, |
111 callback)); | 111 callback)); |
112 } else { | 112 } else { |
113 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 113 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
114 base::Bind(callback, data)); | 114 base::Bind(callback, data)); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
OLD | NEW |