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 #include "ppapi/proxy/ppb_url_util_proxy.h" | 5 #include "ppapi/proxy/ppb_url_util_proxy.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "ppapi/c/dev/ppb_url_util_dev.h" | 8 #include "ppapi/c/dev/ppb_url_util_dev.h" |
9 #include "ppapi/c/dev/ppb_var_deprecated.h" | 9 #include "ppapi/c/dev/ppb_var_deprecated.h" |
10 #include "ppapi/c/ppb_core.h" | 10 #include "ppapi/c/ppb_core.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // and this data often isn't needed. | 29 // and this data often isn't needed. |
30 // | 30 // |
31 // To avoid this, we instead just parse the result again in the plugin, which | 31 // To avoid this, we instead just parse the result again in the plugin, which |
32 // this function does if the given URL is valid and the components are | 32 // this function does if the given URL is valid and the components are |
33 // non-NULL. The URL var will be returned. | 33 // non-NULL. The URL var will be returned. |
34 PP_Var ConvertComponentsAndReturnURL(PP_Var url, | 34 PP_Var ConvertComponentsAndReturnURL(PP_Var url, |
35 PP_URLComponents_Dev* components) { | 35 PP_URLComponents_Dev* components) { |
36 if (!components) | 36 if (!components) |
37 return url; // Common case - plugin doesn't care about parsing. | 37 return url; // Common case - plugin doesn't care about parsing. |
38 | 38 |
39 scoped_refptr<StringVar> url_string(StringVar::FromPPVar(url)); | 39 StringVar* url_string = StringVar::FromPPVar(url); |
40 if (!url_string) | 40 if (!url_string) |
41 return url; | 41 return url; |
42 | 42 |
43 PP_Var result = Canonicalize(url, components); | 43 PP_Var result = Canonicalize(url, components); |
44 PluginResourceTracker::GetInstance()->var_tracker().ReleaseVar(url); | 44 PluginResourceTracker::GetInstance()->var_tracker().ReleaseVar(url); |
45 return result; | 45 return result; |
46 } | 46 } |
47 | 47 |
48 PP_Var ResolveRelativeToURL(PP_Var base_url, | 48 PP_Var ResolveRelativeToURL(PP_Var base_url, |
49 PP_Var relative, | 49 PP_Var relative, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 void PPB_URLUtil_Proxy::OnMsgGetPluginInstanceURL( | 206 void PPB_URLUtil_Proxy::OnMsgGetPluginInstanceURL( |
207 PP_Instance instance, SerializedVarReturnValue result) { | 207 PP_Instance instance, SerializedVarReturnValue result) { |
208 result.Return(dispatcher(), | 208 result.Return(dispatcher(), |
209 ppb_url_util_target()->GetPluginInstanceURL(instance, NULL)); | 209 ppb_url_util_target()->GetPluginInstanceURL(instance, NULL)); |
210 } | 210 } |
211 | 211 |
212 } // namespace proxy | 212 } // namespace proxy |
213 } // namespace ppapi | 213 } // namespace ppapi |
214 | 214 |
OLD | NEW |