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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 2601773002: WindowProxy::initialize should never return null (Closed)
Patch Set: temp Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
index 327a437a5250d32df749a9890e7cecdb5a0569c2..1a2c2bccc9faae9d6719b449bd03ebb5173cbb3d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -218,14 +218,13 @@ void WindowProxy::setGlobal(v8::Local<v8::Object> global) {
// the frame. However, a new inner window is created for the new page.
// If there are JS code holds a closure to the old inner window,
// it won't be able to reach the outer window via its global object.
-bool WindowProxy::initializeIfNeeded() {
+void WindowProxy::initializeIfNeeded() {
if (isContextInitialized())
- return true;
-
- return initialize();
+ return;
+ initialize();
}
-bool WindowProxy::initialize() {
+void WindowProxy::initialize() {
TRACE_EVENT1("v8", "WindowProxy::initialize", "isMainWindow",
m_frame->isMainFrame());
SCOPED_BLINK_UMA_HISTOGRAM_TIMER(
@@ -237,24 +236,16 @@ bool WindowProxy::initialize() {
v8::HandleScope handleScope(m_isolate);
createContext();
-
- if (!isContextInitialized())
- return false;
+ CHECK(isContextInitialized());
haraken 2016/12/27 15:15:40 isContextInitialized() should return true here bec
ScriptState::Scope scope(m_scriptState.get());
v8::Local<v8::Context> context = m_scriptState->context();
if (m_globalProxy.isEmpty()) {
m_globalProxy.set(m_isolate, context->Global());
- if (m_globalProxy.isEmpty()) {
- disposeContext(DoNotDetachGlobal);
- return false;
- }
+ CHECK(!m_globalProxy.isEmpty());
haraken 2016/12/27 15:15:40 Unless V8 hits OOM or stack-overflow, m_globalProx
}
- if (!setupWindowPrototypeChain()) {
- disposeContext(DoNotDetachGlobal);
- return false;
- }
+ setupWindowPrototypeChain();
haraken 2016/12/27 15:15:40 setupWindowPrototypeChain() never returns false.
SecurityOrigin* origin = 0;
if (m_world->isMainWorld()) {
@@ -286,8 +277,6 @@ bool WindowProxy::initialize() {
if (m_world->isMainWorld()) {
installPendingConditionalFeaturesOnWindow(m_scriptState.get());
}
-
- return true;
}
void WindowProxy::createContext() {
@@ -335,7 +324,7 @@ void WindowProxy::createContext() {
m_scriptState = ScriptState::create(context, m_world);
}
-bool WindowProxy::setupWindowPrototypeChain() {
+void WindowProxy::setupWindowPrototypeChain() {
// Associate the window wrapper object and its prototype chain with the
// corresponding native DOMWindow object.
// The full structure of the global object's prototype chain is as follows:
@@ -400,7 +389,6 @@ bool WindowProxy::setupWindowPrototypeChain() {
// PagePopupController in another way.
V8PagePopupControllerBinding::installPagePopupController(context,
windowWrapper);
- return true;
}
void WindowProxy::updateDocumentProperty() {
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698