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

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

Issue 2805333002: Move ScriptState::getExecutionContext (Part 1) (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ExecutionContext::ExecutionContext() 49 ExecutionContext::ExecutionContext()
50 : circular_sequential_id_(0), 50 : circular_sequential_id_(0),
51 in_dispatch_error_event_(false), 51 in_dispatch_error_event_(false),
52 is_context_suspended_(false), 52 is_context_suspended_(false),
53 is_context_destroyed_(false), 53 is_context_destroyed_(false),
54 window_interaction_tokens_(0), 54 window_interaction_tokens_(0),
55 referrer_policy_(kReferrerPolicyDefault) {} 55 referrer_policy_(kReferrerPolicyDefault) {}
56 56
57 ExecutionContext::~ExecutionContext() {} 57 ExecutionContext::~ExecutionContext() {}
58 58
59 ExecutionContext* ExecutionContext::From(const ScriptState* script_state) {
60 v8::HandleScope scope(script_state->GetIsolate());
61 return ToExecutionContext(script_state->GetContext());
62 }
63
59 void ExecutionContext::SuspendSuspendableObjects() { 64 void ExecutionContext::SuspendSuspendableObjects() {
60 DCHECK(!is_context_suspended_); 65 DCHECK(!is_context_suspended_);
61 NotifySuspendingSuspendableObjects(); 66 NotifySuspendingSuspendableObjects();
62 is_context_suspended_ = true; 67 is_context_suspended_ = true;
63 } 68 }
64 69
65 void ExecutionContext::ResumeSuspendableObjects() { 70 void ExecutionContext::ResumeSuspendableObjects() {
66 DCHECK(is_context_suspended_); 71 DCHECK(is_context_suspended_);
67 is_context_suspended_ = false; 72 is_context_suspended_ = false;
68 NotifyResumingSuspendableObjects(); 73 NotifyResumingSuspendableObjects();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 239 }
235 240
236 DEFINE_TRACE(ExecutionContext) { 241 DEFINE_TRACE(ExecutionContext) {
237 visitor->Trace(public_url_manager_); 242 visitor->Trace(public_url_manager_);
238 visitor->Trace(pending_exceptions_); 243 visitor->Trace(pending_exceptions_);
239 ContextLifecycleNotifier::Trace(visitor); 244 ContextLifecycleNotifier::Trace(visitor);
240 Supplementable<ExecutionContext>::Trace(visitor); 245 Supplementable<ExecutionContext>::Trace(visitor);
241 } 246 }
242 247
243 } // namespace blink 248 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698