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

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

Issue 76703002: Media Galleries API Metadata: Make Blob native extension bindings available to multiple extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/feedback_private_custom_bindings.h" 5 #include "chrome/renderer/extensions/blob_native_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "third_party/WebKit/public/platform/WebCString.h" 8 #include "third_party/WebKit/public/platform/WebCString.h"
9 #include "third_party/WebKit/public/platform/WebURL.h" 9 #include "third_party/WebKit/public/platform/WebURL.h"
10 #include "third_party/WebKit/public/web/WebBlob.h" 10 #include "third_party/WebKit/public/web/WebBlob.h"
11 11
12 namespace { 12 namespace extensions {
13 13
14 void GetBlobUuid(const v8::FunctionCallbackInfo<v8::Value> &args) { 14 BlobNativeHandler::BlobNativeHandler(ChromeV8Context* context)
15 : ObjectBackedNativeHandler(context) {
16 RouteFunction("GetBlobUuid", base::Bind(&BlobNativeHandler::GetBlobUuid,
17 base::Unretained(this)));
18 }
19
20 void BlobNativeHandler::GetBlobUuid(
21 const v8::FunctionCallbackInfo<v8::Value> &args) {
15 DCHECK(args.Length() == 1); 22 DCHECK(args.Length() == 1);
Lei Zhang 2013/11/19 21:28:41 DCHECK_EQ
tommycli 2013/11/19 22:16:05 Done.
16 blink::WebBlob blob = blink::WebBlob::fromV8Value(args[0]); 23 blink::WebBlob blob = blink::WebBlob::fromV8Value(args[0]);
17 args.GetReturnValue().Set(v8::String::New(blob.uuid().utf8().data())); 24 args.GetReturnValue().Set(v8::String::New(blob.uuid().utf8().data()));
18 } 25 }
19 26
20 } // namespace
21
22 namespace extensions {
23
24 FeedbackPrivateCustomBindings::FeedbackPrivateCustomBindings(
25 Dispatcher* dispatcher,
26 ChromeV8Context* context) : ChromeV8Extension(dispatcher, context) {
27 RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid));
28 }
29 27
30 } // namespace extensions 28 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698