| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 6315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6326 list->invalidateCacheForAttribute(attrName); | 6326 list->invalidateCacheForAttribute(attrName); |
| 6327 } | 6327 } |
| 6328 | 6328 |
| 6329 void Document::platformColorsChanged() { | 6329 void Document::platformColorsChanged() { |
| 6330 if (!isActive()) | 6330 if (!isActive()) |
| 6331 return; | 6331 return; |
| 6332 | 6332 |
| 6333 styleEngine().platformColorsChanged(); | 6333 styleEngine().platformColorsChanged(); |
| 6334 } | 6334 } |
| 6335 | 6335 |
| 6336 v8::Local<v8::Object> Document::wrap(v8::Isolate* isolate, | |
| 6337 v8::Local<v8::Object> creationContext) { | |
| 6338 DCHECK(!DOMDataStore::containsWrapper(this, isolate)); | |
| 6339 | |
| 6340 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); | |
| 6341 | |
| 6342 if (frame() && frame()->script().initializeMainWorld()) { | |
| 6343 // initializeMainWorld may have created a wrapper for the object, retry from | |
| 6344 // the start. | |
| 6345 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate); | |
| 6346 if (!wrapper.IsEmpty()) | |
| 6347 return wrapper; | |
| 6348 } | |
| 6349 | |
| 6350 v8::Local<v8::Object> wrapper = | |
| 6351 V8DOMWrapper::createWrapper(isolate, creationContext, wrapperType); | |
| 6352 DCHECK(!wrapper.IsEmpty()); | |
| 6353 return associateWithWrapper(isolate, wrapperType, wrapper); | |
| 6354 } | |
| 6355 | |
| 6356 v8::Local<v8::Object> Document::associateWithWrapper( | |
| 6357 v8::Isolate* isolate, | |
| 6358 const WrapperTypeInfo* wrapperType, | |
| 6359 v8::Local<v8::Object> wrapper) { | |
| 6360 wrapper = V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, | |
| 6361 wrapper); | |
| 6362 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); | |
| 6363 if (world.isMainWorld() && frame()) | |
| 6364 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); | |
| 6365 return wrapper; | |
| 6366 } | |
| 6367 | |
| 6368 bool Document::isSecureContext( | 6336 bool Document::isSecureContext( |
| 6369 String& errorMessage, | 6337 String& errorMessage, |
| 6370 const SecureContextCheck privilegeContextCheck) const { | 6338 const SecureContextCheck privilegeContextCheck) const { |
| 6371 bool isSecure = isSecureContextImpl(privilegeContextCheck); | 6339 bool isSecure = isSecureContextImpl(privilegeContextCheck); |
| 6372 if (getSandboxFlags() != SandboxNone) { | 6340 if (getSandboxFlags() != SandboxNone) { |
| 6373 UseCounter::count( | 6341 UseCounter::count( |
| 6374 *this, isSecure | 6342 *this, isSecure |
| 6375 ? UseCounter::SecureContextCheckForSandboxedOriginPassed | 6343 ? UseCounter::SecureContextCheckForSandboxedOriginPassed |
| 6376 : UseCounter::SecureContextCheckForSandboxedOriginFailed); | 6344 : UseCounter::SecureContextCheckForSandboxedOriginFailed); |
| 6377 } | 6345 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6576 } | 6544 } |
| 6577 | 6545 |
| 6578 void showLiveDocumentInstances() { | 6546 void showLiveDocumentInstances() { |
| 6579 WeakDocumentSet& set = liveDocumentSet(); | 6547 WeakDocumentSet& set = liveDocumentSet(); |
| 6580 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6548 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6581 for (Document* document : set) | 6549 for (Document* document : set) |
| 6582 fprintf(stderr, "- Document %p URL: %s\n", document, | 6550 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6583 document->url().getString().utf8().data()); | 6551 document->url().getString().utf8().data()); |
| 6584 } | 6552 } |
| 6585 #endif | 6553 #endif |
| OLD | NEW |