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

Side by Side Diff: ppapi/proxy/ppb_file_ref_proxy.cc

Issue 7578001: Unify var tracking between webkit and the proxy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppapi_proxy_test.cc ('k') | ppapi/proxy/ppb_font_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_file_ref_proxy.h" 5 #include "ppapi/proxy/ppb_file_ref_proxy.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_file_ref.h" 8 #include "ppapi/c/ppb_file_ref.h"
9 #include "ppapi/c/private/ppb_proxy_private.h" 9 #include "ppapi/c/private/ppb_proxy_private.h"
10 #include "ppapi/proxy/enter_proxy.h" 10 #include "ppapi/proxy/enter_proxy.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 : PluginResource(info.resource) { 68 : PluginResource(info.resource) {
69 Dispatcher* dispatcher = PluginDispatcher::GetForInstance(instance()); 69 Dispatcher* dispatcher = PluginDispatcher::GetForInstance(instance());
70 70
71 file_system_type_ = static_cast<PP_FileSystemType>(info.file_system_type); 71 file_system_type_ = static_cast<PP_FileSystemType>(info.file_system_type);
72 72
73 name_ = ReceiveSerializedVarReturnValue(info.name).Return(dispatcher); 73 name_ = ReceiveSerializedVarReturnValue(info.name).Return(dispatcher);
74 path_ = ReceiveSerializedVarReturnValue(info.path).Return(dispatcher); 74 path_ = ReceiveSerializedVarReturnValue(info.path).Return(dispatcher);
75 } 75 }
76 76
77 FileRef::~FileRef() { 77 FileRef::~FileRef() {
78 PluginVarTracker::GetInstance()->Release(path_); 78 PluginVarTracker& var_tracker =
79 PluginVarTracker::GetInstance()->Release(name_); 79 PluginResourceTracker::GetInstance()->var_tracker();
80 var_tracker.ReleaseVar(path_);
81 var_tracker.ReleaseVar(name_);
80 } 82 }
81 83
82 PPB_FileRef_API* FileRef::AsPPB_FileRef_API() { 84 PPB_FileRef_API* FileRef::AsPPB_FileRef_API() {
83 return this; 85 return this;
84 } 86 }
85 87
86 PP_FileSystemType FileRef::GetFileSystemType() const { 88 PP_FileSystemType FileRef::GetFileSystemType() const {
87 return file_system_type_; 89 return file_system_type_;
88 } 90 }
89 91
90 PP_Var FileRef::GetName() const { 92 PP_Var FileRef::GetName() const {
91 PluginVarTracker::GetInstance()->AddRef(name_); 93 PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(name_);
92 return name_; 94 return name_;
93 } 95 }
94 96
95 PP_Var FileRef::GetPath() const { 97 PP_Var FileRef::GetPath() const {
96 PluginVarTracker::GetInstance()->AddRef(path_); 98 PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(path_);
97 return path_; 99 return path_;
98 } 100 }
99 101
100 PP_Resource FileRef::GetParent() { 102 PP_Resource FileRef::GetParent() {
101 PPBFileRef_CreateInfo create_info; 103 PPBFileRef_CreateInfo create_info;
102 GetDispatcher()->Send(new PpapiHostMsg_PPBFileRef_GetParent( 104 GetDispatcher()->Send(new PpapiHostMsg_PPBFileRef_GetParent(
103 INTERFACE_ID_PPB_FILE_REF, host_resource(), &create_info)); 105 INTERFACE_ID_PPB_FILE_REF, host_resource(), &create_info));
104 return PPB_FileRef_Proxy::DeserializeFileRef(create_info); 106 return PPB_FileRef_Proxy::DeserializeFileRef(create_info);
105 } 107 }
106 108
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return; 296 return;
295 PP_CompletionCallback callback = ReceiveCallback(serialized_callback); 297 PP_CompletionCallback callback = ReceiveCallback(serialized_callback);
296 int32_t result = enter.object()->Rename(new_file_ref.host_resource(), 298 int32_t result = enter.object()->Rename(new_file_ref.host_resource(),
297 callback); 299 callback);
298 if (result != PP_OK_COMPLETIONPENDING) 300 if (result != PP_OK_COMPLETIONPENDING)
299 PP_RunCompletionCallback(&callback, result); 301 PP_RunCompletionCallback(&callback, result);
300 } 302 }
301 303
302 } // namespace proxy 304 } // namespace proxy
303 } // namespace pp 305 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_proxy_test.cc ('k') | ppapi/proxy/ppb_font_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698