cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / ppapi / thunk / ppb_url_util_thunk.cc
blob3dc9f3aa4bb24c8b0fe5b78d402c47095d1b1195
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/c/pp_errors.h"
6 #include "ppapi/shared_impl/ppb_url_util_shared.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_instance_api.h"
9 #include "ppapi/thunk/thunk.h"
11 namespace ppapi {
12 namespace thunk {
14 namespace {
16 PP_Var ResolveRelativeToDocument(PP_Instance instance,
17 PP_Var relative,
18 PP_URLComponents_Dev* components) {
19 EnterInstance enter(instance);
20 if (enter.failed())
21 return PP_MakeUndefined();
22 return enter.functions()->ResolveRelativeToDocument(instance, relative,
23 components);
26 PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) {
27 EnterInstance enter(instance);
28 if (enter.failed())
29 return PP_FALSE;
30 return enter.functions()->DocumentCanRequest(instance, url);
33 PP_Bool DocumentCanAccessDocument(PP_Instance active, PP_Instance target) {
34 EnterInstance enter(active);
35 if (enter.failed())
36 return PP_FALSE;
37 return enter.functions()->DocumentCanAccessDocument(active, target);
40 PP_Var GetDocumentURL(PP_Instance instance,
41 PP_URLComponents_Dev* components) {
42 EnterInstance enter(instance);
43 if (enter.failed())
44 return PP_MakeUndefined();
45 return enter.functions()->GetDocumentURL(instance, components);
48 PP_Var GetPluginInstanceURL(PP_Instance instance,
49 PP_URLComponents_Dev* components) {
50 EnterInstance enter(instance);
51 if (enter.failed())
52 return PP_MakeUndefined();
53 return enter.functions()->GetPluginInstanceURL(instance, components);
56 const PPB_URLUtil_Dev g_ppb_url_util = {
57 &PPB_URLUtil_Shared::Canonicalize,
58 &PPB_URLUtil_Shared::ResolveRelativeToURL,
59 &ResolveRelativeToDocument,
60 &PPB_URLUtil_Shared::IsSameSecurityOrigin,
61 &DocumentCanRequest,
62 &DocumentCanAccessDocument,
63 &GetDocumentURL,
64 &GetPluginInstanceURL
67 } // namespace
69 const PPB_URLUtil_Dev_0_6* GetPPB_URLUtil_Dev_0_6_Thunk() {
70 return &g_ppb_url_util;
73 } // namespace thunk
74 } // namespace ppapi