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

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

Issue 2719333002: second stage
Patch Set: Need to get around resource loading without web/ 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 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "core/html/HTMLPlugInElement.h" 54 #include "core/html/HTMLPlugInElement.h"
55 #include "core/inspector/ConsoleMessage.h" 55 #include "core/inspector/ConsoleMessage.h"
56 #include "core/inspector/InspectorInstrumentation.h" 56 #include "core/inspector/InspectorInstrumentation.h"
57 #include "core/inspector/InspectorTraceEvents.h" 57 #include "core/inspector/InspectorTraceEvents.h"
58 #include "core/inspector/MainThreadDebugger.h" 58 #include "core/inspector/MainThreadDebugger.h"
59 #include "core/loader/DocumentLoader.h" 59 #include "core/loader/DocumentLoader.h"
60 #include "core/loader/FrameLoader.h" 60 #include "core/loader/FrameLoader.h"
61 #include "core/loader/FrameLoaderClient.h" 61 #include "core/loader/FrameLoaderClient.h"
62 #include "core/loader/NavigationScheduler.h" 62 #include "core/loader/NavigationScheduler.h"
63 #include "core/loader/ProgressTracker.h" 63 #include "core/loader/ProgressTracker.h"
64 #include "core/plugins/PluginClient.h"
64 #include "core/plugins/PluginView.h" 65 #include "core/plugins/PluginView.h"
65 #include "platform/Histogram.h" 66 #include "platform/Histogram.h"
66 #include "platform/UserGestureIndicator.h" 67 #include "platform/UserGestureIndicator.h"
67 #include "platform/Widget.h" 68 #include "platform/Widget.h"
68 #include "platform/instrumentation/tracing/TraceEvent.h" 69 #include "platform/instrumentation/tracing/TraceEvent.h"
69 #include "platform/weborigin/SecurityOrigin.h" 70 #include "platform/weborigin/SecurityOrigin.h"
70 #include "public/platform/Platform.h" 71 #include "public/platform/Platform.h"
71 #include "wtf/CurrentTime.h" 72 #include "wtf/CurrentTime.h"
72 #include "wtf/StdLibExtras.h" 73 #include "wtf/StdLibExtras.h"
73 #include "wtf/StringExtras.h" 74 #include "wtf/StringExtras.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 v8::HandleScope handleScope(isolate()); 215 v8::HandleScope handleScope(isolate());
215 v8::Local<v8::Object> scriptableObject = 216 v8::Local<v8::Object> scriptableObject =
216 toPluginView(widget)->scriptableObject(isolate()); 217 toPluginView(widget)->scriptableObject(isolate());
217 218
218 if (scriptableObject.IsEmpty()) 219 if (scriptableObject.IsEmpty())
219 return nullptr; 220 return nullptr;
220 221
221 return SharedPersistent<v8::Object>::create(scriptableObject, isolate()); 222 return SharedPersistent<v8::Object>::create(scriptableObject, isolate());
222 } 223 }
223 224
225 PassRefPtr<SharedPersistent<v8::Object>> ScriptController::createPluginWrapper(
226 PluginClient* pluginClient) {
227 ASSERT(pluginClient);
228
229 v8::HandleScope handleScope(isolate());
230 v8::Local<v8::Object> scriptableObject =
231 pluginClient->scriptableObject(isolate());
232
233 if (scriptableObject.IsEmpty())
234 return nullptr;
235
236 return SharedPersistent<v8::Object>::create(scriptableObject, isolate());
237 }
238
224 V8Extensions& ScriptController::registeredExtensions() { 239 V8Extensions& ScriptController::registeredExtensions() {
225 DEFINE_STATIC_LOCAL(V8Extensions, extensions, ()); 240 DEFINE_STATIC_LOCAL(V8Extensions, extensions, ());
226 return extensions; 241 return extensions;
227 } 242 }
228 243
229 void ScriptController::registerExtensionIfNeeded(v8::Extension* extension) { 244 void ScriptController::registerExtensionIfNeeded(v8::Extension* extension) {
230 const V8Extensions& extensions = registeredExtensions(); 245 const V8Extensions& extensions = registeredExtensions();
231 for (size_t i = 0; i < extensions.size(); ++i) { 246 for (size_t i = 0; i < extensions.size(); ++i) {
232 if (extensions[i] == extension) 247 if (extensions[i] == extension)
233 return; 248 return;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 for (size_t i = 0; i < resultArray->Length(); ++i) { 396 for (size_t i = 0; i < resultArray->Length(); ++i) {
382 v8::Local<v8::Value> value; 397 v8::Local<v8::Value> value;
383 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 398 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
384 return; 399 return;
385 results->push_back(value); 400 results->push_back(value);
386 } 401 }
387 } 402 }
388 } 403 }
389 404
390 } // namespace blink 405 } // 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