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

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

Issue 2808093002: v8binding: Removes WindowProxy::GlobalDetachmentBehavior. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
index 0f2ceff6f2ad30158dac9ed1b4bfca8dd269a320..bf10fc7e30a1b85b215487a2c3430d0a0857a05c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
@@ -64,7 +64,10 @@
namespace blink {
-void LocalWindowProxy::DisposeContext(GlobalDetachmentBehavior behavior) {
+void LocalWindowProxy::DisposeContext(Lifecycle next_status) {
+ DCHECK(next_status == Lifecycle::kGlobalObjectIsDetached ||
+ next_status == Lifecycle::kFrameIsDetached);
+
if (lifecycle_ != Lifecycle::kContextIsInitialized)
return;
@@ -77,7 +80,7 @@ void LocalWindowProxy::DisposeContext(GlobalDetachmentBehavior behavior) {
world_->GetWorldId());
MainThreadDebugger::Instance()->ContextWillBeDestroyed(script_state_.Get());
- if (behavior == kDetachGlobal) {
+ if (next_status == Lifecycle::kGlobalObjectIsDetached) {
v8::Local<v8::Context> context = script_state_->GetContext();
// Clean up state on the global proxy, which will be reused.
if (!global_proxy_.IsEmpty()) {
@@ -104,8 +107,7 @@ void LocalWindowProxy::DisposeContext(GlobalDetachmentBehavior behavior) {
GetFrame()->IsMainFrame());
DCHECK_EQ(lifecycle_, Lifecycle::kContextIsInitialized);
- lifecycle_ = behavior == kDetachGlobal ? Lifecycle::kGlobalObjectIsDetached
- : Lifecycle::kFrameIsDetached;
+ lifecycle_ = next_status;
}
void LocalWindowProxy::Initialize() {

Powered by Google App Engine
This is Rietveld 408576698