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/extensions/extension_api_client_unittest.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/extensions/extension_api_client_unittest.cc')
-rw-r--r-- | chrome/renderer/extensions/extension_api_client_unittest.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/renderer/extensions/extension_api_client_unittest.cc b/chrome/renderer/extensions/extension_api_client_unittest.cc index dc37c5f..9638b27 100644 --- a/chrome/renderer/extensions/extension_api_client_unittest.cc +++ b/chrome/renderer/extensions/extension_api_client_unittest.cc @@ -7,7 +7,7 @@ #include "base/string_util.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" -#include "chrome/renderer/extensions/extension_process_bindings.h" +#include "chrome/renderer/extensions/event_bindings.h" #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/test/render_view_test.h" #include "testing/gtest/include/gtest/gtest.h" @@ -91,8 +91,7 @@ TEST_F(ExtensionAPIClientTest, CallbackDispatching) { ASSERT_GE(callback_id, 0); // Now send the callback a response - ExtensionProcessBindings::HandleResponse( - callback_id, true, "{\"foo\":\"bar\"}", ""); + EventBindings::HandleResponse(callback_id, true, "{\"foo\":\"bar\"}", ""); // And verify that it worked ASSERT_EQ("pass", GetConsoleMessage()); |