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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 m_scriptStateForDialogFrame = ScriptState::from(context); | 319 m_scriptStateForDialogFrame = ScriptState::from(context); |
320 | 320 |
321 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); | 321 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); |
322 m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(m_scrip
tState->isolate(), "dialogArguments"), m_dialogArguments); | 322 m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(m_scrip
tState->isolate(), "dialogArguments"), m_dialogArguments); |
323 } | 323 } |
324 | 324 |
325 v8::Handle<v8::Value> DialogHandler::returnValue() const | 325 v8::Handle<v8::Value> DialogHandler::returnValue() const |
326 { | 326 { |
327 if (!m_scriptStateForDialogFrame) | 327 if (!m_scriptStateForDialogFrame) |
328 return v8Undefined(); | 328 return v8Undefined(); |
329 ASSERT(!m_scriptStateForDialogFrame->contextIsValid()); | 329 ASSERT(m_scriptStateForDialogFrame->contextIsValid()); |
330 | 330 |
331 v8::Isolate* isolate = m_scriptStateForDialogFrame->isolate(); | 331 v8::Isolate* isolate = m_scriptStateForDialogFrame->isolate(); |
332 v8::EscapableHandleScope handleScope(isolate); | 332 v8::EscapableHandleScope handleScope(isolate); |
333 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); | 333 ScriptState::Scope scope(m_scriptStateForDialogFrame.get()); |
334 v8::Local<v8::Value> returnValue = m_scriptStateForDialogFrame->context()->G
lobal()->Get(v8AtomicString(isolate, "returnValue")); | 334 v8::Local<v8::Value> returnValue = m_scriptStateForDialogFrame->context()->G
lobal()->Get(v8AtomicString(isolate, "returnValue")); |
335 if (returnValue.IsEmpty()) | 335 if (returnValue.IsEmpty()) |
336 return v8Undefined(); | 336 return v8Undefined(); |
337 return handleScope.Escape(returnValue); | 337 return handleScope.Escape(returnValue); |
338 } | 338 } |
339 | 339 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); | 536 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); |
537 if (context.IsEmpty()) | 537 if (context.IsEmpty()) |
538 return v8Undefined(); | 538 return v8Undefined(); |
539 | 539 |
540 v8::Handle<v8::Object> global = context->Global(); | 540 v8::Handle<v8::Object> global = context->Global(); |
541 ASSERT(!global.IsEmpty()); | 541 ASSERT(!global.IsEmpty()); |
542 return global; | 542 return global; |
543 } | 543 } |
544 | 544 |
545 } // namespace blink | 545 } // namespace blink |
OLD | NEW |