OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/renderer/scoped_web_frame.h" | 5 #include "extensions/renderer/scoped_web_frame.h" |
6 | 6 |
7 #include "third_party/WebKit/public/web/WebHeap.h" | 7 #include "third_party/WebKit/public/web/WebHeap.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
11 ScopedWebFrame::ScopedWebFrame() : view_(nullptr), frame_(nullptr) { | 11 ScopedWebFrame::ScopedWebFrame() : view_(nullptr), frame_(nullptr) { |
12 view_ = blink::WebView::create(nullptr); | 12 view_ = blink::WebView::create(nullptr, true); |
13 frame_ = blink::WebLocalFrame::create( | 13 frame_ = blink::WebLocalFrame::create( |
14 blink::WebTreeScopeType::Document, nullptr); | 14 blink::WebTreeScopeType::Document, nullptr); |
15 view_->setMainFrame(frame_); | 15 view_->setMainFrame(frame_); |
16 } | 16 } |
17 | 17 |
18 ScopedWebFrame::~ScopedWebFrame() { | 18 ScopedWebFrame::~ScopedWebFrame() { |
19 view_->close(); | 19 view_->close(); |
20 frame_->close(); | 20 frame_->close(); |
21 blink::WebHeap::collectAllGarbageForTesting(); | 21 blink::WebHeap::collectAllGarbageForTesting(); |
22 } | 22 } |
23 | 23 |
24 } // namespace extensions | 24 } // namespace extensions |
OLD | NEW |