/src/mozilla-central/dom/base/ContentFrameMessageManager.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "ContentFrameMessageManager.h" |
8 | | #include "js/RootingAPI.h" |
9 | | #include "mozilla/dom/ScriptSettings.h" |
10 | | |
11 | | using namespace mozilla; |
12 | | using namespace mozilla::dom; |
13 | | |
14 | | JSObject* |
15 | | ContentFrameMessageManager::GetOrCreateWrapper() |
16 | 0 | { |
17 | 0 | JS::RootedValue val(RootingCx()); |
18 | 0 | { |
19 | 0 | // Scope to run ~AutoJSAPI before working with a raw JSObject*. |
20 | 0 | AutoJSAPI jsapi; |
21 | 0 | jsapi.Init(); |
22 | 0 |
|
23 | 0 | if (!GetOrCreateDOMReflectorNoWrap(jsapi.cx(), this, &val)) { |
24 | 0 | return nullptr; |
25 | 0 | } |
26 | 0 | } |
27 | 0 | MOZ_ASSERT(val.isObject()); |
28 | 0 | return &val.toObject(); |
29 | 0 | } |