Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2525313004: binding: Removes Document::wrap that must be equivalent to Node::wrap. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 6293 matching lines...) Expand 10 before | Expand all | Expand 10 after
6304 list->invalidateCacheForAttribute(attrName); 6304 list->invalidateCacheForAttribute(attrName);
6305 } 6305 }
6306 6306
6307 void Document::platformColorsChanged() { 6307 void Document::platformColorsChanged() {
6308 if (!isActive()) 6308 if (!isActive())
6309 return; 6309 return;
6310 6310
6311 styleEngine().platformColorsChanged(); 6311 styleEngine().platformColorsChanged();
6312 } 6312 }
6313 6313
6314 v8::Local<v8::Object> Document::wrap(v8::Isolate* isolate,
6315 v8::Local<v8::Object> creationContext) {
6316 DCHECK(!DOMDataStore::containsWrapper(this, isolate));
6317
6318 const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
6319
6320 if (frame() && frame()->script().initializeMainWorld()) {
6321 // initializeMainWorld may have created a wrapper for the object, retry from
6322 // the start.
6323 v8::Local<v8::Object> wrapper = DOMDataStore::getWrapper(this, isolate);
6324 if (!wrapper.IsEmpty())
6325 return wrapper;
6326 }
6327
6328 v8::Local<v8::Object> wrapper =
6329 V8DOMWrapper::createWrapper(isolate, creationContext, wrapperType);
6330 DCHECK(!wrapper.IsEmpty());
6331 return associateWithWrapper(isolate, wrapperType, wrapper);
6332 }
6333
6334 v8::Local<v8::Object> Document::associateWithWrapper(
6335 v8::Isolate* isolate,
6336 const WrapperTypeInfo* wrapperType,
6337 v8::Local<v8::Object> wrapper) {
6338 wrapper = V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
6339 wrapper);
6340 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
6341 if (world.isMainWorld() && frame())
6342 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper);
6343 return wrapper;
6344 }
6345
6346 bool Document::isSecureContext( 6314 bool Document::isSecureContext(
6347 String& errorMessage, 6315 String& errorMessage,
6348 const SecureContextCheck privilegeContextCheck) const { 6316 const SecureContextCheck privilegeContextCheck) const {
6349 bool isSecure = isSecureContextImpl(privilegeContextCheck); 6317 bool isSecure = isSecureContextImpl(privilegeContextCheck);
6350 if (getSandboxFlags() != SandboxNone) { 6318 if (getSandboxFlags() != SandboxNone) {
6351 UseCounter::count( 6319 UseCounter::count(
6352 *this, isSecure 6320 *this, isSecure
6353 ? UseCounter::SecureContextCheckForSandboxedOriginPassed 6321 ? UseCounter::SecureContextCheckForSandboxedOriginPassed
6354 : UseCounter::SecureContextCheckForSandboxedOriginFailed); 6322 : UseCounter::SecureContextCheckForSandboxedOriginFailed);
6355 } 6323 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
6543 } 6511 }
6544 6512
6545 void showLiveDocumentInstances() { 6513 void showLiveDocumentInstances() {
6546 WeakDocumentSet& set = liveDocumentSet(); 6514 WeakDocumentSet& set = liveDocumentSet();
6547 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6515 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6548 for (Document* document : set) 6516 for (Document* document : set)
6549 fprintf(stderr, "- Document %p URL: %s\n", document, 6517 fprintf(stderr, "- Document %p URL: %s\n", document,
6550 document->url().getString().utf8().data()); 6518 document->url().getString().utf8().data());
6551 } 6519 }
6552 #endif 6520 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698