OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // FIXME: There is a lot of duplication with SetTimeoutOrInterval() in V8WorkerG
lobalScopeCustom.cpp. | 71 // FIXME: There is a lot of duplication with SetTimeoutOrInterval() in V8WorkerG
lobalScopeCustom.cpp. |
72 // We should refactor this. | 72 // We should refactor this. |
73 static void windowSetTimeoutImpl(const v8::FunctionCallbackInfo<v8::Value>& info
, bool singleShot, ExceptionState& exceptionState) | 73 static void windowSetTimeoutImpl(const v8::FunctionCallbackInfo<v8::Value>& info
, bool singleShot, ExceptionState& exceptionState) |
74 { | 74 { |
75 int argumentCount = info.Length(); | 75 int argumentCount = info.Length(); |
76 | 76 |
77 if (argumentCount < 1) | 77 if (argumentCount < 1) |
78 return; | 78 return; |
79 | 79 |
80 LocalDOMWindow* impl = V8Window::toNative(info.Holder()); | 80 LocalDOMWindow* impl = V8Window::toImpl(info.Holder()); |
81 if (!impl->frame() || !impl->document()) { | 81 if (!impl->frame() || !impl->document()) { |
82 exceptionState.throwDOMException(InvalidAccessError, "No script context
is available in which to execute the script."); | 82 exceptionState.throwDOMException(InvalidAccessError, "No script context
is available in which to execute the script."); |
83 return; | 83 return; |
84 } | 84 } |
85 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 85 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
86 v8::Handle<v8::Value> function = info[0]; | 86 v8::Handle<v8::Value> function = info[0]; |
87 String functionString; | 87 String functionString; |
88 if (!function->IsFunction()) { | 88 if (!function->IsFunction()) { |
89 if (function->IsString()) { | 89 if (function->IsString()) { |
90 functionString = toCoreString(function.As<v8::String>()); | 90 functionString = toCoreString(function.As<v8::String>()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 if (timeout >= 0) { | 143 if (timeout >= 0) { |
144 double maximumFireInterval = static_cast<double>(timeout) / 1000 / 2; | 144 double maximumFireInterval = static_cast<double>(timeout) / 1000 / 2; |
145 V8GCForContextDispose::instanceTemplate().notifyIdleSooner(maximumFireIn
terval); | 145 V8GCForContextDispose::instanceTemplate().notifyIdleSooner(maximumFireIn
terval); |
146 } | 146 } |
147 | 147 |
148 v8SetReturnValue(info, timerId); | 148 v8SetReturnValue(info, timerId); |
149 } | 149 } |
150 | 150 |
151 void V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 151 void V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
152 { | 152 { |
153 LocalFrame* frame = V8Window::toNative(info.Holder())->frame(); | 153 LocalFrame* frame = V8Window::toImpl(info.Holder())->frame(); |
154 ExceptionState exceptionState(ExceptionState::GetterContext, "event", "Windo
w", info.Holder(), info.GetIsolate()); | 154 ExceptionState exceptionState(ExceptionState::GetterContext, "event", "Windo
w", info.Holder(), info.GetIsolate()); |
155 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame, exc
eptionState)) { | 155 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame, exc
eptionState)) { |
156 exceptionState.throwIfNeeded(); | 156 exceptionState.throwIfNeeded(); |
157 return; | 157 return; |
158 } | 158 } |
159 | 159 |
160 ASSERT(frame); | 160 ASSERT(frame); |
161 // This is a fast path to retrieve info.Holder()->CreationContext(). | 161 // This is a fast path to retrieve info.Holder()->CreationContext(). |
162 v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current
(info.GetIsolate())); | 162 v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current
(info.GetIsolate())); |
163 if (context.IsEmpty()) | 163 if (context.IsEmpty()) |
164 return; | 164 return; |
165 | 165 |
166 v8::Handle<v8::Value> jsEvent = V8HiddenValue::getHiddenValue(info.GetIsolat
e(), context->Global(), V8HiddenValue::event(info.GetIsolate())); | 166 v8::Handle<v8::Value> jsEvent = V8HiddenValue::getHiddenValue(info.GetIsolat
e(), context->Global(), V8HiddenValue::event(info.GetIsolate())); |
167 if (jsEvent.IsEmpty()) | 167 if (jsEvent.IsEmpty()) |
168 return; | 168 return; |
169 v8SetReturnValue(info, jsEvent); | 169 v8SetReturnValue(info, jsEvent); |
170 } | 170 } |
171 | 171 |
172 void V8Window::eventAttributeSetterCustom(v8::Local<v8::Value> value, const v8::
PropertyCallbackInfo<void>& info) | 172 void V8Window::eventAttributeSetterCustom(v8::Local<v8::Value> value, const v8::
PropertyCallbackInfo<void>& info) |
173 { | 173 { |
174 LocalFrame* frame = V8Window::toNative(info.Holder())->frame(); | 174 LocalFrame* frame = V8Window::toImpl(info.Holder())->frame(); |
175 ExceptionState exceptionState(ExceptionState::SetterContext, "event", "Windo
w", info.Holder(), info.GetIsolate()); | 175 ExceptionState exceptionState(ExceptionState::SetterContext, "event", "Windo
w", info.Holder(), info.GetIsolate()); |
176 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame, exc
eptionState)) { | 176 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame, exc
eptionState)) { |
177 exceptionState.throwIfNeeded(); | 177 exceptionState.throwIfNeeded(); |
178 return; | 178 return; |
179 } | 179 } |
180 | 180 |
181 ASSERT(frame); | 181 ASSERT(frame); |
182 // This is a fast path to retrieve info.Holder()->CreationContext(). | 182 // This is a fast path to retrieve info.Holder()->CreationContext(). |
183 v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current
(info.GetIsolate())); | 183 v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current
(info.GetIsolate())); |
184 if (context.IsEmpty()) | 184 if (context.IsEmpty()) |
185 return; | 185 return; |
186 | 186 |
187 V8HiddenValue::setHiddenValue(info.GetIsolate(), context->Global(), V8Hidden
Value::event(info.GetIsolate()), value); | 187 V8HiddenValue::setHiddenValue(info.GetIsolate(), context->Global(), V8Hidden
Value::event(info.GetIsolate()), value); |
188 } | 188 } |
189 | 189 |
190 void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<
v8::Value>& info) | 190 void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<
v8::Value>& info) |
191 { | 191 { |
192 LocalDOMWindow* impl = V8Window::toNative(info.Holder()); | 192 LocalDOMWindow* impl = V8Window::toImpl(info.Holder()); |
193 ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Windo
w", info.Holder(), info.GetIsolate()); | 193 ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Windo
w", info.Holder(), info.GetIsolate()); |
194 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->frame
Element(), exceptionState)) { | 194 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->frame
Element(), exceptionState)) { |
195 v8SetReturnValueNull(info); | 195 v8SetReturnValueNull(info); |
196 exceptionState.throwIfNeeded(); | 196 exceptionState.throwIfNeeded(); |
197 return; | 197 return; |
198 } | 198 } |
199 | 199 |
200 // The wrapper for an <iframe> should get its prototype from the context of
the frame it's in, rather than its own frame. | 200 // The wrapper for an <iframe> should get its prototype from the context of
the frame it's in, rather than its own frame. |
201 // So, use its containing document as the creation context when wrapping. | 201 // So, use its containing document as the creation context when wrapping. |
202 v8::Handle<v8::Value> creationContext = toV8(&impl->frameElement()->document
(), info.Holder(), info.GetIsolate()); | 202 v8::Handle<v8::Value> creationContext = toV8(&impl->frameElement()->document
(), info.Holder(), info.GetIsolate()); |
203 RELEASE_ASSERT(!creationContext.IsEmpty()); | 203 RELEASE_ASSERT(!creationContext.IsEmpty()); |
204 v8::Handle<v8::Value> wrapper = toV8(impl->frameElement(), v8::Handle<v8::Ob
ject>::Cast(creationContext), info.GetIsolate()); | 204 v8::Handle<v8::Value> wrapper = toV8(impl->frameElement(), v8::Handle<v8::Ob
ject>::Cast(creationContext), info.GetIsolate()); |
205 v8SetReturnValue(info, wrapper); | 205 v8SetReturnValue(info, wrapper); |
206 } | 206 } |
207 | 207 |
208 void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8:
:PropertyCallbackInfo<void>& info) | 208 void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8:
:PropertyCallbackInfo<void>& info) |
209 { | 209 { |
210 LocalDOMWindow* impl = V8Window::toNative(info.Holder()); | 210 LocalDOMWindow* impl = V8Window::toImpl(info.Holder()); |
211 ExceptionState exceptionState(ExceptionState::SetterContext, "opener", "Wind
ow", info.Holder(), info.GetIsolate()); | 211 ExceptionState exceptionState(ExceptionState::SetterContext, "opener", "Wind
ow", info.Holder(), info.GetIsolate()); |
212 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 212 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
213 exceptionState.throwIfNeeded(); | 213 exceptionState.throwIfNeeded(); |
214 return; | 214 return; |
215 } | 215 } |
216 | 216 |
217 // Opener can be shadowed if it is in the same domain. | 217 // Opener can be shadowed if it is in the same domain. |
218 // Have a special handling of null value to behave | 218 // Have a special handling of null value to behave |
219 // like Firefox. See bug http://b/1224887 & http://b/791706. | 219 // like Firefox. See bug http://b/1224887 & http://b/791706. |
220 if (value->IsNull()) { | 220 if (value->IsNull()) { |
(...skipping 16 matching lines...) Expand all Loading... |
237 if (value->IsString() || value->IsStringObject()) | 237 if (value->IsString() || value->IsStringObject()) |
238 return true; | 238 return true; |
239 return false; | 239 return false; |
240 } | 240 } |
241 | 241 |
242 | 242 |
243 void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>
& info) | 243 void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>
& info) |
244 { | 244 { |
245 // None of these need to be RefPtr because info and context are guaranteed | 245 // None of these need to be RefPtr because info and context are guaranteed |
246 // to hold on to them. | 246 // to hold on to them. |
247 LocalDOMWindow* window = V8Window::toNative(info.Holder()); | 247 LocalDOMWindow* window = V8Window::toImpl(info.Holder()); |
248 LocalDOMWindow* source = callingDOMWindow(info.GetIsolate()); | 248 LocalDOMWindow* source = callingDOMWindow(info.GetIsolate()); |
249 | 249 |
250 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", "Window", info.Holder(), info.GetIsolate()); | 250 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", "Window", info.Holder(), info.GetIsolate()); |
251 | 251 |
252 // If called directly by WebCore we don't have a calling context. | 252 // If called directly by WebCore we don't have a calling context. |
253 if (!source) { | 253 if (!source) { |
254 exceptionState.throwTypeError("No active calling context exists."); | 254 exceptionState.throwTypeError("No active calling context exists."); |
255 exceptionState.throwIfNeeded(); | 255 exceptionState.throwIfNeeded(); |
256 return; | 256 return; |
257 } | 257 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return handleScope.Escape(returnValue); | 345 return handleScope.Escape(returnValue); |
346 } | 346 } |
347 | 347 |
348 static void setUpDialog(LocalDOMWindow* dialog, void* handler) | 348 static void setUpDialog(LocalDOMWindow* dialog, void* handler) |
349 { | 349 { |
350 static_cast<DialogHandler*>(handler)->dialogCreated(dialog); | 350 static_cast<DialogHandler*>(handler)->dialogCreated(dialog); |
351 } | 351 } |
352 | 352 |
353 void V8Window::showModalDialogMethodCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 353 void V8Window::showModalDialogMethodCustom(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
354 { | 354 { |
355 LocalDOMWindow* impl = V8Window::toNative(info.Holder()); | 355 LocalDOMWindow* impl = V8Window::toImpl(info.Holder()); |
356 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showModalDi
alog", "Window", info.Holder(), info.GetIsolate()); | 356 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showModalDi
alog", "Window", info.Holder(), info.GetIsolate()); |
357 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 357 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
358 exceptionState.throwIfNeeded(); | 358 exceptionState.throwIfNeeded(); |
359 return; | 359 return; |
360 } | 360 } |
361 | 361 |
362 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, urlString
, info[0]); | 362 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, urlString
, info[0]); |
363 DialogHandler handler(info[1], ScriptState::current(info.GetIsolate())); | 363 DialogHandler handler(info[1], ScriptState::current(info.GetIsolate())); |
364 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, dialogFea
turesString, info[2]); | 364 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, dialogFea
turesString, info[2]); |
365 | 365 |
366 impl->showModalDialog(urlString, dialogFeaturesString, callingDOMWindow(info
.GetIsolate()), enteredDOMWindow(info.GetIsolate()), setUpDialog, &handler); | 366 impl->showModalDialog(urlString, dialogFeaturesString, callingDOMWindow(info
.GetIsolate()), enteredDOMWindow(info.GetIsolate()), setUpDialog, &handler); |
367 | 367 |
368 v8SetReturnValue(info, handler.returnValue()); | 368 v8SetReturnValue(info, handler.returnValue()); |
369 } | 369 } |
370 | 370 |
371 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) | 371 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
372 { | 372 { |
373 LocalDOMWindow* impl = V8Window::toNative(info.Holder()); | 373 LocalDOMWindow* impl = V8Window::toImpl(info.Holder()); |
374 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Win
dow", info.Holder(), info.GetIsolate()); | 374 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Win
dow", info.Holder(), info.GetIsolate()); |
375 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 375 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
376 exceptionState.throwIfNeeded(); | 376 exceptionState.throwIfNeeded(); |
377 return; | 377 return; |
378 } | 378 } |
379 | 379 |
380 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, urlString
, info[0]); | 380 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, urlString
, info[0]); |
381 AtomicString frameName; | 381 AtomicString frameName; |
382 if (info[1]->IsUndefined() || info[1]->IsNull()) { | 382 if (info[1]->IsUndefined() || info[1]->IsNull()) { |
383 frameName = "_blank"; | 383 frameName = "_blank"; |
384 } else { | 384 } else { |
385 TOSTRING_VOID(V8StringResource<>, frameNameResource, info[1]); | 385 TOSTRING_VOID(V8StringResource<>, frameNameResource, info[1]); |
386 frameName = frameNameResource; | 386 frameName = frameNameResource; |
387 } | 387 } |
388 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, windowFea
turesString, info[2]); | 388 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, windowFea
turesString, info[2]); |
389 | 389 |
390 RefPtrWillBeRawPtr<LocalDOMWindow> openedWindow = impl->open(urlString, fram
eName, windowFeaturesString, callingDOMWindow(info.GetIsolate()), enteredDOMWind
ow(info.GetIsolate())); | 390 RefPtrWillBeRawPtr<LocalDOMWindow> openedWindow = impl->open(urlString, fram
eName, windowFeaturesString, callingDOMWindow(info.GetIsolate()), enteredDOMWind
ow(info.GetIsolate())); |
391 if (!openedWindow) | 391 if (!openedWindow) |
392 return; | 392 return; |
393 | 393 |
394 v8SetReturnValueFast(info, openedWindow.release(), impl); | 394 v8SetReturnValueFast(info, openedWindow.release(), impl); |
395 } | 395 } |
396 | 396 |
397 void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 397 void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
398 { | 398 { |
399 | 399 |
400 LocalDOMWindow* window = V8Window::toNative(info.Holder()); | 400 LocalDOMWindow* window = V8Window::toImpl(info.Holder()); |
401 if (!window) | 401 if (!window) |
402 return; | 402 return; |
403 | 403 |
404 LocalFrame* frame = window->frame(); | 404 LocalFrame* frame = window->frame(); |
405 // window is detached from a frame. | 405 // window is detached from a frame. |
406 if (!frame) | 406 if (!frame) |
407 return; | 407 return; |
408 | 408 |
409 // Search sub-frames. | 409 // Search sub-frames. |
410 AtomicString propName = toCoreAtomicString(name); | 410 AtomicString propName = toCoreAtomicString(name); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 exceptionState.throwIfNeeded(); | 452 exceptionState.throwIfNeeded(); |
453 } | 453 } |
454 | 454 |
455 bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8
::Value> key, v8::AccessType type, v8::Local<v8::Value>) | 455 bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8
::Value> key, v8::AccessType type, v8::Local<v8::Value>) |
456 { | 456 { |
457 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 457 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
458 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host,
isolate); | 458 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host,
isolate); |
459 if (window.IsEmpty()) | 459 if (window.IsEmpty()) |
460 return false; // the frame is gone. | 460 return false; // the frame is gone. |
461 | 461 |
462 LocalDOMWindow* targetWindow = V8Window::toNative(window); | 462 LocalDOMWindow* targetWindow = V8Window::toImpl(window); |
463 | 463 |
464 ASSERT(targetWindow); | 464 ASSERT(targetWindow); |
465 | 465 |
466 LocalFrame* target = targetWindow->frame(); | 466 LocalFrame* target = targetWindow->frame(); |
467 if (!target) | 467 if (!target) |
468 return false; | 468 return false; |
469 | 469 |
470 // Notify the loader's client if the initial document has been accessed. | 470 // Notify the loader's client if the initial document has been accessed. |
471 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 471 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
472 target->loader().didAccessInitialDocument(); | 472 target->loader().didAccessInitialDocument(); |
(...skipping 22 matching lines...) Expand all Loading... |
495 return BindingSecurity::shouldAllowAccessToFrame(isolate, target, DoNotRepor
tSecurityError); | 495 return BindingSecurity::shouldAllowAccessToFrame(isolate, target, DoNotRepor
tSecurityError); |
496 } | 496 } |
497 | 497 |
498 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i
ndex, v8::AccessType type, v8::Local<v8::Value>) | 498 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i
ndex, v8::AccessType type, v8::Local<v8::Value>) |
499 { | 499 { |
500 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 500 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
501 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host,
isolate); | 501 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host,
isolate); |
502 if (window.IsEmpty()) | 502 if (window.IsEmpty()) |
503 return false; | 503 return false; |
504 | 504 |
505 LocalDOMWindow* targetWindow = V8Window::toNative(window); | 505 LocalDOMWindow* targetWindow = V8Window::toImpl(window); |
506 | 506 |
507 ASSERT(targetWindow); | 507 ASSERT(targetWindow); |
508 | 508 |
509 LocalFrame* target = targetWindow->frame(); | 509 LocalFrame* target = targetWindow->frame(); |
510 if (!target) | 510 if (!target) |
511 return false; | 511 return false; |
512 | 512 |
513 // Notify the loader's client if the initial document has been accessed. | 513 // Notify the loader's client if the initial document has been accessed. |
514 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 514 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
515 target->loader().didAccessInitialDocument(); | 515 target->loader().didAccessInitialDocument(); |
(...skipping 28 matching lines...) Expand all Loading... |
544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); | 544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); |
545 if (context.IsEmpty()) | 545 if (context.IsEmpty()) |
546 return v8Undefined(); | 546 return v8Undefined(); |
547 | 547 |
548 v8::Handle<v8::Object> global = context->Global(); | 548 v8::Handle<v8::Object> global = context->Global(); |
549 ASSERT(!global.IsEmpty()); | 549 ASSERT(!global.IsEmpty()); |
550 return global; | 550 return global; |
551 } | 551 } |
552 | 552 |
553 } // namespace blink | 553 } // namespace blink |
OLD | NEW |