OLD | NEW |
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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 // DOMString to a sequence of Unicode characters" is used subsequently | 611 // DOMString to a sequence of Unicode characters" is used subsequently |
612 // when converting to an IDL value | 612 // when converting to an IDL value |
613 String x = toCoreString(stringObject); | 613 String x = toCoreString(stringObject); |
614 return replaceUnmatchedSurrogates(x); | 614 return replaceUnmatchedSurrogates(x); |
615 } | 615 } |
616 | 616 |
617 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>
value, v8::Isolate* isolate) | 617 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>
value, v8::Isolate* isolate) |
618 { | 618 { |
619 RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; | 619 RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; |
620 if (V8XPathNSResolver::hasInstance(value, isolate)) | 620 if (V8XPathNSResolver::hasInstance(value, isolate)) |
621 resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(valu
e)); | 621 resolver = V8XPathNSResolver::toImpl(v8::Handle<v8::Object>::Cast(value)
); |
622 else if (value->IsObject()) | 622 else if (value->IsObject()) |
623 resolver = V8CustomXPathNSResolver::create(value->ToObject(), isolate); | 623 resolver = V8CustomXPathNSResolver::create(value->ToObject(), isolate); |
624 return resolver; | 624 return resolver; |
625 } | 625 } |
626 | 626 |
627 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Value> value, v8::Isolate* isolate) | 627 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Value> value, v8::Isolate* isolate) |
628 { | 628 { |
629 if (value.IsEmpty() || !value->IsObject()) | 629 if (value.IsEmpty() || !value->IsObject()) |
630 return 0; | 630 return 0; |
631 | 631 |
632 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai
n(v8::Handle<v8::Object>::Cast(value), isolate); | 632 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai
n(v8::Handle<v8::Object>::Cast(value), isolate); |
633 if (!windowWrapper.IsEmpty()) | 633 if (!windowWrapper.IsEmpty()) |
634 return V8Window::toNative(windowWrapper); | 634 return V8Window::toImpl(windowWrapper); |
635 return 0; | 635 return 0; |
636 } | 636 } |
637 | 637 |
638 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Context> context) | 638 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Context> context) |
639 { | 639 { |
640 if (context.IsEmpty()) | 640 if (context.IsEmpty()) |
641 return 0; | 641 return 0; |
642 return toDOMWindow(context->Global(), context->GetIsolate()); | 642 return toDOMWindow(context->Global(), context->GetIsolate()); |
643 } | 643 } |
644 | 644 |
(...skipping 27 matching lines...) Expand all Loading... |
672 return toDOMWindow(context); | 672 return toDOMWindow(context); |
673 } | 673 } |
674 | 674 |
675 ExecutionContext* toExecutionContext(v8::Handle<v8::Context> context) | 675 ExecutionContext* toExecutionContext(v8::Handle<v8::Context> context) |
676 { | 676 { |
677 if (context.IsEmpty()) | 677 if (context.IsEmpty()) |
678 return 0; | 678 return 0; |
679 v8::Handle<v8::Object> global = context->Global(); | 679 v8::Handle<v8::Object> global = context->Global(); |
680 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai
n(global, context->GetIsolate()); | 680 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai
n(global, context->GetIsolate()); |
681 if (!windowWrapper.IsEmpty()) | 681 if (!windowWrapper.IsEmpty()) |
682 return V8Window::toNative(windowWrapper)->executionContext(); | 682 return V8Window::toImpl(windowWrapper)->executionContext(); |
683 v8::Handle<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPr
ototypeChain(global, context->GetIsolate()); | 683 v8::Handle<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPr
ototypeChain(global, context->GetIsolate()); |
684 if (!workerWrapper.IsEmpty()) | 684 if (!workerWrapper.IsEmpty()) |
685 return V8WorkerGlobalScope::toNative(workerWrapper)->executionContext(); | 685 return V8WorkerGlobalScope::toImpl(workerWrapper)->executionContext(); |
686 // FIXME: Is this line of code reachable? | 686 // FIXME: Is this line of code reachable? |
687 return 0; | 687 return 0; |
688 } | 688 } |
689 | 689 |
690 ExecutionContext* currentExecutionContext(v8::Isolate* isolate) | 690 ExecutionContext* currentExecutionContext(v8::Isolate* isolate) |
691 { | 691 { |
692 return toExecutionContext(isolate->GetCurrentContext()); | 692 return toExecutionContext(isolate->GetCurrentContext()); |
693 } | 693 } |
694 | 694 |
695 ExecutionContext* callingExecutionContext(v8::Isolate* isolate) | 695 ExecutionContext* callingExecutionContext(v8::Isolate* isolate) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) | 904 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio
nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) |
905 { | 905 { |
906 int scriptId = 0; | 906 int scriptId = 0; |
907 String resourceName; | 907 String resourceName; |
908 int lineNumber = 1; | 908 int lineNumber = 1; |
909 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe
r); | 909 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe
r); |
910 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin
eNumber); | 910 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin
eNumber); |
911 } | 911 } |
912 | 912 |
913 } // namespace blink | 913 } // namespace blink |
OLD | NEW |