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

Side by Side Diff: Source/core/dom/ExecutionContext.cpp

Issue 325143002: Oilpan: Prepare moving inspector script related classes to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 #include "core/events/EventTarget.h" 34 #include "core/events/EventTarget.h"
35 #include "core/html/PublicURLManager.h" 35 #include "core/html/PublicURLManager.h"
36 #include "core/inspector/InspectorInstrumentation.h" 36 #include "core/inspector/InspectorInstrumentation.h"
37 #include "core/inspector/ScriptCallStack.h" 37 #include "core/inspector/ScriptCallStack.h"
38 #include "core/workers/WorkerGlobalScope.h" 38 #include "core/workers/WorkerGlobalScope.h"
39 #include "core/workers/WorkerThread.h" 39 #include "core/workers/WorkerThread.h"
40 #include "wtf/MainThread.h" 40 #include "wtf/MainThread.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 class ExecutionContext::PendingException { 44 class ExecutionContext::PendingException {
haraken 2014/06/11 06:27:36 I guess it's easy to move PendingException to the
keishi 2014/06/11 14:40:55 Done.
45 WTF_MAKE_NONCOPYABLE(PendingException); 45 WTF_MAKE_NONCOPYABLE(PendingException);
46 public: 46 public:
47 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack) 47 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack)
48 : m_errorMessage(errorMessage) 48 : m_errorMessage(errorMessage)
49 , m_lineNumber(lineNumber) 49 , m_lineNumber(lineNumber)
50 , m_columnNumber(columnNumber) 50 , m_columnNumber(columnNumber)
51 , m_sourceURL(sourceURL) 51 , m_sourceURL(sourceURL)
52 , m_callStack(callStack) 52 , m_callStack(callStack)
53 { 53 {
54 } 54 }
55 String m_errorMessage; 55 String m_errorMessage;
56 int m_lineNumber; 56 int m_lineNumber;
57 int m_columnNumber; 57 int m_columnNumber;
58 String m_sourceURL; 58 String m_sourceURL;
59 RefPtr<ScriptCallStack> m_callStack; 59 RefPtrWillBePersistent<ScriptCallStack> m_callStack;
60 }; 60 };
61 61
62 ExecutionContext::ExecutionContext() 62 ExecutionContext::ExecutionContext()
63 : m_client(0) 63 : m_client(0)
64 , m_sandboxFlags(SandboxNone) 64 , m_sandboxFlags(SandboxNone)
65 , m_circularSequentialID(0) 65 , m_circularSequentialID(0)
66 , m_inDispatchErrorEvent(false) 66 , m_inDispatchErrorEvent(false)
67 , m_activeDOMObjectsAreSuspended(false) 67 , m_activeDOMObjectsAreSuspended(false)
68 , m_activeDOMObjectsAreStopped(false) 68 , m_activeDOMObjectsAreStopped(false)
69 { 69 {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Ensure all ActiveDOMObjects are suspended also newly created ones. 121 // Ensure all ActiveDOMObjects are suspended also newly created ones.
122 if (m_activeDOMObjectsAreSuspended) 122 if (m_activeDOMObjectsAreSuspended)
123 object->suspend(); 123 object->suspend();
124 } 124 }
125 125
126 bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access ControlStatus corsStatus) 126 bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access ControlStatus corsStatus)
127 { 127 {
128 return !(securityOrigin()->canRequest(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); 128 return !(securityOrigin()->canRequest(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin);
129 } 129 }
130 130
131 void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, PassRefPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus) 131 void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, AccessControlStatus corsStat us)
132 { 132 {
133 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event; 133 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event;
134 if (m_inDispatchErrorEvent) { 134 if (m_inDispatchErrorEvent) {
135 if (!m_pendingExceptions) 135 if (!m_pendingExceptions)
136 m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> > ()); 136 m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> > ());
137 m_pendingExceptions->append(adoptPtr(new PendingException(errorEvent->me ssageForConsole(), errorEvent->lineno(), errorEvent->colno(), errorEvent->filena me(), callStack))); 137 m_pendingExceptions->append(adoptPtr(new PendingException(errorEvent->me ssageForConsole(), errorEvent->lineno(), errorEvent->colno(), errorEvent->filena me(), callStack)));
138 return; 138 return;
139 } 139 }
140 140
141 // First report the original exception and only then all the nested ones. 141 // First report the original exception and only then all the nested ones.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 RELEASE_ASSERT(m_client); 327 RELEASE_ASSERT(m_client);
328 // The SandboxOrigin is stored redundantly in the security origin. 328 // The SandboxOrigin is stored redundantly in the security origin.
329 if (isSandboxed(SandboxOrigin) && m_client->securityContext().securityOrigin () && !m_client->securityContext().securityOrigin()->isUnique()) { 329 if (isSandboxed(SandboxOrigin) && m_client->securityContext().securityOrigin () && !m_client->securityContext().securityOrigin()->isUnique()) {
330 m_client->securityContext().setSecurityOrigin(SecurityOrigin::createUniq ue()); 330 m_client->securityContext().setSecurityOrigin(SecurityOrigin::createUniq ue());
331 m_client->didUpdateSecurityOrigin(); 331 m_client->didUpdateSecurityOrigin();
332 } 332 }
333 } 333 }
334 334
335 } // namespace WebCore 335 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698