Index: chrome/renderer/extensions/blob_native_handler.cc |
diff --git a/chrome/renderer/extensions/feedback_private_custom_bindings.cc b/chrome/renderer/extensions/blob_native_handler.cc |
similarity index 59% |
rename from chrome/renderer/extensions/feedback_private_custom_bindings.cc |
rename to chrome/renderer/extensions/blob_native_handler.cc |
index 9b9d5f2f1929255cbaca54f2ce61650ce3d06ce7..59bffeabd4d4ab8a7d36f89229dace5b118bbf12 100644 |
--- a/chrome/renderer/extensions/feedback_private_custom_bindings.cc |
+++ b/chrome/renderer/extensions/blob_native_handler.cc |
@@ -2,29 +2,27 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/renderer/extensions/feedback_private_custom_bindings.h" |
+#include "chrome/renderer/extensions/blob_native_handler.h" |
#include "base/bind.h" |
#include "third_party/WebKit/public/platform/WebCString.h" |
#include "third_party/WebKit/public/platform/WebURL.h" |
#include "third_party/WebKit/public/web/WebBlob.h" |
-namespace { |
+namespace extensions { |
+ |
+BlobNativeHandler::BlobNativeHandler(ChromeV8Context* context) |
+ : ObjectBackedNativeHandler(context) { |
+ RouteFunction("GetBlobUuid", base::Bind(&BlobNativeHandler::GetBlobUuid, |
+ base::Unretained(this))); |
+} |
-void GetBlobUuid(const v8::FunctionCallbackInfo<v8::Value> &args) { |
+void BlobNativeHandler::GetBlobUuid( |
+ const v8::FunctionCallbackInfo<v8::Value> &args) { |
DCHECK(args.Length() == 1); |
Lei Zhang
2013/11/19 21:28:41
DCHECK_EQ
tommycli
2013/11/19 22:16:05
Done.
|
blink::WebBlob blob = blink::WebBlob::fromV8Value(args[0]); |
args.GetReturnValue().Set(v8::String::New(blob.uuid().utf8().data())); |
} |
-} // namespace |
- |
-namespace extensions { |
- |
-FeedbackPrivateCustomBindings::FeedbackPrivateCustomBindings( |
- Dispatcher* dispatcher, |
- ChromeV8Context* context) : ChromeV8Extension(dispatcher, context) { |
- RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid)); |
-} |
} // namespace extensions |