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

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

Issue 2723973002: Make V8Binding helpers return LocalFrame/LocalDOMWindow as appropriate (Closed)
Patch Set: Created 3 years, 10 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/V8Binding.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
index 0ccf6f2bea17d3dae699317ce7d50db252d5a6a6..78703fc560fa5b976c097b0bfb8b2bd996614495 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -717,15 +717,15 @@ DOMWindow* toDOMWindow(v8::Isolate* isolate, v8::Local<v8::Value> value) {
return 0;
}
-DOMWindow* toDOMWindow(v8::Local<v8::Context> context) {
+LocalDOMWindow* toDOMWindow(v8::Local<v8::Context> context) {
if (context.IsEmpty())
return 0;
- return toDOMWindow(context->GetIsolate(), context->Global());
+ return toLocalDOMWindow(
+ toDOMWindow(context->GetIsolate(), context->Global()));
}
LocalDOMWindow* enteredDOMWindow(v8::Isolate* isolate) {
- LocalDOMWindow* window =
- toLocalDOMWindow(toDOMWindow(isolate->GetEnteredContext()));
+ LocalDOMWindow* window = toDOMWindow(isolate->GetEnteredContext());
if (!window) {
// We don't always have an entered DOM window, for example during microtask
// callbacks from V8 (where the entered context may be the DOM-in-JS
@@ -741,7 +741,7 @@ LocalDOMWindow* enteredDOMWindow(v8::Isolate* isolate) {
}
LocalDOMWindow* currentDOMWindow(v8::Isolate* isolate) {
- return toLocalDOMWindow(toDOMWindow(isolate->GetCurrentContext()));
+ return toDOMWindow(isolate->GetCurrentContext());
}
ExecutionContext* toExecutionContext(v8::Local<v8::Context> context) {
@@ -770,8 +770,8 @@ ExecutionContext* currentExecutionContext(v8::Isolate* isolate) {
return toExecutionContext(isolate->GetCurrentContext());
}
-Frame* toFrameIfNotDetached(v8::Local<v8::Context> context) {
- DOMWindow* window = toDOMWindow(context);
+LocalFrame* toFrameIfNotDetached(v8::Local<v8::Context> context) {
+ LocalDOMWindow* window = toDOMWindow(context);
if (window && window->isCurrentlyDisplayedInFrame())
return window->frame();
// We return 0 here because |context| is detached from the Frame. If we

Powered by Google App Engine
This is Rietveld 408576698