| 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 * | 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 V8Proxy::registerExtension(DateExtension::get(), String()); | 331 V8Proxy::registerExtension(DateExtension::get(), String()); |
| 332 | 332 |
| 333 // Dynamically tell v8 about our extensions now. | 333 // Dynamically tell v8 about our extensions now. |
| 334 const V8Extensions& extensions = V8Proxy::extensions(); | 334 const V8Extensions& extensions = V8Proxy::extensions(); |
| 335 OwnArrayPtr<const char*> extensionNames(new const char*[extensions.size()]); | 335 OwnArrayPtr<const char*> extensionNames(new const char*[extensions.size()]); |
| 336 int index = 0; | 336 int index = 0; |
| 337 for (size_t i = 0; i < extensions.size(); ++i) { | 337 for (size_t i = 0; i < extensions.size(); ++i) { |
| 338 if (extensions[i].group && extensions[i].group != extensionGroup) | 338 if (extensions[i].group && extensions[i].group != extensionGroup) |
| 339 continue; | 339 continue; |
| 340 | 340 |
| 341 // Note: we check the loader URL here instead of the document URL | 341 if (extensions[i].useCallback) { |
| 342 // because we might be currently loading an URL into a blank page. | 342 // Ensure our date extension is always allowed. |
| 343 // See http://code.google.com/p/chromium/issues/detail?id=10924 | 343 if (extensions[i].extension != DateExtension::get() |
| 344 if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_fram
e->loader()->activeDocumentLoader()->url().protocol())) | 344 && !m_frame->loader()->client()->allowScriptExtension(extensions
[i].extension->name(), extensionGroup)) |
| 345 continue; | 345 continue; |
| 346 } else { |
| 347 // Note: we check the loader URL here instead of the document URL |
| 348 // because we might be currently loading an URL into a blank page. |
| 349 // See http://code.google.com/p/chromium/issues/detail?id=10924 |
| 350 if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_
frame->loader()->activeDocumentLoader()->url().protocol())) |
| 351 continue; |
| 352 } |
| 346 | 353 |
| 347 extensionNames[index++] = extensions[i].extension->name(); | 354 extensionNames[index++] = extensions[i].extension->name(); |
| 348 } | 355 } |
| 349 v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get(
)); | 356 v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get(
)); |
| 350 result = v8::Context::New(&extensionConfiguration, globalTemplate, global); | 357 result = v8::Context::New(&extensionConfiguration, globalTemplate, global); |
| 351 | 358 |
| 352 return result; | 359 return result; |
| 353 } | 360 } |
| 354 | 361 |
| 355 void V8DOMWindowShell::setContext(v8::Handle<v8::Context> context) | 362 void V8DOMWindowShell::setContext(v8::Handle<v8::Context> context) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 if (url.isNull()) | 608 if (url.isNull()) |
| 602 return; | 609 return; |
| 603 | 610 |
| 604 if (!shouldAllowNavigation(frame)) | 611 if (!shouldAllowNavigation(frame)) |
| 605 return; | 612 return; |
| 606 | 613 |
| 607 navigateIfAllowed(frame, url, false, false); | 614 navigateIfAllowed(frame, url, false, false); |
| 608 } | 615 } |
| 609 | 616 |
| 610 } // WebCore | 617 } // WebCore |
| OLD | NEW |