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

Side by Side Diff: Source/bindings/v8/PageScriptDebugServer.cpp

Issue 182903003: Make DOMWrapperWorld::current() callable from workers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "wtf/TemporaryChange.h" 49 #include "wtf/TemporaryChange.h"
50 #include "wtf/text/StringBuilder.h" 50 #include "wtf/text/StringBuilder.h"
51 51
52 namespace WebCore { 52 namespace WebCore {
53 53
54 static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co ntext) 54 static LocalFrame* retrieveFrameWithGlobalObjectCheck(v8::Handle<v8::Context> co ntext)
55 { 55 {
56 if (context.IsEmpty()) 56 if (context.IsEmpty())
57 return 0; 57 return 0;
58 58
59 // Test that context has associated global dom window object. 59 // FIXME: This is a temporary hack for crbug.com/345014.
60 if (!V8WindowShell::contextHasCorrectPrototype(context)) 60 // Currently it's possible that V8 can trigger Debugger::ProcessDebugEvent f or a context
61 // that is being initialized (i.e., inside Context::New() of the context).
62 // We should fix the V8 side so that it won't trigger the event for a half-b aked context
63 // because there is no way in the embedder side to check if the context is h alf-baked or not.
64 if (V8WindowShell::contextIsBeingInitialized())
61 return 0; 65 return 0;
62 66
63 v8::Handle<v8::Value> global = V8Window::findInstanceInPrototypeChain(contex t->Global(), context->GetIsolate()); 67 v8::Handle<v8::Value> global = V8Window::findInstanceInPrototypeChain(contex t->Global(), context->GetIsolate());
64 if (global.IsEmpty()) 68 if (global.IsEmpty())
65 return 0; 69 return 0;
66 70
67 return toFrameIfNotDetached(context); 71 return toFrameIfNotDetached(context);
68 } 72 }
69 73
70 void PageScriptDebugServer::setPreprocessorSource(const String& preprocessorSour ce) 74 void PageScriptDebugServer::setPreprocessorSource(const String& preprocessorSour ce)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 275
272 String PageScriptDebugServer::preprocessEventListener(LocalFrame* frame, const S tring& source, const String& url, const String& functionName) 276 String PageScriptDebugServer::preprocessEventListener(LocalFrame* frame, const S tring& source, const String& url, const String& functionName)
273 { 277 {
274 if (!canPreprocess(frame)) 278 if (!canPreprocess(frame))
275 return source; 279 return source;
276 280
277 return m_scriptPreprocessor->preprocessSourceCode(source, url, functionName) ; 281 return m_scriptPreprocessor->preprocessSourceCode(source, url, functionName) ;
278 } 282 }
279 283
280 } // namespace WebCore 284 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698