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

Side by Side Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 months 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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 LocalFrame* frame = toLocalFrame(m_frame); 367 LocalFrame* frame = toLocalFrame(m_frame);
368 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob al(), context->GetIsolate()); 368 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob al(), context->GetIsolate());
369 if (documentWrapper.IsEmpty()) 369 if (documentWrapper.IsEmpty())
370 return; 370 return;
371 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty()); 371 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp ty());
372 if (m_document.isEmpty()) 372 if (m_document.isEmpty())
373 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); 373 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper));
374 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); 374 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document());
375 375
376 ASSERT(documentWrapper->IsObject()); 376 ASSERT(documentWrapper->IsObject());
377 // TODO(bashi): Avoid using ForceSet(). When we use accessors to implement
378 // attributes, we may be able to remove updateDocumentProperty().
377 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO nly | v8::DontDelete)))) 379 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO nly | v8::DontDelete))))
378 return; 380 return;
379 381
380 // We also stash a reference to the document on the inner global object so t hat 382 // We also stash a reference to the document on the inner global object so t hat
381 // LocalDOMWindow objects we obtain from JavaScript references are guarantee d to have 383 // LocalDOMWindow objects we obtain from JavaScript references are guarantee d to have
382 // live Document objects. 384 // live Document objects.
383 V8HiddenValue::setHiddenValue(m_isolate, toInnerGlobalObject(context), V8Hid denValue::document(m_isolate), documentWrapper); 385 V8HiddenValue::setHiddenValue(m_isolate, toInnerGlobalObject(context), V8Hid denValue::document(m_isolate), documentWrapper);
384 } 386 }
385 387
386 void WindowProxy::updateActivityLogger() 388 void WindowProxy::updateActivityLogger()
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 516
515 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 517 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
516 { 518 {
517 ASSERT(m_world->isMainWorld()); 519 ASSERT(m_world->isMainWorld());
518 if (!isContextInitialized()) 520 if (!isContextInitialized())
519 return; 521 return;
520 setSecurityToken(origin); 522 setSecurityToken(origin);
521 } 523 }
522 524
523 } // namespace blink 525 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8ObjectBuilder.cpp ('k') | Source/bindings/core/v8/inspector/V8InjectedScriptHost.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698