| OLD | NEW |
| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 Settings* settings = frame()->settings(); | 274 Settings* settings = frame()->settings(); |
| 275 const bool allowed = | 275 const bool allowed = |
| 276 client->allowScript(settings && settings->getScriptEnabled()); | 276 client->allowScript(settings && settings->getScriptEnabled()); |
| 277 if (!allowed && reason == AboutToExecuteScript) | 277 if (!allowed && reason == AboutToExecuteScript) |
| 278 client->didNotAllowScript(); | 278 client->didNotAllowScript(); |
| 279 return allowed; | 279 return allowed; |
| 280 } | 280 } |
| 281 | 281 |
| 282 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url, | 282 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url, |
| 283 Element* element) { | 283 Element* element) { |
| 284 if (!protocolIsJavaScript(url)) | 284 if (!url.protocolIsJavaScript()) |
| 285 return false; | 285 return false; |
| 286 | 286 |
| 287 bool shouldBypassMainWorldContentSecurityPolicy = | 287 bool shouldBypassMainWorldContentSecurityPolicy = |
| 288 ContentSecurityPolicy::shouldBypassMainWorld(frame()->document()); | 288 ContentSecurityPolicy::shouldBypassMainWorld(frame()->document()); |
| 289 if (!frame()->page() || | 289 if (!frame()->page() || |
| 290 (!shouldBypassMainWorldContentSecurityPolicy && | 290 (!shouldBypassMainWorldContentSecurityPolicy && |
| 291 !frame()->document()->contentSecurityPolicy()->allowJavaScriptURLs( | 291 !frame()->document()->contentSecurityPolicy()->allowJavaScriptURLs( |
| 292 element, frame()->document()->url(), | 292 element, frame()->document()->url(), |
| 293 eventHandlerPosition().m_line))) { | 293 eventHandlerPosition().m_line))) { |
| 294 return true; | 294 return true; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 for (size_t i = 0; i < resultArray->Length(); ++i) { | 413 for (size_t i = 0; i < resultArray->Length(); ++i) { |
| 414 v8::Local<v8::Value> value; | 414 v8::Local<v8::Value> value; |
| 415 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) | 415 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
| 416 return; | 416 return; |
| 417 results->push_back(value); | 417 results->push_back(value); |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |