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

Side by Side Diff: Source/bindings/core/v8/custom/V8WindowCustom.cpp

Issue 1083003004: bindings: Moves toV8 and v8SetReturnValue out to ToV8.h and V8Binding.h. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8 ::Value> key, v8::AccessType type, v8::Local<v8::Value>) 338 bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8 ::Value> key, v8::AccessType type, v8::Local<v8::Value>)
339 { 339 {
340 return securityCheck(host); 340 return securityCheck(host);
341 } 341 }
342 342
343 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i ndex, v8::AccessType type, v8::Local<v8::Value>) 343 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i ndex, v8::AccessType type, v8::Local<v8::Value>)
344 { 344 {
345 return securityCheck(host); 345 return securityCheck(host);
346 } 346 }
347 347
348 v8::Handle<v8::Value> toV8(DOMWindow* window, v8::Handle<v8::Object> creationCon text, v8::Isolate* isolate)
349 {
350 // Notice that we explicitly ignore creationContext because the LocalDOMWind ow is its own creationContext.
351
352 if (!window)
353 return v8::Null(isolate);
354 // Initializes environment of a frame, and return the global object
355 // of the frame.
356 Frame * frame = window->frame();
357 if (!frame)
358 return v8Undefined();
359
360 v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current (isolate));
361 if (context.IsEmpty())
362 return v8Undefined();
363
364 v8::Local<v8::Object> global = context->Global();
365 ASSERT(!global.IsEmpty());
366 return global;
367 }
368
369 } // namespace blink 348 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/V8EventTargetCustom.cpp ('k') | Source/bindings/core/v8/custom/V8WorkerGlobalScopeCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698