OLD | NEW |
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 Loading... |
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 // clearForClose() or clearForNavigation() must be invoked before destructio
n starts. |
| 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 Loading... |
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 |
OLD | NEW |