| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 #include "bindings/core/v8/DOMWrapperWorld.h" | 91 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 92 #include "bindings/core/v8/ExceptionState.h" | 92 #include "bindings/core/v8/ExceptionState.h" |
| 93 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 93 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 94 #include "bindings/core/v8/ScriptController.h" | 94 #include "bindings/core/v8/ScriptController.h" |
| 95 #include "bindings/core/v8/ScriptSourceCode.h" | 95 #include "bindings/core/v8/ScriptSourceCode.h" |
| 96 #include "bindings/core/v8/ScriptValue.h" | 96 #include "bindings/core/v8/ScriptValue.h" |
| 97 #include "bindings/core/v8/SourceLocation.h" | 97 #include "bindings/core/v8/SourceLocation.h" |
| 98 #include "bindings/core/v8/V8Binding.h" | 98 #include "bindings/core/v8/V8Binding.h" |
| 99 #include "bindings/core/v8/V8GCController.h" | 99 #include "bindings/core/v8/V8GCController.h" |
| 100 #include "bindings/core/v8/V8PerIsolateData.h" | 100 #include "bindings/core/v8/V8PerIsolateData.h" |
| 101 #include "bindings/core/v8/WindowProxy.h" |
| 101 #include "core/HTMLNames.h" | 102 #include "core/HTMLNames.h" |
| 102 #include "core/dom/Document.h" | 103 #include "core/dom/Document.h" |
| 103 #include "core/dom/IconURL.h" | 104 #include "core/dom/IconURL.h" |
| 104 #include "core/dom/MessagePort.h" | 105 #include "core/dom/MessagePort.h" |
| 105 #include "core/dom/Node.h" | 106 #include "core/dom/Node.h" |
| 106 #include "core/dom/NodeTraversal.h" | 107 #include "core/dom/NodeTraversal.h" |
| 107 #include "core/dom/SuspendableTask.h" | 108 #include "core/dom/SuspendableTask.h" |
| 108 #include "core/dom/shadow/ShadowRoot.h" | 109 #include "core/dom/shadow/ShadowRoot.h" |
| 109 #include "core/editing/EditingUtilities.h" | 110 #include "core/editing/EditingUtilities.h" |
| 110 #include "core/editing/Editor.h" | 111 #include "core/editing/Editor.h" |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 v8::Local<v8::Value> result; | 841 v8::Local<v8::Value> result; |
| 841 if (!V8ScriptRunner::callFunction( | 842 if (!V8ScriptRunner::callFunction( |
| 842 function, frame()->document(), receiver, argc, | 843 function, frame()->document(), receiver, argc, |
| 843 static_cast<v8::Local<v8::Value>*>(argv), toIsolate(frame())) | 844 static_cast<v8::Local<v8::Value>*>(argv), toIsolate(frame())) |
| 844 .ToLocal(&result)) | 845 .ToLocal(&result)) |
| 845 return v8::Local<v8::Value>(); | 846 return v8::Local<v8::Value>(); |
| 846 return result; | 847 return result; |
| 847 } | 848 } |
| 848 | 849 |
| 849 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { | 850 v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const { |
| 850 ScriptState* scriptState = ScriptState::forMainWorld(frame()); | 851 WindowProxy* windowProxy = frame()->getWindowProxyManager()->mainWorldProxy(); |
| 851 DCHECK(scriptState); | 852 windowProxy->initializeIfNeeded(); |
| 852 return scriptState->context(); | 853 return windowProxy->getScriptState()->context(); |
| 853 } | 854 } |
| 854 | 855 |
| 855 bool WebFrame::scriptCanAccess(WebFrame* target) { | 856 bool WebFrame::scriptCanAccess(WebFrame* target) { |
| 856 return BindingSecurity::shouldAllowAccessToFrame( | 857 return BindingSecurity::shouldAllowAccessToFrame( |
| 857 currentDOMWindow(mainThreadIsolate()), target->toImplBase()->frame(), | 858 currentDOMWindow(mainThreadIsolate()), target->toImplBase()->frame(), |
| 858 BindingSecurity::ErrorReportOption::DoNotReport); | 859 BindingSecurity::ErrorReportOption::DoNotReport); |
| 859 } | 860 } |
| 860 | 861 |
| 861 void WebLocalFrameImpl::reload(WebFrameLoadType loadType) { | 862 void WebLocalFrameImpl::reload(WebFrameLoadType loadType) { |
| 862 // TODO(clamy): Remove this function once RenderFrame calls load for all | 863 // TODO(clamy): Remove this function once RenderFrame calls load for all |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2339 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2340 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
| 2340 } else if (metric == "wasAlternateProtocolAvailable") { | 2341 } else if (metric == "wasAlternateProtocolAvailable") { |
| 2341 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2342 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
| 2342 } else if (metric == "connectionInfo") { | 2343 } else if (metric == "connectionInfo") { |
| 2343 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2344 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
| 2344 } | 2345 } |
| 2345 UseCounter::count(frame(), feature); | 2346 UseCounter::count(frame(), feature); |
| 2346 } | 2347 } |
| 2347 | 2348 |
| 2348 } // namespace blink | 2349 } // namespace blink |
| OLD | NEW |