KHtml

kjs_data.h
1 /*
2  * This includes methods for marshalling/demarshalling data for
3  * cross-context messaging
4  *
5  * Copyright (C) 2010 Maksim Orlovich <[email protected]>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #include "kjs_binding.h"
22 #include "kjs_window.h"
23 #include "xml/dom2_eventsimpl.h"
24 
25 class KHTMLPart;
26 
27 #include <QWeakPointer>
28 
29 namespace KJS
30 {
31 
32 /*
33  Deep copy of data; no guarantees are made about the domain of the result;
34  just that it's distinct from the original. You're expected to use
35  encapsulateMessageEventData on the result to associate it with the
36  appropriate security domain.
37 */
38 JSValue *cloneData(ExecState *exec, JSValue *data);
39 
40 /*
41  Note: unlike other JS->DOM routines, this method is expected to cross security
42  domains; hence besides current ExecState (needed to set exceptions) it needs
43  the *destination* domain, to make sure everything created uses prototypes
44  from it. It can also return 0 if the serialization failed; in which case an
45  exception will also be set.
46 */
47 DOM::MessageEventImpl::Data *encapsulateMessageEventData(ExecState *exec, Interpreter *ctx, JSValue *data);
48 
49 /*
50  Warning: Unlike the above, this accessor isn't expected to cross boundaries,
51  so it doesn't do any deep copying or the like
52  */
53 JSValue *getMessageEventData(ExecState *exec, DOM::MessageEventImpl::Data *data);
54 
55 /*
56  Actually executes Window::PostMessage with given arguments;
57  targetOrigin is expected to have been sanity-checked already
58 */
59 class DelayedPostMessage: public Window::DelayedAction
60 {
61 public:
62  DelayedPostMessage(KHTMLPart *source, const QString &_sourceOrigin, const QString &_targetOrigin, JSValue *_payload);
63 
64  void mark() override;
65  bool execute(Window *) override;
66 private:
67  QString sourceOrigin;
68  QString targetOrigin;
69  ProtectedPtr<JSValue> payload;
71 };
72 
73 }
74 
This class is khtml&#39;s main class.
Definition: khtml_part.h:208
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.