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

Unified Diff: extensions/renderer/chrome_setting.cc

Issue 2765853004: [Gin] Add Arguments::GetHolderCreationContext() (Closed)
Patch Set: Add test Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gin/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/chrome_setting.cc
diff --git a/extensions/renderer/chrome_setting.cc b/extensions/renderer/chrome_setting.cc
index b883042902153159e581f0e3877c5e1b22acaa69..b5431277bd91122a49fae91a13480ee2a51060d7 100644
--- a/extensions/renderer/chrome_setting.cc
+++ b/extensions/renderer/chrome_setting.cc
@@ -104,10 +104,7 @@ void ChromeSetting::Get(gin::Arguments* arguments) {
void ChromeSetting::Set(gin::Arguments* arguments) {
v8::Isolate* isolate = arguments->isolate();
v8::HandleScope handle_scope(isolate);
-
- v8::Local<v8::Object> holder;
- CHECK(arguments->GetHolder(&holder));
- v8::Local<v8::Context> context = holder->CreationContext();
+ v8::Local<v8::Context> context = arguments->GetHolderCreationContext();
v8::Local<v8::Value> value = arguments->PeekNext();
// The set schema included in the Schema object is generic, since it varies
@@ -129,9 +126,7 @@ void ChromeSetting::Clear(gin::Arguments* arguments) {
v8::Local<v8::Value> ChromeSetting::GetOnChangeEvent(
gin::Arguments* arguments) {
v8::Isolate* isolate = arguments->isolate();
- v8::Local<v8::Object> holder;
- CHECK(arguments->GetHolder(&holder));
- v8::Local<v8::Context> context = holder->CreationContext();
+ v8::Local<v8::Context> context = arguments->GetHolderCreationContext();
v8::Local<v8::Object> wrapper = GetWrapper(isolate);
v8::Local<v8::Private> key = v8::Private::ForApi(
isolate, gin::StringToSymbol(isolate, "onChangeEvent"));
@@ -161,9 +156,7 @@ void ChromeSetting::HandleFunction(const std::string& method_name,
gin::Arguments* arguments) {
v8::Isolate* isolate = arguments->isolate();
v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Object> holder;
- CHECK(arguments->GetHolder(&holder));
- v8::Local<v8::Context> context = holder->CreationContext();
+ v8::Local<v8::Context> context = arguments->GetHolderCreationContext();
std::vector<v8::Local<v8::Value>> argument_list;
if (arguments->Length() > 0) {
« no previous file with comments | « no previous file | gin/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698