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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PagePopupControllerBinding.cpp

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/V8PagePopupControllerBinding.h" 5 #include "bindings/core/v8/V8PagePopupControllerBinding.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "bindings/core/v8/V8Window.h" 8 #include "bindings/core/v8/V8Window.h"
9 #include "core/dom/ContextFeatures.h" 9 #include "core/dom/ContextFeatures.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
11 #include "core/dom/ExecutionContext.h" 11 #include "core/dom/ExecutionContext.h"
12 #include "core/page/DOMWindowPagePopup.h"
13 #include "core/page/PagePopupController.h" 12 #include "core/page/PagePopupController.h"
13 #include "core/page/PagePopupSupplement.h"
14 #include "platform/TraceEvent.h" 14 #include "platform/TraceEvent.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 namespace { 18 namespace {
19 19
20 void pagePopupControllerAttributeGetter(const v8::PropertyCallbackInfo<v8::Value >& info) 20 void pagePopupControllerAttributeGetter(const v8::PropertyCallbackInfo<v8::Value >& info)
21 { 21 {
22 v8::Local<v8::Object> holder = info.Holder(); 22 v8::Local<v8::Object> holder = info.Holder();
23 DOMWindow* impl = V8Window::toImpl(holder); 23 DOMWindow* impl = V8Window::toImpl(holder);
24 RefPtrWillBeRawPtr<PagePopupController> cppValue(DOMWindowPagePopup::pagePop upController(*impl)); 24 RefPtrWillBeRawPtr<PagePopupController> cppValue(PagePopupSupplement::pagePo pupController(*toLocalDOMWindow(impl)->frame()));
25 v8SetReturnValue(info, toV8(cppValue.get(), holder, info.GetIsolate())); 25 v8SetReturnValue(info, toV8(cppValue.get(), holder, info.GetIsolate()));
26 } 26 }
27 27
28 void pagePopupControllerAttributeGetterCallback(v8::Local<v8::Name>, const v8::P ropertyCallbackInfo<v8::Value>& info) 28 void pagePopupControllerAttributeGetterCallback(v8::Local<v8::Name>, const v8::P ropertyCallbackInfo<v8::Value>& info)
29 { 29 {
30 pagePopupControllerAttributeGetter(info); 30 pagePopupControllerAttributeGetter(info);
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 34
35 void V8PagePopupControllerBinding::installPagePopupController(v8::Local<v8::Cont ext> context, v8::Local<v8::Object> windowWrapper) 35 void V8PagePopupControllerBinding::installPagePopupController(v8::Local<v8::Cont ext> context, v8::Local<v8::Object> windowWrapper)
36 { 36 {
37 ExecutionContext* executionContext = toExecutionContext(windowWrapper->Creat ionContext()); 37 ExecutionContext* executionContext = toExecutionContext(windowWrapper->Creat ionContext());
38 if (!(executionContext && executionContext->isDocument() 38 if (!(executionContext && executionContext->isDocument()
39 && ContextFeatures::pagePopupEnabled(toDocument(executionContext)))) 39 && ContextFeatures::pagePopupEnabled(toDocument(executionContext))))
40 return; 40 return;
41 41
42 windowWrapper->SetAccessor( 42 windowWrapper->SetAccessor(
43 context, 43 context,
44 v8AtomicString(context->GetIsolate(), "pagePopupController"), 44 v8AtomicString(context->GetIsolate(), "pagePopupController"),
45 pagePopupControllerAttributeGetterCallback); 45 pagePopupControllerAttributeGetterCallback);
46 } 46 }
47 47
48 } // namespace blink 48 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698