| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 void ScriptController::setEventHandlerLineno(int lineno) | 316 void ScriptController::setEventHandlerLineno(int lineno) |
| 317 { | 317 { |
| 318 m_proxy->setEventHandlerLineno(lineno); | 318 m_proxy->setEventHandlerLineno(lineno); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void ScriptController::finishedWithEvent(Event* evt) | 321 void ScriptController::finishedWithEvent(Event* evt) |
| 322 { | 322 { |
| 323 m_proxy->finishedWithEvent(evt); | 323 m_proxy->finishedWithEvent(evt); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void ScriptController::clearDocumentWrapper() | |
| 327 { | |
| 328 m_proxy->clearDocumentWrapper(); | |
| 329 } | |
| 330 | |
| 331 // Create a V8 object with an interceptor of NPObjectPropertyGetter | 326 // Create a V8 object with an interceptor of NPObjectPropertyGetter |
| 332 void ScriptController::BindToWindowObject(Frame* frame, const String& key, NPObj
ect* object) | 327 void ScriptController::BindToWindowObject(Frame* frame, const String& key, NPObj
ect* object) |
| 333 { | 328 { |
| 334 v8::HandleScope handle_scope; | 329 v8::HandleScope handle_scope; |
| 335 | 330 |
| 336 v8::Handle<v8::Context> context = V8Proxy::GetContext(frame); | 331 v8::Handle<v8::Context> context = V8Proxy::GetContext(frame); |
| 337 if (context.IsEmpty()) | 332 if (context.IsEmpty()) |
| 338 return; | 333 return; |
| 339 | 334 |
| 340 v8::Context::Scope scope(context); | 335 v8::Context::Scope scope(context); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 v8::Handle<v8::Value> v8plugin = V8Proxy::ToV8Object(V8ClassIndex::HTMLEMBED
ELEMENT, plugin); | 500 v8::Handle<v8::Value> v8plugin = V8Proxy::ToV8Object(V8ClassIndex::HTMLEMBED
ELEMENT, plugin); |
| 506 if (!v8plugin->IsObject()) | 501 if (!v8plugin->IsObject()) |
| 507 return createNoScriptObject(); | 502 return createNoScriptObject(); |
| 508 | 503 |
| 509 return NPN_CreateScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win
dow); | 504 return NPN_CreateScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win
dow); |
| 510 } | 505 } |
| 511 | 506 |
| 512 | 507 |
| 513 void ScriptController::clearWindowShell() | 508 void ScriptController::clearWindowShell() |
| 514 { | 509 { |
| 510 // V8 binding expects ScriptController::clearWindowShell only be called |
| 511 // when a frame is loading a new page. V8Proxy::clearForNavigation |
| 512 // creates a new context for the new page. |
| 515 m_proxy->clearForNavigation(); | 513 m_proxy->clearForNavigation(); |
| 516 } | 514 } |
| 517 | 515 |
| 518 void ScriptController::attachDebugger(void*) | 516 void ScriptController::attachDebugger(void*) |
| 519 { | 517 { |
| 520 notImplemented(); | 518 notImplemented(); |
| 521 } | 519 } |
| 522 | 520 |
| 523 void ScriptController::updateDocument() | 521 void ScriptController::updateDocument() |
| 524 { | 522 { |
| 525 // TODO(eseidel): Should update document property on current window object | 523 m_proxy->updateDocument(); |
| 526 // and all previous window objects which may still be alive. | |
| 527 notImplemented(); | |
| 528 } | 524 } |
| 529 | 525 |
| 530 | 526 |
| 531 JSInstanceHolder::JSInstanceHolder() | 527 JSInstanceHolder::JSInstanceHolder() |
| 532 { | 528 { |
| 533 } | 529 } |
| 534 | 530 |
| 535 JSInstanceHolder::JSInstanceHolder(JSInstanceHandle instance) | 531 JSInstanceHolder::JSInstanceHolder(JSInstanceHandle instance) |
| 536 { | 532 { |
| 537 *this = instance; | 533 *this = instance; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 v8::Persistent<v8::Object> handle = | 575 v8::Persistent<v8::Object> handle = |
| 580 v8::Persistent<v8::Object>::New(instance); | 576 v8::Persistent<v8::Object>::New(instance); |
| 581 m_instance = handle; | 577 m_instance = handle; |
| 582 #ifndef NDEBUG | 578 #ifndef NDEBUG |
| 583 V8Proxy::RegisterGlobalHandle(JSINSTANCE, this, handle); | 579 V8Proxy::RegisterGlobalHandle(JSINSTANCE, this, handle); |
| 584 #endif | 580 #endif |
| 585 return *this; | 581 return *this; |
| 586 } | 582 } |
| 587 | 583 |
| 588 } // namespace WebCpre | 584 } // namespace WebCpre |
| OLD | NEW |