summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-03 23:28:03 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-03 23:28:03 +0000
commite3e778724e5f96d204a9d34912ffb5c4786ad289 (patch)
treed56b5acb84cfe0957de0a4dfd9cbbbda06eb055d /chrome/renderer/extensions/file_browser_private_custom_bindings.cc
parent06c8245612efb10678949002650362c842396219 (diff)
downloadchromium_src-e3e778724e5f96d204a9d34912ffb5c4786ad289.zip
chromium_src-e3e778724e5f96d204a9d34912ffb5c4786ad289.tar.gz
chromium_src-e3e778724e5f96d204a9d34912ffb5c4786ad289.tar.bz2
Revert 185709
> Set up V8 bindings for extension/app APIs when they're first used, not on > context creation. This should gives us a significant reduction in extension/app > startup time and slightly better memory usage. > > It also gives us better error messages, the chance to complete the > implementation of API features, and eventually the ability to expose select > extension APIs (e.g. extension.sendMessage) to web pages. > > BUG=163678,120070,55316,177163 > TBR=ben@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/11571014 TBR=cduvall@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/file_browser_private_custom_bindings.cc')
-rw-r--r--chrome/renderer/extensions/file_browser_private_custom_bindings.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/renderer/extensions/file_browser_private_custom_bindings.cc b/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
index 364dfa4..355e838 100644
--- a/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
+++ b/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
@@ -13,18 +13,9 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
-namespace extensions {
-
-FileBrowserPrivateCustomBindings::FileBrowserPrivateCustomBindings(
- v8::Handle<v8::Context> context)
- : ChromeV8Extension(NULL, context) {
- RouteFunction(
- "GetLocalFileSystem",
- base::Bind(&FileBrowserPrivateCustomBindings::GetLocalFileSystem,
- base::Unretained(this)));
-}
+namespace {
-v8::Handle<v8::Value> FileBrowserPrivateCustomBindings::GetLocalFileSystem(
+static v8::Handle<v8::Value> GetLocalFileSystem(
const v8::Arguments& args) {
DCHECK(args.Length() == 2);
DCHECK(args[0]->IsString());
@@ -32,7 +23,7 @@ v8::Handle<v8::Value> FileBrowserPrivateCustomBindings::GetLocalFileSystem(
std::string name(*v8::String::Utf8Value(args[0]));
std::string path(*v8::String::Utf8Value(args[1]));
- WebKit::WebFrame* webframe = WebKit::WebFrame::frameForContext(v8_context());
+ WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext();
DCHECK(webframe);
return webframe->createFileSystem(
WebKit::WebFileSystem::TypeExternal,
@@ -40,4 +31,13 @@ v8::Handle<v8::Value> FileBrowserPrivateCustomBindings::GetLocalFileSystem(
WebKit::WebString::fromUTF8(path.c_str()));
}
+} // namespace
+
+namespace extensions {
+
+FileBrowserPrivateCustomBindings::FileBrowserPrivateCustomBindings()
+ : ChromeV8Extension(NULL) {
+ RouteStaticFunction("GetLocalFileSystem", &GetLocalFileSystem);
+}
+
} // namespace extensions