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

Side by Side Diff: ppapi/cpp/dev/url_util_dev.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: USELESS PATCH TITLE 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
« no previous file with comments | « ppapi/cpp/dev/transport_dev.cc ('k') | ppapi/cpp/dev/url_util_dev.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 #ifndef PPAPI_CPP_DEV_URL_UTIL_DEV_H_ 5 #ifndef PPAPI_CPP_DEV_URL_UTIL_DEV_H_
6 #define PPAPI_CPP_DEV_URL_UTIL_DEV_H_ 6 #define PPAPI_CPP_DEV_URL_UTIL_DEV_H_
7 7
8 #include "ppapi/c/dev/ppb_url_util_dev.h" 8 #include "ppapi/c/dev/ppb_url_util_dev.h"
9 #include "ppapi/cpp/var.h" 9 #include "ppapi/cpp/var.h"
10 10
11 namespace pp { 11 namespace pp {
12 12
13 class Instance; 13 class InstanceHandle;
14 14
15 // Simple wrapper around the PPB_URLUtil interface. 15 // Simple wrapper around the PPB_URLUtil interface.
16 class URLUtil_Dev { 16 class URLUtil_Dev {
17 public: 17 public:
18 // This class is just a collection of random functions that aren't 18 // This class is just a collection of random functions that aren't
19 // particularly attached to anything. So this getter returns a cached 19 // particularly attached to anything. So this getter returns a cached
20 // instance of this interface. This may return NULL if the browser doesn't 20 // instance of this interface. This may return NULL if the browser doesn't
21 // support the URLUtil inteface. Since this is a singleton, don't delete the 21 // support the URLUtil inteface. Since this is a singleton, don't delete the
22 // pointer. 22 // pointer.
23 static const URLUtil_Dev* Get(); 23 static const URLUtil_Dev* Get();
24 24
25 Var Canonicalize(const Var& url, 25 Var Canonicalize(const Var& url,
26 PP_URLComponents_Dev* components = NULL) const; 26 PP_URLComponents_Dev* components = NULL) const;
27 27
28 Var ResolveRelativeToURL(const Var& base_url, 28 Var ResolveRelativeToURL(const Var& base_url,
29 const Var& relative_string, 29 const Var& relative_string,
30 PP_URLComponents_Dev* components = NULL) const; 30 PP_URLComponents_Dev* components = NULL) const;
31 Var ResolveRelativeToDocument(const Instance& instance, 31 Var ResolveRelativeToDocument(const InstanceHandle& instance,
32 const Var& relative_string, 32 const Var& relative_string,
33 PP_URLComponents_Dev* components = NULL) const; 33 PP_URLComponents_Dev* components = NULL) const;
34 34
35 bool IsSameSecurityOrigin(const Var& url_a, const Var& url_b) const; 35 bool IsSameSecurityOrigin(const Var& url_a, const Var& url_b) const;
36 bool DocumentCanRequest(const Instance& instance, const Var& url) const; 36 bool DocumentCanRequest(const InstanceHandle& instance, const Var& url) const;
37 bool DocumentCanAccessDocument(const Instance& active, 37 bool DocumentCanAccessDocument(const InstanceHandle& active,
38 const Instance& target) const; 38 const InstanceHandle& target) const;
39 Var GetDocumentURL(const Instance& instance, 39 Var GetDocumentURL(const InstanceHandle& instance,
40 PP_URLComponents_Dev* components = NULL) const; 40 PP_URLComponents_Dev* components = NULL) const;
41 41
42 Var GetPluginInstanceURL(const Instance& instance, 42 Var GetPluginInstanceURL(const InstanceHandle& instance,
43 PP_URLComponents_Dev* components = NULL) const; 43 PP_URLComponents_Dev* components = NULL) const;
44 44
45 private: 45 private:
46 URLUtil_Dev() : interface_(NULL) {} 46 URLUtil_Dev() : interface_(NULL) {}
47 47
48 // Copy and assignment are disallowed. 48 // Copy and assignment are disallowed.
49 URLUtil_Dev(const URLUtil_Dev& other); 49 URLUtil_Dev(const URLUtil_Dev& other);
50 URLUtil_Dev& operator=(const URLUtil_Dev& other); 50 URLUtil_Dev& operator=(const URLUtil_Dev& other);
51 51
52 const PPB_URLUtil_Dev* interface_; 52 const PPB_URLUtil_Dev* interface_;
53 }; 53 };
54 54
55 } // namespace pp 55 } // namespace pp
56 56
57 #endif // PPAPI_CPP_DEV_URL_UTIL_DEV_H_ 57 #endif // PPAPI_CPP_DEV_URL_UTIL_DEV_H_
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/transport_dev.cc ('k') | ppapi/cpp/dev/url_util_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698