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/resource_converter.h" | 5 #include "content/renderer/pepper/resource_converter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/public/renderer/renderer_ppapi_host.h" | 9 #include "content/public/renderer/renderer_ppapi_host.h" |
10 #include "content/renderer/pepper/pepper_file_system_host.h" | 10 #include "content/renderer/pepper/pepper_file_system_host.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 void ResourceConverterImpl::Flush(const base::Callback<void(bool)>& callback) { | 268 void ResourceConverterImpl::Flush(const base::Callback<void(bool)>& callback) { |
269 host_->CreateBrowserResourceHosts( | 269 host_->CreateBrowserResourceHosts( |
270 instance_, | 270 instance_, |
271 browser_host_create_messages_, | 271 browser_host_create_messages_, |
272 base::Bind(&FlushComplete, callback, browser_vars_)); | 272 base::Bind(&FlushComplete, callback, browser_vars_)); |
273 browser_host_create_messages_.clear(); | 273 browser_host_create_messages_.clear(); |
274 browser_vars_.clear(); | 274 browser_vars_.clear(); |
275 } | 275 } |
276 | 276 |
| 277 bool ResourceConverterImpl::FlushSync() { |
| 278 if (!browser_host_create_messages_.empty()) { |
| 279 // TODO(dmichael): Make these work; we have to make a synchronous path to |
| 280 // create browser-side hosts. crbug.com/367896 |
| 281 return false; |
| 282 } |
| 283 return true; |
| 284 } |
| 285 |
277 bool ResourceConverterImpl::ToV8Value(const PP_Var& var, | 286 bool ResourceConverterImpl::ToV8Value(const PP_Var& var, |
278 v8::Handle<v8::Context> context, | 287 v8::Handle<v8::Context> context, |
279 v8::Handle<v8::Value>* result) { | 288 v8::Handle<v8::Value>* result) { |
280 DCHECK(var.type == PP_VARTYPE_RESOURCE); | 289 DCHECK(var.type == PP_VARTYPE_RESOURCE); |
281 | 290 |
282 ResourceVar* resource = ResourceVar::FromPPVar(var); | 291 ResourceVar* resource = ResourceVar::FromPPVar(var); |
283 if (!resource) { | 292 if (!resource) { |
284 NOTREACHED(); | 293 NOTREACHED(); |
285 return false; | 294 return false; |
286 } | 295 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 const IPC::Message& create_message, | 343 const IPC::Message& create_message, |
335 const IPC::Message& browser_host_create_message) { | 344 const IPC::Message& browser_host_create_message) { |
336 scoped_refptr<HostResourceVar> result = | 345 scoped_refptr<HostResourceVar> result = |
337 CreateResourceVar(pending_renderer_id, create_message); | 346 CreateResourceVar(pending_renderer_id, create_message); |
338 browser_host_create_messages_.push_back(browser_host_create_message); | 347 browser_host_create_messages_.push_back(browser_host_create_message); |
339 browser_vars_.push_back(result); | 348 browser_vars_.push_back(result); |
340 return result; | 349 return result; |
341 } | 350 } |
342 | 351 |
343 } // namespace content | 352 } // namespace content |
OLD | NEW |