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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2790283002: Use PluginView type rather than FrameViewBase for v8 Script object. (Closed)
Patch Set: Format if/return as per comment Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 m_windowProxyManager->mainWorldProxyMaybeUninitialized() 175 m_windowProxyManager->mainWorldProxyMaybeUninitialized()
176 ->contextIfInitialized(); 176 ->contextIfInitialized();
177 if (v8Context.IsEmpty()) 177 if (v8Context.IsEmpty())
178 return; 178 return;
179 v8Context->AllowCodeGenerationFromStrings(false); 179 v8Context->AllowCodeGenerationFromStrings(false);
180 v8Context->SetErrorMessageForCodeGenerationFromStrings( 180 v8Context->SetErrorMessageForCodeGenerationFromStrings(
181 v8String(isolate(), errorMessage)); 181 v8String(isolate(), errorMessage));
182 } 182 }
183 183
184 PassRefPtr<SharedPersistent<v8::Object>> ScriptController::createPluginWrapper( 184 PassRefPtr<SharedPersistent<v8::Object>> ScriptController::createPluginWrapper(
185 FrameViewBase* frameViewBase) { 185 PluginView& plugin) {
186 DCHECK(frameViewBase);
187
188 if (!frameViewBase->isPluginView())
189 return nullptr;
190
191 v8::HandleScope handleScope(isolate()); 186 v8::HandleScope handleScope(isolate());
192 v8::Local<v8::Object> scriptableObject = 187 v8::Local<v8::Object> scriptableObject = plugin.scriptableObject(isolate());
193 toPluginView(frameViewBase)->scriptableObject(isolate());
194 188
195 if (scriptableObject.IsEmpty()) 189 if (scriptableObject.IsEmpty())
196 return nullptr; 190 return nullptr;
197 191
198 return SharedPersistent<v8::Object>::create(scriptableObject, isolate()); 192 return SharedPersistent<v8::Object>::create(scriptableObject, isolate());
199 } 193 }
200 194
201 V8Extensions& ScriptController::registeredExtensions() { 195 V8Extensions& ScriptController::registeredExtensions() {
202 DEFINE_STATIC_LOCAL(V8Extensions, extensions, ()); 196 DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
203 return extensions; 197 return extensions;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 for (size_t i = 0; i < resultArray->Length(); ++i) { 358 for (size_t i = 0; i < resultArray->Length(); ++i) {
365 v8::Local<v8::Value> value; 359 v8::Local<v8::Value> value;
366 if (!resultArray->Get(context, i).ToLocal(&value)) 360 if (!resultArray->Get(context, i).ToLocal(&value))
367 return; 361 return;
368 results->push_back(value); 362 results->push_back(value);
369 } 363 }
370 } 364 }
371 } 365 }
372 366
373 } // namespace blink 367 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptController.h ('k') | third_party/WebKit/Source/core/html/HTMLPlugInElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698