Index: ppapi/shared_impl/url_request_info_data.cc |
diff --git a/ppapi/shared_impl/url_request_info_data.cc b/ppapi/shared_impl/url_request_info_data.cc |
index 8bb02a447f04f515aae0668f6d9f028da459bed4..53254cbbd725898ae0f1802278fafb5200314607 100644 |
--- a/ppapi/shared_impl/url_request_info_data.cc |
+++ b/ppapi/shared_impl/url_request_info_data.cc |
@@ -4,6 +4,7 @@ |
#include "ppapi/shared_impl/url_request_info_data.h" |
+#include <stdio.h> |
#include "ppapi/shared_impl/resource.h" |
namespace ppapi { |
@@ -17,6 +18,7 @@ const int32_t kDefaultPrefetchBufferLowerThreshold = 50 * 1000 * 1000; |
URLRequestInfoData::BodyItem::BodyItem() |
: is_file(false), |
+ file_ref_pp_resource(0), |
start_offset(0), |
number_of_bytes(-1), |
expected_last_modified_time(0.0) { |
@@ -25,6 +27,7 @@ URLRequestInfoData::BodyItem::BodyItem() |
URLRequestInfoData::BodyItem::BodyItem(const std::string& data) |
: is_file(false), |
data(data), |
+ file_ref_pp_resource(0), |
start_offset(0), |
number_of_bytes(-1), |
expected_last_modified_time(0.0) { |
@@ -36,11 +39,17 @@ URLRequestInfoData::BodyItem::BodyItem( |
int64_t number_of_bytes, |
PP_Time expected_last_modified_time) |
: is_file(true), |
- file_ref(file_ref), |
- file_ref_host_resource(file_ref->host_resource()), |
+ file_ref_pp_resource(file_ref->pp_resource()), |
start_offset(start_offset), |
number_of_bytes(number_of_bytes), |
expected_last_modified_time(expected_last_modified_time) { |
+ PpapiGlobals::Get()->GetResourceTracker()->AddRefResource( |
+ file_ref_pp_resource); |
+} |
+ |
+URLRequestInfoData::BodyItem::~BodyItem() { |
+ PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource( |
+ file_ref_pp_resource); |
dmichael (off chromium)
2013/08/07 22:19:13
nit/suggestion: can you use ScopedPPResource inste
teravest
2013/08/08 00:50:06
It makes serializing the object a lot harder/more
|
} |
URLRequestInfoData::URLRequestInfoData() |