Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / chrome / renderer / extensions / blob_native_handler.cc
blobc7f4255f3ea4d57585fb8211fc07b69b76b9222c
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/renderer/extensions/blob_native_handler.h"
7 #include "base/bind.h"
8 #include "third_party/WebKit/public/platform/WebCString.h"
9 #include "third_party/WebKit/public/platform/WebURL.h"
10 #include "third_party/WebKit/public/web/WebBlob.h"
12 namespace {
14 // Expects a single Blob argument. Returns the Blob's UUID.
15 void GetBlobUuid(const v8::FunctionCallbackInfo<v8::Value>& args) {
16 DCHECK_EQ(1, args.Length());
17 blink::WebBlob blob = blink::WebBlob::fromV8Value(args[0]);
18 args.GetReturnValue().Set(
19 v8::String::NewFromUtf8(args.GetIsolate(), blob.uuid().utf8().data()));
22 } // namespace
24 namespace extensions {
26 BlobNativeHandler::BlobNativeHandler(ChromeV8Context* context)
27 : ObjectBackedNativeHandler(context) {
28 RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid));
31 } // namespace extensions