| 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 6319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6330 list->invalidateCacheForAttribute(attrName); | 6330 list->invalidateCacheForAttribute(attrName); |
| 6331 } | 6331 } |
| 6332 | 6332 |
| 6333 void Document::platformColorsChanged() { | 6333 void Document::platformColorsChanged() { |
| 6334 if (!isActive()) | 6334 if (!isActive()) |
| 6335 return; | 6335 return; |
| 6336 | 6336 |
| 6337 styleEngine().platformColorsChanged(); | 6337 styleEngine().platformColorsChanged(); |
| 6338 } | 6338 } |
| 6339 | 6339 |
| 6340 v8::Local<v8::Object> Document::wrap(v8::Isolate* isolate, | |
| 6341 v8::Local<v8::Object> creationContext) { | |
| 6342 DCHECK(!DOMDataStore::containsWrapper(this, isolate)); | |
| 6343 | |
| 6344 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); | |
| 6345 | |
| 6346 if (frame() && frame()->script().initializeMainWorld()) { | |
| 6347 // initializeMainWorld may have created a wrapper for the object, retry from | |
| 6348 // the start. | |
| 6349 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate); | |
| 6350 if (!wrapper.IsEmpty()) | |
| 6351 return wrapper; | |
| 6352 } | |
| 6353 | |
| 6354 v8::Local<v8::Object> wrapper = | |
| 6355 V8DOMWrapper::createWrapper(isolate, creationContext, wrapperType); | |
| 6356 DCHECK(!wrapper.IsEmpty()); | |
| 6357 return associateWithWrapper(isolate, wrapperType, wrapper); | |
| 6358 } | |
| 6359 | |
| 6360 v8::Local<v8::Object> Document::associateWithWrapper( | |
| 6361 v8::Isolate* isolate, | |
| 6362 const WrapperTypeInfo* wrapperType, | |
| 6363 v8::Local<v8::Object> wrapper) { | |
| 6364 wrapper = V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, | |
| 6365 wrapper); | |
| 6366 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); | |
| 6367 if (world.isMainWorld() && frame()) | |
| 6368 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); | |
| 6369 return wrapper; | |
| 6370 } | |
| 6371 | |
| 6372 bool Document::isSecureContext( | 6340 bool Document::isSecureContext( |
| 6373 String& errorMessage, | 6341 String& errorMessage, |
| 6374 const SecureContextCheck privilegeContextCheck) const { | 6342 const SecureContextCheck privilegeContextCheck) const { |
| 6375 bool isSecure = isSecureContextImpl(privilegeContextCheck); | 6343 bool isSecure = isSecureContextImpl(privilegeContextCheck); |
| 6376 if (getSandboxFlags() != SandboxNone) { | 6344 if (getSandboxFlags() != SandboxNone) { |
| 6377 UseCounter::count( | 6345 UseCounter::count( |
| 6378 *this, isSecure | 6346 *this, isSecure |
| 6379 ? UseCounter::SecureContextCheckForSandboxedOriginPassed | 6347 ? UseCounter::SecureContextCheckForSandboxedOriginPassed |
| 6380 : UseCounter::SecureContextCheckForSandboxedOriginFailed); | 6348 : UseCounter::SecureContextCheckForSandboxedOriginFailed); |
| 6381 } | 6349 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6580 } | 6548 } |
| 6581 | 6549 |
| 6582 void showLiveDocumentInstances() { | 6550 void showLiveDocumentInstances() { |
| 6583 WeakDocumentSet& set = liveDocumentSet(); | 6551 WeakDocumentSet& set = liveDocumentSet(); |
| 6584 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6552 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6585 for (Document* document : set) | 6553 for (Document* document : set) |
| 6586 fprintf(stderr, "- Document %p URL: %s\n", document, | 6554 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6587 document->url().getString().utf8().data()); | 6555 document->url().getString().utf8().data()); |
| 6588 } | 6556 } |
| 6589 #endif | 6557 #endif |
| OLD | NEW |