Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: ppapi/proxy/url_response_info_resource.cc

Issue 21966004: Pepper: Move FileRef to the "new" resource proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove code duplication Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/url_response_info_resource.cc
diff --git a/ppapi/proxy/url_response_info_resource.cc b/ppapi/proxy/url_response_info_resource.cc
index 85dae9a1aef485c989fa39d30a674bd805ff8515..b7bc7e3fc5934b24594c8a1b2441c610c03da915 100644
--- a/ppapi/proxy/url_response_info_resource.cc
+++ b/ppapi/proxy/url_response_info_resource.cc
@@ -4,7 +4,7 @@
#include "ppapi/proxy/url_response_info_resource.h"
-#include "ppapi/proxy/ppb_file_ref_proxy.h"
+#include "ppapi/proxy/file_ref_resource.h"
#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/resource_creation_api.h"
@@ -62,8 +62,13 @@ PP_Var URLResponseInfoResource::GetProperty(PP_URLResponseProperty property) {
}
PP_Resource URLResponseInfoResource::GetBodyAsFileRef() {
- if (!body_as_file_ref_.get())
- return 0;
+ if (!body_as_file_ref_.get()) {
+ PP_Resource r = FileRefResource::CreateFileRef(
+ connection(),
+ pp_instance(),
+ data_.body_as_file_ref);
+ body_as_file_ref_ = ScopedPPResource(r);
dmichael (off chromium) 2013/08/07 22:19:13 (you could assign directly, though I'm okay with m
teravest 2013/08/08 00:50:06 Changed to assign directly instead.
+ }
PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(
body_as_file_ref_.get());
return body_as_file_ref_.get();

Powered by Google App Engine
This is Rietveld 408576698