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

Side by Side Diff: Source/bindings/v8/V8Binding.h

Issue 14334002: Delete WorldContextHandle in favor of DOMWrapperWorld (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "V8ThrowException.h" 46 #include "V8ThrowException.h"
47 #include "V8ValueCache.h" 47 #include "V8ValueCache.h"
48 #include <wtf/Noncopyable.h> 48 #include <wtf/Noncopyable.h>
49 #include <wtf/text/AtomicString.h> 49 #include <wtf/text/AtomicString.h>
50 #include <v8.h> 50 #include <v8.h>
51 51
52 namespace WebCore { 52 namespace WebCore {
53 53
54 class DOMStringList; 54 class DOMStringList;
55 class ScriptExecutionContext; 55 class ScriptExecutionContext;
56 class WorldContextHandle;
57 56
58 const int kMaxRecursionDepth = 22; 57 const int kMaxRecursionDepth = 22;
59 58
60 // Schedule a DOM exception to be thrown, if the exception code is different 59 // Schedule a DOM exception to be thrown, if the exception code is different
61 // from zero. 60 // from zero.
62 v8::Handle<v8::Value> setDOMException(int, v8::Isolate*); 61 v8::Handle<v8::Value> setDOMException(int, v8::Isolate*);
63 62
64 // Schedule a JavaScript error to be thrown. 63 // Schedule a JavaScript error to be thrown.
65 v8::Handle<v8::Value> throwError(V8ErrorType, const char*, v8::Isolate*); 64 v8::Handle<v8::Value> throwError(V8ErrorType, const char*, v8::Isolate*);
66 65
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate*); 469 v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate*);
471 470
472 PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>, v8::Isolate *); 471 PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>, v8::Isolate *);
473 PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Iso late*); 472 PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Iso late*);
474 473
475 v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context>); 474 v8::Handle<v8::Object> toInnerGlobalObject(v8::Handle<v8::Context>);
476 DOMWindow* toDOMWindow(v8::Handle<v8::Context>); 475 DOMWindow* toDOMWindow(v8::Handle<v8::Context>);
477 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context>); 476 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context>);
478 477
479 // Returns the context associated with a ScriptExecutionContext. 478 // Returns the context associated with a ScriptExecutionContext.
480 v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, const WorldConte xtHandle&);
481 v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, DOMWrapperWorld* ); 479 v8::Local<v8::Context> toV8Context(ScriptExecutionContext*, DOMWrapperWorld* );
482 480
483 // Returns the frame object of the window object associated with 481 // Returns the frame object of the window object associated with
484 // a context, if the window is currently being displayed in the Frame. 482 // a context, if the window is currently being displayed in the Frame.
485 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>); 483 Frame* toFrameIfNotDetached(v8::Handle<v8::Context>);
486 484
487 inline DOMWrapperWorld* isolatedWorldForEnteredContext() 485 inline DOMWrapperWorld* isolatedWorldForEnteredContext()
488 { 486 {
489 v8::Handle<v8::Context> context = v8::Context::GetEntered(); 487 v8::Handle<v8::Context> context = v8::Context::GetEntered();
490 if (context.IsEmpty()) 488 if (context.IsEmpty())
491 return 0; 489 return 0;
492 return DOMWrapperWorld::isolatedWorld(context); 490 return DOMWrapperWorld::isolatedWorld(context);
493 } 491 }
494 492
495 // If the current context causes out of memory, JavaScript setting 493 // If the current context causes out of memory, JavaScript setting
496 // is disabled and it returns true. 494 // is disabled and it returns true.
497 bool handleOutOfMemory(); 495 bool handleOutOfMemory();
498 // FIXME: This should receive an Isolate. 496 // FIXME: This should receive an Isolate.
499 v8::Local<v8::Value> handleMaxRecursionDepthExceeded(); 497 v8::Local<v8::Value> handleMaxRecursionDepthExceeded();
500 498
501 void crashIfV8IsDead(); 499 void crashIfV8IsDead();
502 500
503 } // namespace WebCore 501 } // namespace WebCore
504 502
505 #endif // V8Binding_h 503 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698