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

Side by Side Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 40132: Refactor v8 extensions to make registration avoid having to use ChromiumBridg... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 #include "Worker.h" 198 #include "Worker.h"
199 #include "WorkerContext.h" 199 #include "WorkerContext.h"
200 #include "WorkerLocation.h" 200 #include "WorkerLocation.h"
201 #include "WorkerNavigator.h" 201 #include "WorkerNavigator.h"
202 #endif // WORKERS 202 #endif // WORKERS
203 203
204 #if ENABLE(XPATH) 204 #if ENABLE(XPATH)
205 #include "XPathEvaluator.h" 205 #include "XPathEvaluator.h"
206 #endif 206 #endif
207 207
208 #include "extensions/GCController.h"
209 #include "extensions/Gears.h"
210 #include "extensions/Interval.h"
211 #include "extensions/Playback.h"
212
213 208
214 namespace WebCore { 209 namespace WebCore {
215 210
216 211
217 // DOM binding algorithm: 212 // DOM binding algorithm:
218 // 213 //
219 // There are two kinds of DOM objects: 214 // There are two kinds of DOM objects:
220 // 1. DOM tree nodes, such as Document, HTMLElement, ... 215 // 1. DOM tree nodes, such as Document, HTMLElement, ...
221 // there classes implements TreeShared<T> interface; 216 // there classes implements TreeShared<T> interface;
222 // 2. Non-node DOM objects, such as CSSRule, Location, etc. 217 // 2. Non-node DOM objects, such as CSSRule, Location, etc.
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 v8::V8::IgnoreOutOfMemoryException(); 2319 v8::V8::IgnoreOutOfMemoryException();
2325 v8::V8::SetFatalErrorHandler(ReportFatalErrorInV8); 2320 v8::V8::SetFatalErrorHandler(ReportFatalErrorInV8);
2326 2321
2327 v8::V8::SetGlobalGCPrologueCallback(&GCPrologue); 2322 v8::V8::SetGlobalGCPrologueCallback(&GCPrologue);
2328 v8::V8::SetGlobalGCEpilogueCallback(&GCEpilogue); 2323 v8::V8::SetGlobalGCEpilogueCallback(&GCEpilogue);
2329 2324
2330 v8::V8::AddMessageListener(HandleConsoleMessage); 2325 v8::V8::AddMessageListener(HandleConsoleMessage);
2331 2326
2332 v8::V8::SetFailedAccessCheckCallbackFunction(ReportUnsafeJavaScriptAccess); 2327 v8::V8::SetFailedAccessCheckCallbackFunction(ReportUnsafeJavaScriptAccess);
2333 2328
2334 // Register known extensions
2335 RegisterExtension(GearsExtension::Get());
2336 RegisterExtension(IntervalExtension::Get());
2337 if (ScriptController::shouldExposeGCController())
2338 RegisterExtension(GCExtension::Get());
2339 if (ScriptController::RecordPlaybackMode())
2340 RegisterExtension(PlaybackExtension::Get());
2341
2342 v8_initialized = true; 2329 v8_initialized = true;
2343 } 2330 }
2344 2331
2345 // Create a new environment using an empty template for the shadow 2332 // Create a new environment using an empty template for the shadow
2346 // object. Reuse the global object if one has been created earlier. 2333 // object. Reuse the global object if one has been created earlier.
2347 v8::Persistent<v8::ObjectTemplate> global_template = 2334 v8::Persistent<v8::ObjectTemplate> global_template =
2348 V8DOMWindow::GetShadowObjectTemplate(); 2335 V8DOMWindow::GetShadowObjectTemplate();
2349 if (global_template.IsEmpty()) 2336 if (global_template.IsEmpty())
2350 return; 2337 return;
2351 2338
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
3538 } 3525 }
3539 return ToWebCoreString(v8::Debug::Call(frame_source_name)); 3526 return ToWebCoreString(v8::Debug::Call(frame_source_name));
3540 } 3527 }
3541 3528
3542 void V8Proxy::RegisterExtension(v8::Extension* extension) { 3529 void V8Proxy::RegisterExtension(v8::Extension* extension) {
3543 v8::RegisterExtension(extension); 3530 v8::RegisterExtension(extension);
3544 m_extensions.push_back(extension); 3531 m_extensions.push_back(extension);
3545 } 3532 }
3546 3533
3547 } // namespace WebCore 3534 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698