diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 19:52:09 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 19:52:09 +0000 |
commit | 4083f0521b25dfe74914421f632d18e87dad4048 (patch) | |
tree | 229a8d1e348f86906aa7341a112ad7e7e7e22ce7 /chrome/renderer/render_view.cc | |
parent | 019acf33272edf63ce3f57469446042c760f924f (diff) | |
download | chromium_src-4083f0521b25dfe74914421f632d18e87dad4048.zip chromium_src-4083f0521b25dfe74914421f632d18e87dad4048.tar.gz chromium_src-4083f0521b25dfe74914421f632d18e87dad4048.tar.bz2 |
Refactor extension bindings to share code, avoid exposing hidden variables
globally, and avoid using the DOM load/unload events.
- moved callback handling into event_bindings.js (ports will use it).
- added chromeHidden, a V8 hidden value, to keep all internal variables that
need to be accessible to native code.
- changed context registration to occur always at extension load, instead of
DOM load.
- added an internal unload event that doesn't disable SuddenTermination.
This is a rework of my earlier CL http://codereview.chromium.org/125280 which was reverted because of a perf regression. I believe the perf problem was caused by the call into javascript I did on page load to handle context registration - this CL avoids that.
Review URL: http://codereview.chromium.org/147033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index f62e9a8..b2c505a 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -36,7 +36,6 @@ #include "chrome/renderer/devtools_agent.h" #include "chrome/renderer/devtools_client.h" #include "chrome/renderer/extensions/event_bindings.h" -#include "chrome/renderer/extensions/extension_process_bindings.h" #include "chrome/renderer/localized_error.h" #include "chrome/renderer/media/audio_renderer_impl.h" #include "chrome/renderer/media/buffered_data_source.h" @@ -1458,12 +1457,6 @@ void RenderView::DocumentElementAvailable(WebFrame* frame) { if (frame->GetURL().SchemeIs(chrome::kExtensionScheme)) frame->GrantUniversalAccess(); - // Tell extensions to self-register their js contexts. - // TODO(rafaelw): This is kind of gross. We need a way to call through - // the glue layer to retrieve the current v8::Context. - if (frame->GetURL().SchemeIs(chrome::kExtensionScheme)) - ExtensionProcessBindings::RegisterExtensionContext(frame); - if (RenderThread::current()) // Will be NULL during unit tests. RenderThread::current()->user_script_slave()->InjectScripts( frame, UserScript::DOCUMENT_START); @@ -2824,8 +2817,7 @@ void RenderView::OnExtensionResponse(int request_id, bool success, const std::string& response, const std::string& error) { - ExtensionProcessBindings::HandleResponse(request_id, success, response, - error); + EventBindings::HandleResponse(request_id, success, response, error); } // Dump all load time histograms. |