| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame
); | 485 v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame
); |
| 486 if (v8Context.IsEmpty()) | 486 if (v8Context.IsEmpty()) |
| 487 return; | 487 return; |
| 488 | 488 |
| 489 v8::Context::Scope scope(v8Context); | 489 v8::Context::Scope scope(v8Context); |
| 490 | 490 |
| 491 v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0); | 491 v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0); |
| 492 | 492 |
| 493 // Attach to the global object. | 493 // Attach to the global object. |
| 494 v8::Handle<v8::Object> global = v8Context->Global(); | 494 v8::Handle<v8::Object> global = v8Context->Global(); |
| 495 global->Set(v8String(key, v8Context->GetIsolate()), value); | 495 global->Set(deprecatedV8String(key), value); |
| 496 } | 496 } |
| 497 | 497 |
| 498 bool ScriptController::haveInterpreter() const | 498 bool ScriptController::haveInterpreter() const |
| 499 { | 499 { |
| 500 return m_windowShell->isContextInitialized(); | 500 return m_windowShell->isContextInitialized(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 void ScriptController::enableEval() | 503 void ScriptController::enableEval() |
| 504 { | 504 { |
| 505 if (!m_windowShell->isContextInitialized()) | 505 if (!m_windowShell->isContextInitialized()) |
| 506 return; | 506 return; |
| 507 v8::HandleScope handleScope; | 507 v8::HandleScope handleScope; |
| 508 m_windowShell->context()->AllowCodeGenerationFromStrings(true); | 508 m_windowShell->context()->AllowCodeGenerationFromStrings(true); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void ScriptController::disableEval(const String& errorMessage) | 511 void ScriptController::disableEval(const String& errorMessage) |
| 512 { | 512 { |
| 513 if (!m_windowShell->isContextInitialized()) | 513 if (!m_windowShell->isContextInitialized()) |
| 514 return; | 514 return; |
| 515 v8::HandleScope handleScope; | 515 v8::HandleScope handleScope; |
| 516 v8::Handle<v8::Context> v8Context = m_windowShell->context(); | 516 v8::Handle<v8::Context> v8Context = m_windowShell->context(); |
| 517 v8Context->AllowCodeGenerationFromStrings(false); | 517 v8Context->AllowCodeGenerationFromStrings(false); |
| 518 v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(errorMessage
, v8Context->GetIsolate())); | 518 v8Context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(er
rorMessage)); |
| 519 } | 519 } |
| 520 | 520 |
| 521 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widge
t) | 521 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widge
t) |
| 522 { | 522 { |
| 523 ASSERT(widget); | 523 ASSERT(widget); |
| 524 | 524 |
| 525 if (!widget->isPluginViewBase()) | 525 if (!widget->isPluginViewBase()) |
| 526 return 0; | 526 return 0; |
| 527 | 527 |
| 528 NPObject* npObject = static_cast<PluginViewBase*>(widget)->scriptableObject(
); | 528 NPObject* npObject = static_cast<PluginViewBase*>(widget)->scriptableObject(
); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 { | 750 { |
| 751 windowShell(mainThreadNormalWorld())->namedItemAdded(doc, name); | 751 windowShell(mainThreadNormalWorld())->namedItemAdded(doc, name); |
| 752 } | 752 } |
| 753 | 753 |
| 754 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n
ame) | 754 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n
ame) |
| 755 { | 755 { |
| 756 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name); | 756 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name); |
| 757 } | 757 } |
| 758 | 758 |
| 759 } // namespace WebCore | 759 } // namespace WebCore |
| OLD | NEW |