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

Unified Diff: ppapi/thunk/ppb_url_util_dev_thunk.cc

Issue 61643022: Proxy private UMA pepper interface for out-of-process and NaCl plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add back browser impl for testing Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« ppapi/proxy/uma_private_resource.cc ('K') | « ppapi/thunk/ppb_uma_singleton_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ppapi/proxy/uma_private_resource.cc ('K') | « ppapi/thunk/ppb_uma_singleton_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698