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

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

Issue 744723002: remove some calls to to-be-deprecated v8::Value::To* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « extensions/renderer/blob_native_handler.cc ('k') | extensions/renderer/event_bindings.cc » ('j') | 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/document_custom_bindings.h" 5 #include "extensions/renderer/document_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "extensions/renderer/script_context.h" 10 #include "extensions/renderer/script_context.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // Attach an event name to an object. 24 // Attach an event name to an object.
25 void DocumentCustomBindings::RegisterElement( 25 void DocumentCustomBindings::RegisterElement(
26 const v8::FunctionCallbackInfo<v8::Value>& args) { 26 const v8::FunctionCallbackInfo<v8::Value>& args) {
27 if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsObject()) { 27 if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsObject()) {
28 NOTREACHED(); 28 NOTREACHED();
29 return; 29 return;
30 } 30 }
31 31
32 std::string element_name(*v8::String::Utf8Value(args[0])); 32 std::string element_name(*v8::String::Utf8Value(args[0]));
33 v8::Local<v8::Object> options = args[1]->ToObject(); 33 v8::Local<v8::Object> options = v8::Local<v8::Object>::Cast(args[1]);
34 34
35 blink::WebExceptionCode ec = 0; 35 blink::WebExceptionCode ec = 0;
36 blink::WebDocument document = context()->web_frame()->document(); 36 blink::WebDocument document = context()->web_frame()->document();
37 v8::Handle<v8::Value> constructor = document.registerEmbedderCustomElement( 37 v8::Handle<v8::Value> constructor = document.registerEmbedderCustomElement(
38 blink::WebString::fromUTF8(element_name), options, ec); 38 blink::WebString::fromUTF8(element_name), options, ec);
39 args.GetReturnValue().Set(constructor); 39 args.GetReturnValue().Set(constructor);
40 } 40 }
41 41
42 } // namespace extensions 42 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/blob_native_handler.cc ('k') | extensions/renderer/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698