| Index: ppapi/thunk/ppb_url_util_dev_thunk.cc
|
| diff --git a/ppapi/thunk/ppb_url_util_dev_thunk.cc b/ppapi/thunk/ppb_url_util_dev_thunk.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..446c3e35c869fc3713d9cc9d6c425bdda87118fe
|
| --- /dev/null
|
| +++ b/ppapi/thunk/ppb_url_util_dev_thunk.cc
|
| @@ -0,0 +1,131 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// From dev/ppb_url_util_dev.idl modified Wed Oct 16 11:11:48 2013.
|
| +
|
| +#include "ppapi/c/dev/ppb_url_util_dev.h"
|
| +#include "ppapi/c/pp_errors.h"
|
| +#include "ppapi/shared_impl/ppb_url_util_shared.h"
|
| +#include "ppapi/shared_impl/tracked_callback.h"
|
| +#include "ppapi/thunk/enter.h"
|
| +#include "ppapi/thunk/ppb_instance_api.h"
|
| +#include "ppapi/thunk/resource_creation_api.h"
|
| +#include "ppapi/thunk/thunk.h"
|
| +
|
| +namespace ppapi {
|
| +namespace thunk {
|
| +
|
| +namespace {
|
| +
|
| +struct PP_Var Canonicalize(struct PP_Var url,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::Canonicalize()";
|
| + return PPB_URLUtil_Shared::Canonicalize(url, components);
|
| +}
|
| +
|
| +struct PP_Var ResolveRelativeToURL(struct PP_Var base_url,
|
| + struct PP_Var relative_string,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::ResolveRelativeToURL()";
|
| + return PPB_URLUtil_Shared::ResolveRelativeToURL(base_url,
|
| + relative_string,
|
| + components);
|
| +}
|
| +
|
| +struct PP_Var ResolveRelativeToDocument(
|
| + PP_Instance instance,
|
| + struct PP_Var relative_string,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::ResolveRelativeToDocument()";
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return PP_MakeUndefined();
|
| + return enter.functions()->ResolveRelativeToDocument(instance,
|
| + relative_string,
|
| + components);
|
| +}
|
| +
|
| +PP_Bool IsSameSecurityOrigin(struct PP_Var url_a, struct PP_Var url_b) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::IsSameSecurityOrigin()";
|
| + return PPB_URLUtil_Shared::IsSameSecurityOrigin(url_a, url_b);
|
| +}
|
| +
|
| +PP_Bool DocumentCanRequest(PP_Instance instance, struct PP_Var url) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::DocumentCanRequest()";
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return PP_FALSE;
|
| + return enter.functions()->DocumentCanRequest(instance, url);
|
| +}
|
| +
|
| +PP_Bool DocumentCanAccessDocument(PP_Instance active, PP_Instance target) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::DocumentCanAccessDocument()";
|
| + EnterInstance enter(active);
|
| + if (enter.failed())
|
| + return PP_FALSE;
|
| + return enter.functions()->DocumentCanAccessDocument(active, target);
|
| +}
|
| +
|
| +struct PP_Var GetDocumentURL(PP_Instance instance,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::GetDocumentURL()";
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return PP_MakeUndefined();
|
| + return enter.functions()->GetDocumentURL(instance, components);
|
| +}
|
| +
|
| +struct PP_Var GetPluginInstanceURL(PP_Instance instance,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::GetPluginInstanceURL()";
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return PP_MakeUndefined();
|
| + return enter.functions()->GetPluginInstanceURL(instance, components);
|
| +}
|
| +
|
| +struct PP_Var GetPluginReferrerURL(PP_Instance instance,
|
| + struct PP_URLComponents_Dev* components) {
|
| + VLOG(4) << "PPB_URLUtil_Dev::GetPluginReferrerURL()";
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return PP_MakeUndefined();
|
| + return enter.functions()->GetPluginReferrerURL(instance, components);
|
| +}
|
| +
|
| +const PPB_URLUtil_Dev_0_6 g_ppb_urlutil_dev_thunk_0_6 = {
|
| + &Canonicalize,
|
| + &ResolveRelativeToURL,
|
| + &ResolveRelativeToDocument,
|
| + &IsSameSecurityOrigin,
|
| + &DocumentCanRequest,
|
| + &DocumentCanAccessDocument,
|
| + &GetDocumentURL,
|
| + &GetPluginInstanceURL
|
| +};
|
| +
|
| +const PPB_URLUtil_Dev_0_7 g_ppb_urlutil_dev_thunk_0_7 = {
|
| + &Canonicalize,
|
| + &ResolveRelativeToURL,
|
| + &ResolveRelativeToDocument,
|
| + &IsSameSecurityOrigin,
|
| + &DocumentCanRequest,
|
| + &DocumentCanAccessDocument,
|
| + &GetDocumentURL,
|
| + &GetPluginInstanceURL,
|
| + &GetPluginReferrerURL
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +const PPB_URLUtil_Dev_0_6* GetPPB_URLUtil_Dev_0_6_Thunk() {
|
| + return &g_ppb_urlutil_dev_thunk_0_6;
|
| +}
|
| +
|
| +const PPB_URLUtil_Dev_0_7* GetPPB_URLUtil_Dev_0_7_Thunk() {
|
| + return &g_ppb_urlutil_dev_thunk_0_7;
|
| +}
|
| +
|
| +} // namespace thunk
|
| +} // namespace ppapi
|
|
|