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

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

Issue 1167423002: Use V8 Maybe APIs in extensions/renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/resource_bundle_source_map.h" 5 #include "extensions/renderer/resource_bundle_source_map.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 9
10 namespace extensions { 10 namespace extensions {
(...skipping 30 matching lines...) Expand all
41 41
42 bool ResourceBundleSourceMap::Contains(const std::string& name) { 42 bool ResourceBundleSourceMap::Contains(const std::string& name) {
43 return !!resource_id_map_.count(name); 43 return !!resource_id_map_.count(name);
44 } 44 }
45 45
46 v8::Local<v8::String> ResourceBundleSourceMap::ConvertString( 46 v8::Local<v8::String> ResourceBundleSourceMap::ConvertString(
47 v8::Isolate* isolate, 47 v8::Isolate* isolate,
48 const base::StringPiece& string) { 48 const base::StringPiece& string) {
49 // v8 takes ownership of the StaticV8ExternalOneByteStringResource (see 49 // v8 takes ownership of the StaticV8ExternalOneByteStringResource (see
50 // v8::String::NewExternal()). 50 // v8::String::NewExternal()).
51 return v8::String::NewExternal( 51 return v8::String::NewExternalOneByte(
52 isolate, new StaticV8ExternalOneByteStringResource(string)); 52 isolate, new StaticV8ExternalOneByteStringResource(string))
53 .ToLocalChecked();
53 } 54 }
54 55
55 } // namespace extensions 56 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/render_view_observer_natives.cc ('k') | extensions/renderer/runtime_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698