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

Side by Side Diff: Source/bindings/v8/V8Binding.cpp

Issue 17031006: Rename DOMWindow interface to Window (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 6 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
« no previous file with comments | « Source/bindings/v8/ScriptState.cpp ('k') | Source/bindings/v8/V8DOMWindowShell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "bindings/v8/V8Binding.h" 32 #include "bindings/v8/V8Binding.h"
33 33
34 #include "V8DOMStringList.h" 34 #include "V8DOMStringList.h"
35 #include "V8DOMWindow.h"
36 #include "V8Element.h" 35 #include "V8Element.h"
36 #include "V8Window.h"
37 #include "V8WorkerContext.h" 37 #include "V8WorkerContext.h"
38 #include "V8XPathNSResolver.h" 38 #include "V8XPathNSResolver.h"
39 #include "bindings/v8/ScriptController.h" 39 #include "bindings/v8/ScriptController.h"
40 #include "bindings/v8/V8DOMWindowShell.h"
41 #include "bindings/v8/V8NodeFilterCondition.h" 40 #include "bindings/v8/V8NodeFilterCondition.h"
42 #include "bindings/v8/V8ObjectConstructor.h" 41 #include "bindings/v8/V8ObjectConstructor.h"
42 #include "bindings/v8/V8WindowShell.h"
43 #include "bindings/v8/WorkerScriptController.h" 43 #include "bindings/v8/WorkerScriptController.h"
44 #include "bindings/v8/custom/V8CustomXPathNSResolver.h" 44 #include "bindings/v8/custom/V8CustomXPathNSResolver.h"
45 #include "core/dom/DOMStringList.h" 45 #include "core/dom/DOMStringList.h"
46 #include "core/dom/Element.h" 46 #include "core/dom/Element.h"
47 #include "core/dom/NodeFilter.h" 47 #include "core/dom/NodeFilter.h"
48 #include "core/dom/QualifiedName.h" 48 #include "core/dom/QualifiedName.h"
49 #include "core/dom/WebCoreMemoryInstrumentation.h" 49 #include "core/dom/WebCoreMemoryInstrumentation.h"
50 #include "core/inspector/BindingVisitors.h" 50 #include "core/inspector/BindingVisitors.h"
51 #include "core/loader/FrameLoader.h" 51 #include "core/loader/FrameLoader.h"
52 #include "core/loader/FrameLoaderClient.h" 52 #include "core/loader/FrameLoaderClient.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> context) 377 v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context> context)
378 { 378 {
379 return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype()); 379 return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
380 } 380 }
381 381
382 DOMWindow* toDOMWindow(v8::Handle<v8::Context> context) 382 DOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
383 { 383 {
384 v8::Handle<v8::Object> global = context->Global(); 384 v8::Handle<v8::Object> global = context->Global();
385 ASSERT(!global.IsEmpty()); 385 ASSERT(!global.IsEmpty());
386 v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8DOMWi ndow::GetTemplate(context->GetIsolate(), MainWorld)); 386 v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8Windo w::GetTemplate(context->GetIsolate(), MainWorld));
387 if (!window.IsEmpty()) 387 if (!window.IsEmpty())
388 return V8DOMWindow::toNative(window); 388 return V8Window::toNative(window);
389 window = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(conte xt->GetIsolate(), IsolatedWorld)); 389 window = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context- >GetIsolate(), IsolatedWorld));
390 ASSERT(!window.IsEmpty()); 390 ASSERT(!window.IsEmpty());
391 return V8DOMWindow::toNative(window); 391 return V8Window::toNative(window);
392 } 392 }
393 393
394 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context ) 394 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context )
395 { 395 {
396 v8::Handle<v8::Object> global = context->Global(); 396 v8::Handle<v8::Object> global = context->Global();
397 v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain( V8DOMWindow::GetTemplate(context->GetIsolate(), MainWorld)); 397 v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain( V8Window::GetTemplate(context->GetIsolate(), MainWorld));
398 if (!windowWrapper.IsEmpty()) 398 if (!windowWrapper.IsEmpty())
399 return V8DOMWindow::toNative(windowWrapper)->scriptExecutionContext(); 399 return V8Window::toNative(windowWrapper)->scriptExecutionContext();
400 windowWrapper = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplat e(context->GetIsolate(), IsolatedWorld)); 400 windowWrapper = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(c ontext->GetIsolate(), IsolatedWorld));
401 if (!windowWrapper.IsEmpty()) 401 if (!windowWrapper.IsEmpty())
402 return V8DOMWindow::toNative(windowWrapper)->scriptExecutionContext(); 402 return V8Window::toNative(windowWrapper)->scriptExecutionContext();
403 v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain( V8WorkerContext::GetTemplate(context->GetIsolate(), WorkerWorld)); 403 v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain( V8WorkerContext::GetTemplate(context->GetIsolate(), WorkerWorld));
404 if (!workerWrapper.IsEmpty()) 404 if (!workerWrapper.IsEmpty())
405 return V8WorkerContext::toNative(workerWrapper)->scriptExecutionContext( ); 405 return V8WorkerContext::toNative(workerWrapper)->scriptExecutionContext( );
406 // FIXME: Is this line of code reachable? 406 // FIXME: Is this line of code reachable?
407 return 0; 407 return 0;
408 } 408 }
409 409
410 DOMWindow* activeDOMWindow() 410 DOMWindow* activeDOMWindow()
411 { 411 {
412 v8::Handle<v8::Context> context = v8::Context::GetCalling(); 412 v8::Handle<v8::Context> context = v8::Context::GetCalling();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 514 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
515 if (data->workerDOMDataStore()) 515 if (data->workerDOMDataStore())
516 return 0; 516 return 0;
517 if (!DOMWrapperWorld::isolatedWorldsExist()) 517 if (!DOMWrapperWorld::isolatedWorldsExist())
518 return 0; 518 return 0;
519 ASSERT(!v8::Context::GetEntered().IsEmpty()); 519 ASSERT(!v8::Context::GetEntered().IsEmpty());
520 return DOMWrapperWorld::isolatedWorld(v8::Context::GetEntered()); 520 return DOMWrapperWorld::isolatedWorld(v8::Context::GetEntered());
521 } 521 }
522 522
523 } // namespace WebCore 523 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptState.cpp ('k') | Source/bindings/v8/V8DOMWindowShell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698