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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2773003002: Make the WebWidgetClient parameter a ref so it's not legal to pass a nullptr. (Closed)
Patch Set: WebViewClient dtor now overrides the virtual dtor in WebWidgetClient. Created 3 years, 9 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
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "wtf/AutoReset.h" 75 #include "wtf/AutoReset.h"
76 #include "wtf/PtrUtil.h" 76 #include "wtf/PtrUtil.h"
77 #include <memory> 77 #include <memory>
78 78
79 namespace blink { 79 namespace blink {
80 80
81 // WebFrameWidget ------------------------------------------------------------ 81 // WebFrameWidget ------------------------------------------------------------
82 82
83 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, 83 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client,
84 WebLocalFrame* localRoot) { 84 WebLocalFrame* localRoot) {
85 DCHECK(client) << "A valid WebWidgetClient must be supplied.";
85 // Pass the WebFrameWidget's self-reference to the caller. 86 // Pass the WebFrameWidget's self-reference to the caller.
86 return WebFrameWidgetImpl::create(client, localRoot); 87 return WebFrameWidgetImpl::create(client, localRoot);
87 } 88 }
88 89
89 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, 90 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client,
90 WebView* webView, 91 WebView* webView,
91 WebLocalFrame* mainFrame) { 92 WebLocalFrame* mainFrame) {
92 return new WebViewFrameWidget(client, toWebViewImpl(*webView), 93 DCHECK(client) << "A valid WebWidgetClient must be supplied.";
94 return new WebViewFrameWidget(*client, toWebViewImpl(*webView),
93 toWebLocalFrameImpl(*mainFrame)); 95 toWebLocalFrameImpl(*mainFrame));
94 } 96 }
95 97
96 WebFrameWidgetImpl* WebFrameWidgetImpl::create(WebWidgetClient* client, 98 WebFrameWidgetImpl* WebFrameWidgetImpl::create(WebWidgetClient* client,
97 WebLocalFrame* localRoot) { 99 WebLocalFrame* localRoot) {
100 DCHECK(client) << "A valid WebWidgetClient must be supplied.";
98 // Pass the WebFrameWidgetImpl's self-reference to the caller. 101 // Pass the WebFrameWidgetImpl's self-reference to the caller.
99 return new WebFrameWidgetImpl( 102 return new WebFrameWidgetImpl(
100 client, localRoot); // SelfKeepAlive is set in constructor. 103 client, localRoot); // SelfKeepAlive is set in constructor.
101 } 104 }
102 105
103 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, 106 WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client,
104 WebLocalFrame* localRoot) 107 WebLocalFrame* localRoot)
105 : m_client(client), 108 : m_client(client),
106 m_localRoot(toWebLocalFrameImpl(localRoot)), 109 m_localRoot(toWebLocalFrameImpl(localRoot)),
107 m_mutator(nullptr), 110 m_mutator(nullptr),
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 return nullptr; 1141 return nullptr;
1139 } 1142 }
1140 1143
1141 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1144 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1142 if (!m_imeAcceptEvents) 1145 if (!m_imeAcceptEvents)
1143 return nullptr; 1146 return nullptr;
1144 return focusedLocalFrameInWidget(); 1147 return focusedLocalFrameInWidget();
1145 } 1148 }
1146 1149
1147 } // namespace blink 1150 } // namespace blink
OLDNEW
« no previous file with comments | « content/shell/test_runner/web_widget_test_client.h ('k') | third_party/WebKit/Source/web/WebViewFrameWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698