Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/renderer/extensions/blob_native_handler.cc

Issue 235943018: Move extensions bindings code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "chrome/renderer/extensions/blob_native_handler.h"
6
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"
11
12 namespace {
13
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()));
20 }
21
22 } // namespace
23
24 namespace extensions {
25
26 BlobNativeHandler::BlobNativeHandler(ScriptContext* context)
27 : ObjectBackedNativeHandler(context) {
28 RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid));
29 }
30
31 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/blob_native_handler.h ('k') | chrome/renderer/extensions/content_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698