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

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

Issue 311263005: Should provide creation context and isolate for WebBlob::toV8Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « extensions/renderer/app_runtime_custom_bindings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/blob_native_handler.h" 5 #include "extensions/renderer/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"
(...skipping 16 matching lines...) Expand all
27 DCHECK_EQ(3, args.Length()); 27 DCHECK_EQ(3, args.Length());
28 DCHECK(args[0]->IsString()); 28 DCHECK(args[0]->IsString());
29 DCHECK(args[1]->IsString()); 29 DCHECK(args[1]->IsString());
30 DCHECK(args[2]->IsInt32()); 30 DCHECK(args[2]->IsInt32());
31 std::string uuid(*v8::String::Utf8Value(args[0]->ToString())); 31 std::string uuid(*v8::String::Utf8Value(args[0]->ToString()));
32 std::string type(*v8::String::Utf8Value(args[1]->ToString())); 32 std::string type(*v8::String::Utf8Value(args[1]->ToString()));
33 blink::WebBlob blob = 33 blink::WebBlob blob =
34 blink::WebBlob::createFromUUID(blink::WebString::fromUTF8(uuid), 34 blink::WebBlob::createFromUUID(blink::WebString::fromUTF8(uuid),
35 blink::WebString::fromUTF8(type), 35 blink::WebString::fromUTF8(type),
36 args[2]->Int32Value()); 36 args[2]->Int32Value());
37 args.GetReturnValue().Set(blob.toV8Value()); 37 args.GetReturnValue().Set(blob.toV8Value(args.Holder(), args.GetIsolate()));
38 } 38 }
39 39
40 } // namespace 40 } // namespace
41 41
42 namespace extensions { 42 namespace extensions {
43 43
44 BlobNativeHandler::BlobNativeHandler(ScriptContext* context) 44 BlobNativeHandler::BlobNativeHandler(ScriptContext* context)
45 : ObjectBackedNativeHandler(context) { 45 : ObjectBackedNativeHandler(context) {
46 RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid)); 46 RouteFunction("GetBlobUuid", base::Bind(&GetBlobUuid));
47 RouteFunction("TakeBrowserProcessBlob", base::Bind(&TakeBrowserProcessBlob)); 47 RouteFunction("TakeBrowserProcessBlob", base::Bind(&TakeBrowserProcessBlob));
48 } 48 }
49 49
50 } // namespace extensions 50 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/app_runtime_custom_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698