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

Side by Side Diff: extensions/renderer/scoped_web_frame.h

Issue 1210513002: ScriptContextSetTest should close the main frame before finishing the test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SCOPED_WEB_FRAME_H_
6 #define SCOPED_WEB_FRAME_H_
7
8 #include "third_party/WebKit/public/web/WebFrame.h"
9 #include "third_party/WebKit/public/web/WebHeap.h"
10 #include "third_party/WebKit/public/web/WebLocalFrame.h"
11 #include "third_party/WebKit/public/web/WebView.h"
12
13 namespace extensions {
14
15 class ScopedWebFrame {
not at google - send to devlin 2015/06/25 15:20:16 This should be split into a .h and a .cc file. The
haraken 2015/06/26 00:35:34 Done.
16 public:
17 ScopedWebFrame() : view_(nullptr), frame_(nullptr) {
18 view_ = blink::WebView::create(nullptr);
19 frame_ = blink::WebLocalFrame::create(
20 blink::WebTreeScopeType::Document, nullptr);
21 view_->setMainFrame(frame_);
22 }
23
24 ~ScopedWebFrame() {
25 view_->close();
26 frame_->close();
27 blink::WebHeap::collectAllGarbageForTesting();
28 }
29
30 blink::WebLocalFrame* frame() { return frame_; }
31
32 private:
33 blink::WebView* view_;
not at google - send to devlin 2015/06/25 15:20:16 Is there a comment here you could make about the l
haraken 2015/06/26 00:35:34 Added a comment. It's not nice that the content la
34 blink::WebLocalFrame* frame_;
not at google - send to devlin 2015/06/25 15:20:16 Also DISALLOW_COPY_AND_ASSIGN.
haraken 2015/06/26 00:35:34 Done.
35 };
36
37 } // namespace extensions
38
39 #endif // SCOPED_WEB_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698