| OLD | NEW |
| 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_SHARED_IMPL_URL_UTIL_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_URL_UTIL_SHARED_H_ |
| 6 #define PPAPI_SHARED_IMPL_URL_UTIL_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_URL_UTIL_SHARED_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "googleurl/src/url_parse.h" | 11 #include "googleurl/src/url_parse.h" |
| 12 #include "ppapi/c/dev/ppb_url_util_dev.h" | 12 #include "ppapi/c/dev/ppb_url_util_dev.h" |
| 13 #include "ppapi/c/pp_module.h" | 13 #include "ppapi/c/pp_module.h" |
| 14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
| 15 #include "ppapi/shared_impl/ppapi_shared_export.h" | 15 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace ppapi { | 19 namespace ppapi { |
| 20 | 20 |
| 21 // Contains the implementation of PPB_URLUtil that is shared between the proxy | 21 // Contains the implementation of PPB_URLUtil that is shared between the proxy |
| 22 // and the renderer. | 22 // and the renderer. |
| 23 class PPAPI_SHARED_EXPORT URLUtilImpl { | 23 class PPAPI_SHARED_EXPORT PPB_URLUtil_Shared { |
| 24 public: | 24 public: |
| 25 // PPB_URLUtil shared functions. | 25 // PPB_URLUtil shared functions. |
| 26 static PP_Var Canonicalize(PP_Var url, | 26 static PP_Var Canonicalize(PP_Var url, |
| 27 PP_URLComponents_Dev* components); | 27 PP_URLComponents_Dev* components); |
| 28 static PP_Var ResolveRelativeToURL(PP_Var base_url, | 28 static PP_Var ResolveRelativeToURL(PP_Var base_url, |
| 29 PP_Var relative, | 29 PP_Var relative, |
| 30 PP_URLComponents_Dev* components); | 30 PP_URLComponents_Dev* components); |
| 31 static PP_Bool IsSameSecurityOrigin(PP_Var url_a, PP_Var url_b); | 31 static PP_Bool IsSameSecurityOrigin(PP_Var url_a, PP_Var url_b); |
| 32 | 32 |
| 33 // Used for returning the given GURL from a PPAPI function, with an optional | 33 // Used for returning the given GURL from a PPAPI function, with an optional |
| 34 // out param indicating the components. | 34 // out param indicating the components. |
| 35 static PP_Var GenerateURLReturn(PP_Module pp_module, | 35 static PP_Var GenerateURLReturn(PP_Module pp_module, |
| 36 const GURL& url, | 36 const GURL& url, |
| 37 PP_URLComponents_Dev* components); | 37 PP_URLComponents_Dev* components); |
| 38 | 38 |
| 39 // Helper function that optionally take a components structure and fills it | 39 // Helper function that optionally take a components structure and fills it |
| 40 // out with the parsed version of the given URL. If the components pointer is | 40 // out with the parsed version of the given URL. If the components pointer is |
| 41 // NULL, this function will do nothing. | 41 // NULL, this function will do nothing. |
| 42 // | 42 // |
| 43 // It's annoying to serialze the large PP_URLComponents structure across IPC | 43 // It's annoying to serialze the large PP_URLComponents structure across IPC |
| 44 // and the data isn't often requested by plugins. This function is used on | 44 // and the data isn't often requested by plugins. This function is used on |
| 45 // the plugin side to fill in the components for those cases where it's | 45 // the plugin side to fill in the components for those cases where it's |
| 46 // actually needed. | 46 // actually needed. |
| 47 static PP_Var ConvertComponentsAndReturnURL(const PP_Var& url, | 47 static PP_Var ConvertComponentsAndReturnURL(const PP_Var& url, |
| 48 PP_URLComponents_Dev* components); | 48 PP_URLComponents_Dev* components); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace ppapi | 51 } // namespace ppapi |
| 52 | 52 |
| 53 #endif | 53 #endif // PPAPI_SHARED_IMPL_PPB_URL_UTIL_SHARED_H_ |
| OLD | NEW |