OLD | NEW |
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 Loading... |
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 |
OLD | NEW |