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

Side by Side Diff: ppapi/cpp/url_loader.h

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
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 #ifndef PPAPI_CPP_URL_LOADER_H_ 5 #ifndef PPAPI_CPP_URL_LOADER_H_
6 #define PPAPI_CPP_URL_LOADER_H_ 6 #define PPAPI_CPP_URL_LOADER_H_
7 7
8 #include "ppapi/c/pp_stdint.h" 8 #include "ppapi/c/pp_stdint.h"
9 #include "ppapi/cpp/resource.h" 9 #include "ppapi/cpp/resource.h"
10 10
11 /// @file 11 /// @file
12 /// This file defines the API for loading URLs. 12 /// This file defines the API for loading URLs.
13 namespace pp { 13 namespace pp {
14 14
15 class CompletionCallback; 15 class CompletionCallback;
16 class Instance; 16 class InstanceHandle;
17 class URLRequestInfo; 17 class URLRequestInfo;
18 class URLResponseInfo; 18 class URLResponseInfo;
19 19
20 /// URLLoader provides an API for loading URLs. 20 /// URLLoader provides an API for loading URLs.
21 /// Refer to <code>ppapi/examples/url_loader/streaming.cc</code> 21 /// Refer to <code>ppapi/examples/url_loader/streaming.cc</code>
22 /// for an example of how to use this class. 22 /// for an example of how to use this class.
23 class URLLoader : public Resource { 23 class URLLoader : public Resource {
24 public: 24 public:
25 /// Default constructor for creating an is_null() 25 /// Default constructor for creating an is_null()
26 /// <code>URLLoader</code> object. 26 /// <code>URLLoader</code> object.
27 URLLoader() {} 27 URLLoader() {}
28 28
29 // TODO(brettw) remove this when NaCl is updated to use the new version 29 // TODO(brettw) remove this when NaCl is updated to use the new version
30 // that takes a pointer. 30 // that takes a pointer.
31 explicit URLLoader(const Instance& instance); 31 //explicit URLLoader(const Instance& instance);
32 32
33 /// A constructor used when a <code>PP_Resource</code> is provided as a 33 /// A constructor used when a <code>PP_Resource</code> is provided as a
34 /// return value whose reference count we need to increment. 34 /// return value whose reference count we need to increment.
35 /// 35 ///
36 /// @param[in] resource A <code>PP_Resource</code> corresponding to a 36 /// @param[in] resource A <code>PP_Resource</code> corresponding to a
37 /// <code>URLLoader</code> resource. 37 /// <code>URLLoader</code> resource.
38 explicit URLLoader(PP_Resource resource); 38 explicit URLLoader(PP_Resource resource);
39 39
40 /// A constructor used to allocate a new URLLoader in the browser. The 40 /// A constructor used to allocate a new URLLoader in the browser. The
41 /// resulting object will be <code>is_null</code> if the allocation failed. 41 /// resulting object will be <code>is_null</code> if the allocation failed.
42 /// 42 ///
43 /// @param[in] instance An <code>Instance</code>. 43 /// @param[in] instance The instance with which this resource will be
44 explicit URLLoader(Instance* instance); 44 /// associated.
45 explicit URLLoader(const InstanceHandle& instance);
45 46
46 /// The copy constructor for <code>URLLoader</code>. 47 /// The copy constructor for <code>URLLoader</code>.
47 /// 48 ///
48 /// @param other A <code>URLLoader</code> to be copied. 49 /// @param other A <code>URLLoader</code> to be copied.
49 URLLoader(const URLLoader& other); 50 URLLoader(const URLLoader& other);
50 51
51 /// This function begins loading the <code>URLRequestInfo</code>. 52 /// This function begins loading the <code>URLRequestInfo</code>.
52 /// The operation completes when response headers are received or when an 53 /// The operation completes when response headers are received or when an
53 /// error occurs. Use GetResponseInfo() to access the response 54 /// error occurs. Use GetResponseInfo() to access the response
54 /// headers. 55 /// headers.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 /// 163 ///
163 /// <strong>Note:</strong> If the <code>URLLoader</code> object is destroyed 164 /// <strong>Note:</strong> If the <code>URLLoader</code> object is destroyed
164 /// while it is still open, then it will be implicitly closed so you are not 165 /// while it is still open, then it will be implicitly closed so you are not
165 /// required to call Close(). 166 /// required to call Close().
166 void Close(); 167 void Close();
167 }; 168 };
168 169
169 } // namespace pp 170 } // namespace pp
170 171
171 #endif // PPAPI_CPP_URL_LOADER_H_ 172 #endif // PPAPI_CPP_URL_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698