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

Side by Side Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 627933002: Oilpan: move ScriptController+WindowProxy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Non-Oilpan compile fix Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include <v8.h> 67 #include <v8.h>
68 68
69 namespace blink { 69 namespace blink {
70 70
71 static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* docum ent) 71 static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* docum ent)
72 { 72 {
73 ASSERT(V8Document::toImpl(wrapper) == document); 73 ASSERT(V8Document::toImpl(wrapper) == document);
74 ASSERT(!document->isHTMLDocument() || (V8Document::toImpl(v8::Handle<v8::Obj ect>::Cast(wrapper->GetPrototype())) == document)); 74 ASSERT(!document->isHTMLDocument() || (V8Document::toImpl(v8::Handle<v8::Obj ect>::Cast(wrapper->GetPrototype())) == document));
75 } 75 }
76 76
77 PassOwnPtr<WindowProxy> WindowProxy::create(LocalFrame* frame, DOMWrapperWorld& world, v8::Isolate* isolate) 77 PassOwnPtrWillBeRawPtr<WindowProxy> WindowProxy::create(LocalFrame* frame, DOMWr apperWorld& world, v8::Isolate* isolate)
78 { 78 {
79 return adoptPtr(new WindowProxy(frame, &world, isolate)); 79 return adoptPtrWillBeNoop(new WindowProxy(frame, &world, isolate));
80 } 80 }
81 81
82 WindowProxy::WindowProxy(LocalFrame* frame, PassRefPtr<DOMWrapperWorld> world, v 8::Isolate* isolate) 82 WindowProxy::WindowProxy(LocalFrame* frame, PassRefPtr<DOMWrapperWorld> world, v 8::Isolate* isolate)
83 : m_frame(frame) 83 : m_frame(frame)
84 , m_isolate(isolate) 84 , m_isolate(isolate)
85 , m_world(world) 85 , m_world(world)
86 { 86 {
87 } 87 }
88 88
89 WindowProxy::~WindowProxy()
90 {
91 // WindowProxy::clearForClose() must be invoked before destruction starts.
haraken 2014/10/05 23:37:26 WindowProxy::clearForClose() => WindowProxy::clear
sof 2014/10/06 07:34:40 Thanks, updated.
92 ASSERT(!isContextInitialized());
93 }
94
95 void WindowProxy::trace(Visitor* visitor)
96 {
97 visitor->trace(m_frame);
98 }
99
89 void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) 100 void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior)
90 { 101 {
91 if (!isContextInitialized()) 102 if (!isContextInitialized())
92 return; 103 return;
93 104
94 v8::HandleScope handleScope(m_isolate); 105 v8::HandleScope handleScope(m_isolate);
95 v8::Handle<v8::Context> context = m_scriptState->context(); 106 v8::Handle<v8::Context> context = m_scriptState->context();
96 m_frame->loader().client()->willReleaseScriptContext(context, m_world->world Id()); 107 m_frame->loader().client()->willReleaseScriptContext(context, m_world->world Id());
97 108
98 if (behavior == DetachGlobal) 109 if (behavior == DetachGlobal)
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 495
485 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 496 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
486 { 497 {
487 ASSERT(m_world->isMainWorld()); 498 ASSERT(m_world->isMainWorld());
488 if (!isContextInitialized()) 499 if (!isContextInitialized())
489 return; 500 return;
490 setSecurityToken(origin); 501 setSecurityToken(origin);
491 } 502 }
492 503
493 } // namespace blink 504 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698